Crossfire Server, Trunk
config.h
Go to the documentation of this file.
1 #ifndef CONFIG_H
2 #define CONFIG_H
3 
24 /* There are 4 main sections to this file-
25  * Section 1 is feature selection (enabling/disabling certain features)
26  *
27  * Section 2 is compiler/machine dependant section (stuff that just
28  * makes the program compile and run properly, but don't change the
29  * behavior)
30  *
31  * Section 3 is location of certain files and other defaults. Things in
32  * this section generally do not need to be changed, and generally do
33  * not alter the play as perceived by players. However, you may
34  * have your own values you want to set here.
35  *
36  * Section 4 deals with save file related options.
37  */
38 
39 /*******************************************************************
40  * SECTION 1 - FEATURES
41  *
42  * You don't have to change anything here to get a working program, but
43  * you may want to on personal preferance. Items are arranged
44  * alphabetically.
45  *
46  * Short list of features, and what to search for:
47  * CS_LOGSTATS - log various new client/server data.
48  * DEBUG - more verbose message logging?
49  * MAP_CLIENT_X, MAP_CLIENT_Y - determines max size client map will receive
50  * MAX_TIME - how long an internal tick is in microseconds
51  * MANY_CORES - generate core dumps on gross errors instead of continuing?
52  * PARTY_KILL_LOG - stores party kill information
53  * WATCHDOG - allows use of an external watchdog program
54  *
55  ***********************************************************************/
56 
57 /* These are basically experimental values right now - perhaps should
58  * be turned into settings values at load time, but want to make
59  * sure we go down this road before doing that.
60  *
61  * MIN_PLAYER_SPEED: If a player is fully loaded with junk, this is
62  * how slow the character will move.
63  *
64  * MAX_PLAYER_SPEED: If the player is unloaded, this is how fast the
65  * player will move. Note that armor will still affect this (a
66  * character otherwise unloaded but wearing plate will be slower)
67  *
68  * FREE_PLAYER_LOAD_PERCENT: This value is how much of the players
69  * load is 'free' before it starts slowing them down - just because
70  * I pick up a book doesn't make me slower.
71  *
72  * Example: Player has a max carrying capacity of 1000 kg. If he is
73  * carrying 1000 KG, he moves at MIN_PLAYER_SPEED (0.25 by default).
74  * The free load is 0.50 (50%), which means he can carry 500 kg before
75  * he starts to slow down. So if his load is anywhere between 0 and 500 kg
76  * and character is otherwise not wearing armor or other things that slow
77  * him down, he moves at 0.75
78  * Once he goes above 500 kg, his speed is now a linear difference of
79  * MIN and MAX. With the nice round numbers chosen, it amounts to
80  * each 1 kg of look slows character down 0.001 (500 * 0.001 = 0.5,
81  * 0.75 - 0.5 = 0.25)
82  *
83  * The values can be adjusted in various ways - a free load percent
84  * of 1.0 means how much you carry does not affect movement speed.
85  * One could also adjust these values for slower of faster movement.
86  *
87  * 0.75 was chosen as default for fast movement as this gives room
88  * for magic (and other effects) to speed up the player, but speed
89  * still remain below 1.
90  *
91  * 0.25 was chosen as low end as that is still fairly slow (about
92  * 2 spaces/second), but not so slow to be really painful -
93  * typically it is low level characters that have this issue
94  * more, so I think this will improve playing quality.
95  */
96 #define MIN_PLAYER_SPEED 0.25
97 #define MAX_PLAYER_SPEED 0.75
98 #define FREE_PLAYER_LOAD_PERCENT 0.50
99 
100 /*
101  * BASE_WEAPON_SPEED is sort of like the speed - what the characters
102  * weapon_speed is before we start factoring in bonuses & penalties.
103  * Want fast melee? Increase this. Slow melee? decrease this.
104  * Note that weapon_speed decreases this, so generally you want
105  * to start higher, as there isn't a lot of things that
106  * will increase this
107  */
108 #define BASE_WEAPON_SPEED 1.0
109 
110 /* Use balanced stat loss code?
111  * This code is a little more merciful with repeated stat loss at lower
112  * levels. Basically, the more stats you have lost, the less likely that
113  * you will lose more. Additionally, lower level characters are shown
114  * a lot more mercy (there are caps on how much of a stat you can lose too).
115  * On the nasty side, if you are higher level, you can lose mutiple stats
116  * _at_once_ and are shown less mercy when you die. But when you're higher
117  * level, it is much easier to buy back your stats with potions.
118  * Turn this on if you want death-based stat loss to be more merciful
119  * at low levels and more cruel at high levels.
120  * Only works when stats are depleted rather than lost. This option has
121  * no effect if you are using genuine stat loss.
122  *
123  * The BALSL_.. values control this behaviour.
124  * BALSL_NUMBER_LOSSES_RATIO determines the number of stats to lose.
125  * the character level is divided by that value, and that is how many
126  * stats are lost.
127  *
128  * BALSL_MAX_LOSS_RATIO puts the upper limit on depletion of a stat -
129  * basically, level/max_loss_ratio is the most a stat can be depleted.
130  *
131  * BALSL_LOSS_CHANCE_RATIO controls how likely it is a stat is depleted.
132  * The chance not to lose a stat is
133  * depleteness^2 / (depletedness^2+ level/ratio).
134  * ie, if the stats current depleted value is 2 and the character is level
135  * 15, the chance not to lose the stat is 4/(4+3) or 4/7. The higher the
136  * level, the more likely it is a stat can get really depleted, but
137  * this gets more offset as the stat gets more depleted.
138  *
139  */
140 /* GD */
141 
142 #define BALSL_LOSS_CHANCE_RATIO 4
143 #define BALSL_NUMBER_LOSSES_RATIO 6
144 #define BALSL_MAX_LOSS_RATIO 2
145 
146 /* Don't edit these values. They are configured in lib/settings. These are
147  Simply the defaults. */
148 
149 #define BALANCED_STAT_LOSS FALSE
150 #define PERMANENT_EXPERIENCE_RATIO 50
151 #define DEATH_PENALTY_RATIO 20
152 #define DEATH_PENALTY_LEVEL 3
153 #define SET_TITLE TRUE
154 #define SIMPLE_EXP TRUE
155 #define SPELLPOINT_LEVEL_DEPEND TRUE
156 #define SPELL_ENCUMBRANCE TRUE
157 #define SPELL_FAILURE_EFFECTS FALSE
158 #define REAL_WIZ TRUE
159 #define RECYCLE_TMP_MAPS FALSE
160 #define ALWAYS_SHOW_HP FALSE
161 #define RESURRECTION FALSE
162 #define SEARCH_ITEMS TRUE
163 #define NOT_PERMADETH TRUE
164 #define STAT_LOSS_ON_DEATH FALSE
165 #define PK_LUCK_PENALTY 1
166 #define CASTING_TIME FALSE
167 #define SET_FRIENDLY_FIRE 5
168 #define ARMOR_MAX_ENCHANT 5
169 #define ARMOR_WEIGHT_REDUCTION 10
170 #define ARMOR_WEIGHT_LINEAR TRUE
171 #define ARMOR_SPEED_IMPROVEMENT 10
172 #define ARMOR_SPEED_LINEAR TRUE
173 
174 /* you can edit the ones below */
175 
184 #ifndef WIN32 /* ***win32 we set the following stuff in the IDE */
185 #define CS_LOGSTATS
186 #endif
187 #ifdef CS_LOGSTATS
188 #define CS_LOGTIME 60
189 #endif
190 
196 #ifndef WIN32 /* ***win32 we set the following stuff in the IDE */
197 #ifndef DEBUG
198 #define DEBUG
199 #endif
200 #endif
201 
211 #define MANY_CORES
212 
237 #define MAP_CLIENT_X 25
238 #define MAP_CLIENT_Y 25
239 
240 /* Default map size */
241 #define MAP_CLIENT_X_DEFAULT 11
242 #define MAP_CLIENT_Y_DEFAULT 11
243 
244 /* Minimum map size */
245 #define MAP_CLIENT_X_MINIMUM 9
246 #define MAP_CLIENT_Y_MINIMUM 9
247 
254 #define MAX_TIME 120000
255 
262 /*
263 #define PARTY_KILL_LOG 20
264 */
265 
287 /* GD */
288 
289 #define PERM_EXP_GAIN_RATIO 0.50f
290 #define PERM_EXP_MAX_LOSS_RATIO 0.50f
291 
299 #ifndef WIN32 /* ***win32 disable watchdog as win32 default */
300 #define WATCHDOG
301 #endif
302 
303 
304 /***********************************************************************
305  * SECTION 2 - Machine/Compiler specific stuff.
306  *
307  * Short list of items:
308  * O_NDELAY - If you don't have O_NDELAY, uncomment it.
309  *
310  ***********************************************************************/
311 
321 /*
322 #define O_NDELAY O_NONBLOCK
323 */
324 
325 
326 /***********************************************************************
327  * Section 3
328  *
329  * General file and other defaults that don't need to be changed, and
330  * do not change gameplay as percieved by players much. Some options
331  * may affect memory consumption however.
332  *
333  * Values:
334  *
335  * BANFILE - ban certain users/hosts.
336  * CSPORT - port to use for new client/server
337  * DMFILE - file with dm/wizard access lists
338  * LOGFILE - where to log if using -daemon option
339  * MAP_ - various map timeout and swapping parameters
340  * MOTD - message of the day - printed each time someone joins the game
341  * PERM_FILE - limit play times
342  * SHUTDOWN - used when shutting down the server
343  * SOCKETBUFSIZE - size of the output socket buffer
344  * TMPDIR - directory to use for temp files
345  * UNIQUE_DIR - directory to put unique item files into
346  * USE_CALLOC for some memory requests
347  ***********************************************************************
348  */
349 
354 #ifndef BANFILE
355 #define BANFILE "ban_file"
356 #endif
357 
362 #define CSPORT 13327 /* old port + 1 */
363 
368 #ifndef DMFILE
369 #define DMFILE "dm_file"
370 #endif
371 
376 #ifndef LOGFILE
377 #ifdef WIN32 /* change define path */
378 #define LOGFILE "var\\crossfire.log"
379 #else
380 #define LOGFILE "/var/log/crossfire/logfile"
381 #endif
382 #endif
383 
407 #define MAP_MAXTIMEOUT 1000
408 
409 #define MAP_MINTIMEOUT 500
410 
425 #define MAP_MAXRESET 7200
426 
427 #define MAP_DEFAULTRESET 7200
428 
440 /*#define MEMORY_DEBUG*/
441 
448 #define MOTD "motd"
449 
454 #define PERM_FILE "forbid"
455 
462 #ifndef SHUTDOWN_FILE
463 #define SHUTDOWN_FILE "shutdown"
464 #endif
465 
472 #define SOCKETBUFSIZE 1024*1024
473 
484 /*#define TMPDIR "/home/hugin/a/crossfire/crossfire/tmp"*/
485 #ifdef WIN32 /* change define path tmp */
486 #define TMPDIR "tmp"
487 #else
488 #define TMPDIR "/tmp"
489 #endif
490 
496 #define UNIQUE_DIR "unique-items"
497 
503 #ifdef WIN32 /* change define path city */
504 # define EMERGENCY_MAPPATH "\\world\\world_105_115"
505 #else
506 # define EMERGENCY_MAPPATH "/world/world_105_115"
507 #endif
508 # define EMERGENCY_X 5
509 # define EMERGENCY_Y 37
510 
515 #define MAPDIR "maps"
516 #define TEMPLATE_DIR "template-maps"
517 #define REGIONS "regions.reg"
518 #define OLD_HIGHSCORE "highscore"
519 #define HIGHSCORE_DIR "highscores"
520 #define BANISHFILE "banish_file"
521 
522 #define MAX_ERRORS 25
523 #define STARTMAX 500
524 #define OBJ_EXPAND 100
526 #define HIGHSCORE_LENGTH 1000
528 #define MAXSTRING 20
529 
530 /***********************************************************************
531  * Section 4 - save player options.
532  *
533  * There are a lot of things that deal with the save files, and what
534  * gets saved with them, so I put them in there own section.
535  *
536  ***********************************************************************/
537 
548 #ifndef PLAYERDIR
549 #define PLAYERDIR "players"
550 #endif
551 
563 #define SAVE_MODE 0660
564 #define SAVE_DIR_MODE 0770
565 
566 /* NOTE ON SAVE_INTERVAL and AUTOSAVE: Only one of these two really
567  * needs to be selected. You can set both, and things will work fine,
568  * however, it just means that a lot more saving will be done, which
569  * can slow things down some.
570  */
571 
582 /*#define SAVE_INTERVAL 300*/
583 
594 #define AUTOSAVE 5000
595 
602 #define NO_EMERGENCY_SAVE
603 
610 /*#define BACKUP_SAVE_AT_HOME*/
611 
629 #define RESET_LOCATION_TIME 3600
630 
636 #define BEAT_INTERVAL 3
637 
638 #endif /* CONFIG_H */