forked from cotillion/cd-gamedriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
365 lines (310 loc) · 9.18 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
/*
config.h
Some configuration parameters
*/
#ifndef __lpc_config_h_
#define __lpc_config_h_
/*
* If you want driver support for word-wrapped output enable this.
*/
#define WORD_WRAP
/*
* Max size of a file allowed to be read by 'read_file()'.
*/
#define READ_FILE_MAX_SIZE 500000
/* Version of the game in the form xx.xx.xx (leading zeroes) gc.
* Two digits will be appended, that is the patch level.
*/
#define GAME_VERSION "CD.06."
/*
* If you define this explode() will strip any leading delimiters.
*/
#undef OLD_EXPLODE
/*
* If you don't define this explode will strip any trailing delimiters
* and 'implode(explode(someString, delimiter), delimiter) == someString'
* will not be true for all strings 'someString' and 'delimiter'.
*/
#undef KINGDOMS_EXPLODE
/*
* If you define this, this_player() will be set in callouts according do
* 'old' rules. This is only to provide backwards compatibility.
*/
#define THIS_PLAYER_IN_CALLOUT
/*
* Should the indent code in "ed" be enabled?
*/
#define ED_INDENT
/*
* Should we warn if the same file is included multiple times?
*/
#define WARN_INCLUDES
/*
* What file, if any, to automatically include.
*/
#define AUTO_INCLUDE "</secure/auto.h>"
/* If you define this add_action(,,1) will not require whitespace
* between the verb and the arguments
*/
#define COMPAT_ADD_ACTIONS
/*
* Allow negative indexes in slices of arrays.
*/
#define NEGATIVE_SLICE_INDEX
/*
* The resolution of a float argument to call_out
*/
#define TIME_RES 128
/*
* The number of entries in the call out array.
*/
#define NUM_SLOTS 0x4000 /* MUST be a power of 2 */
/*
* The maximum number of call outs per object
*/
#define MAX_CALL_OUT 512
/*
* How to extract an unsigned char from a char *.
* If your compiler has the type 'unsigned char', then the cast-version
* is best. If you do not know, use the simple version, and the game will
* immediately terminate with a message if bad.
*/
#define EXTRACT_UCHAR(p) (*(unsigned char *)(p))
/*
* Define the maximum stack size of the stack machine. This stack will also
* contain all local variables and arguments.
*/
#define EVALUATOR_STACK_SIZE 0x2000
/*
* Define the maximum call depth for functions.
*/
#define MAX_TRACE 0x400
/*
* Define the size of the compiler stack. This defines how complex
* expressions the compiler can parse. The value should be big enough.
*/
#define COMPILER_STACK_SIZE 0x2000
/*
* With this option defined you can trace mudlib execution from within the
* mud. Do not keep it switched on constantly because it consumes quite a bit
*/
#undef TRACE_CODE
/*
* Does the system have a getrusage call?
*/
#define RUSAGE
/*
* How big, if we want it, should the global cache be?
*
* This cache, written by Amylaar, can increase the speed of calls
* to functions. The cache is allocated globally and indexed with
* a number hashed from the functionname / programname.
*
* NOTE!!!
* The size given be below must be an even power of 2 and _if_ defined
* must not be less than 2.
*/
#define GLOBAL_CACHE 0x4000
/* Enable extensive cache statistics */
#define CACHE_STATS
/*
If this is defined then the normal 'init' is not called in an object with
this_player set to the encountering living object. Instead 'encounter' is
is called in the living object, this_player is set to the living object.
The normal encounter: encounter(object ob) { ob->init() }
*/
#define USE_ENCOUNTER_NOT_INIT
/*
* Maximum number of bits in a bit field. They are stored in printable
* strings, 6 bits per byte.
*/
#define MAX_BITS 49152 /* even 6 */
/*
* There is a hash table for living objects, used by find_living().
*/
#define LIVING_HASH_SIZE 0x1000
/*
* Define what port number the game is to use.
*/
#define PORTNO 3011
/*
* Max number of local variables in a function.
*/
#define MAX_LOCAL 127
/*
* The hashing function used for pointers to shared strings.
* The >> shift is because pointers are often aligned to multiples of 4.
*/
#define PTR_HASH(ptr, size)\
((((((long)(ptr)) / sizeof(void *)) & 0xffff) ^ \
((((long)(ptr)) / sizeof(void *)) >> 16)) % (unsigned long)(size) )
/* Maximum number of evaluated nodes/loop.
* If this is exceeded, current function is halted.
*/
#define MAX_COST 5000000
/*
* EXTRA_COST
*
* Extra eval cost that will be added when doing a catch().
* Note that in the event of recursive catch() calls, only
* the top level catch() will get the extra limit applied.
*/
#define EXTRA_COST 10000
/*
* Maximum length of inherit chain
*/
#define MAX_INHERIT 42
/*
* Maximum number of nested includes
*/
#define MAX_INCLUDE 30
/*
* Where to swap out objects. This file is not used if NUM_RESET_TO_SWAP
* is 0.
*/
#define SWAP_FILE "LP_SWAP"
/*
* This is the maximum array size allowed for one single array.
*/
#define MAX_ARRAY_SIZE 131072
/*
* Maximum size of a mapping.
*/
#define MAX_MAPPING_SIZE 131072
/*
* Maximum number of players in the game.
*
* This is the absolute maximum, the mudlib will probably set a lower level.
*/
#define MAX_PLAYERS 4000
/*
* Reserve an extra memory area from malloc(), to free when we run out
* of memory to get some warning and tell master about our memory troubles.
* If this value is 0, no area will be reserved.
*/
#define RESERVED_SIZE (1 << 24)
/*
#define RESERVED_SIZE (1 << 17)
*/
/* Define the size of the shared string hash table. This number should
* a prime, probably between 1000 and 30000; if you set it to about 1/5
* of the number of distinct strings you have, you will get a hit ratio
* (number of comparisons to find a string) very close to 1, as found strings
* are automatically moved to the head of a hash chain. You will never
* need more, and you will still get good results with a smaller table.
* THIS IS NOT IMPLEMENTED YET.
*/
#define HTABLE_SIZE 262144
/*
* Object hash table size.
* Define this like you did with the strings; probably set to about 1/4 of
* the number of objects in a game, as the distribution of accesses to
* objects is somewhat more uniform than that of strings.
*/
#define OTABLE_SIZE 262144 /* we have several thousand obs usually */
/*
* Define SYSV if you are running system V with a lower release level than
* Sys V.4.
*/
#undef SYSV
/*
* Define FCHMOD_MISSING only if your system doesn't have fchmod().
*/
#undef FCHMOD_MISSING
/*
* Define MAX_BYTE_TRANSFER to the number of bytes you allow to be read
* and written with read_bytes and write_bytes
*/
#define MAX_BYTE_TRANSFER 50000
/*
* CATCH_UDP_PORT
*
* Define this if the mud are to catch incoming udp messages on a
* specific port. If == -1 it will not be used unless the mud is started
* with the -u### flag. Where ### is the portnumber for the udp port.
* If undefined the -u flag will be ignored.
#define CATCH_UDP_PORT 2500
*/
#undef CATCH_UDP_PORT
/*
* UDP_SEND_HOSTNAME
*
* Define this if you want udp_send() to be able to send UDP datagrams
* to both addresses hostnames. When disabled, only IP addresses are
* supported. When enabled, both addresses and hostnames are supports.
* Defining this may add additional lag to your MUD.
*/
#undef UDP_SEND_HOSTNAME
/*
* SERVICE_PORT
*
* Define this if the mud are to answer service requests from other
* programs. If == -1 it will not be used unless the mud is started
* with the -p### flag. Where ### is the portnumber for the service
* port. If undefined the -p flag will be ignored.
*/
#define SERVICE_PORT 3003
/*
* ALLOWED_SERVICE
*
* Define this to the IP address of the machine that should be allowed
* to connect to the service port. Note that the local host can always
* connect via the loopback address (127.0.0.1). The address must be
* specified in hexadecimal.
*/
#define ALLOWED_SERVICE 0x7F000001
/*
* OPCPROF
*
* Define this to have the driver count calls to efuns
*/
#undef OPCPROF
/*
* PROFILE_LPC
*
* With this defined statistics of all objects and functions are kept.
*
* The information is accessible through debug("top_ten_cpu"),
* debug("object_cpu", object), debug("getprofile", object),
*
* This costs memory and cpu, only do it for mudlib profiling purposes.
*/
#define PROFILE_LPC
/*
* SUPER_SNOOP
*
* With this defined, you can add someone to a file called
* snoop/snooped which will then be snooped in the
* gamedriver.
*
* Rereading the file is done by calling debug("update snoops");
*/
#define SUPER_SNOOP
/*
* DEFAULT_CHARSET
*
* The charset the server will request that clients use with the
* CHARSET telnet option.
*/
#define DEFAULT_CHARSET "ISO-8859-1"
/*
* DEFAULT_LC_CTYPE
*
* The GD is using isprint() and friends to filter chars when reading
* files and other data, this means that the CTYPE locale must be set
* to something reasonable.
*
* In most cases you will want to set this to a locale which works with
* DEFAULT_CHARSET.
*
* When set to "" locale will be set from the environment variables.
*/
#define DEFAULT_LC_CTYPE "en_US.ISO-8859-1"
/*
* DEFAULT_LC_ALL
*
* The default locale to set upon GD startup.
* When set to "" locale will be set from the environment variables.
*/
#define DEFAULT_LC_ALL "C"
#endif