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 600
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 
246 #define MAX_TIME 120000
247 
254 /*
255 #define PARTY_KILL_LOG 20
256 */
257 
279 /* GD */
280 
281 #define PERM_EXP_GAIN_RATIO 0.50f
282 #define PERM_EXP_MAX_LOSS_RATIO 0.50f
283 
291 #ifndef WIN32 /* ***win32 disable watchdog as win32 default */
292 #define WATCHDOG
293 #endif
294 
295 
296 /***********************************************************************
297  * SECTION 2 - Machine/Compiler specific stuff.
298  *
299  * Short list of items:
300  * O_NDELAY - If you don't have O_NDELAY, uncomment it.
301  *
302  ***********************************************************************/
303 
313 /*
314 #define O_NDELAY O_NONBLOCK
315 */
316 
317 
318 /***********************************************************************
319  * Section 3
320  *
321  * General file and other defaults that don't need to be changed, and
322  * do not change gameplay as percieved by players much. Some options
323  * may affect memory consumption however.
324  *
325  * Values:
326  *
327  * BANFILE - ban certain users/hosts.
328  * CSPORT - port to use for new client/server
329  * DMFILE - file with dm/wizard access lists
330  * LOGFILE - where to log if using -daemon option
331  * MAP_ - various map timeout and swapping parameters
332  * MOTD - message of the day - printed each time someone joins the game
333  * PERM_FILE - limit play times
334  * SHUTDOWN - used when shutting down the server
335  * SOCKETBUFSIZE - size of the output socket buffer
336  * TMPDIR - directory to use for temp files
337  * UNIQUE_DIR - directory to put unique item files into
338  * USE_CALLOC for some memory requests
339  ***********************************************************************
340  */
341 
346 #ifndef BANFILE
347 #define BANFILE "ban_file"
348 #endif
349 
354 #define CSPORT 13327 /* old port + 1 */
355 
360 #ifndef DMFILE
361 #define DMFILE "dm_file"
362 #endif
363 
368 #ifndef LOGFILE
369 #ifdef WIN32 /* change define path */
370 #define LOGFILE "var\\crossfire.log"
371 #else
372 #define LOGFILE "/var/log/crossfire/logfile"
373 #endif
374 #endif
375 
399 #define MAP_MAXTIMEOUT 1000
400 
401 #define MAP_MINTIMEOUT 500
402 
417 #define MAP_MAXRESET 7200
418 
419 #define MAP_DEFAULTRESET 7200
420 
432 /*#define MEMORY_DEBUG*/
433 
440 #define MOTD "motd"
441 
446 #define PERM_FILE "forbid"
447 
454 #ifndef SHUTDOWN_FILE
455 #define SHUTDOWN_FILE "shutdown"
456 #endif
457 
464 #define SOCKETBUFSIZE 256*1024
465 
476 /*#define TMPDIR "/home/hugin/a/crossfire/crossfire/tmp"*/
477 #ifdef WIN32 /* change define path tmp */
478 #define TMPDIR "tmp"
479 #else
480 #define TMPDIR "/tmp"
481 #endif
482 
488 #define UNIQUE_DIR "unique-items"
489 
495 #ifdef WIN32 /* change define path city */
496 # define EMERGENCY_MAPPATH "\\world\\world_105_115"
497 #else
498 # define EMERGENCY_MAPPATH "/world/world_105_115"
499 #endif
500 # define EMERGENCY_X 5
501 # define EMERGENCY_Y 37
502 
507 #define MAPDIR "maps"
508 #define TEMPLATE_DIR "template-maps"
509 #define REGIONS "regions.reg"
510 #define OLD_HIGHSCORE "highscore"
511 #define HIGHSCORE_DIR "highscores"
512 #define BANISHFILE "banish_file"
513 
514 #define MAX_ERRORS 25
515 #define STARTMAX 500
516 #define OBJ_EXPAND 100
518 #define HIGHSCORE_LENGTH 1000
520 #define MAXSTRING 20
521 
522 /***********************************************************************
523  * Section 4 - save player options.
524  *
525  * There are a lot of things that deal with the save files, and what
526  * gets saved with them, so I put them in there own section.
527  *
528  ***********************************************************************/
529 
540 #ifndef PLAYERDIR
541 #define PLAYERDIR "players"
542 #endif
543 
555 #define SAVE_MODE 0660
556 #define SAVE_DIR_MODE 0770
557 
558 /* NOTE ON SAVE_INTERVAL and AUTOSAVE: Only one of these two really
559  * needs to be selected. You can set both, and things will work fine,
560  * however, it just means that a lot more saving will be done, which
561  * can slow things down some.
562  */
563 
574 /*#define SAVE_INTERVAL 300*/
575 
586 #define AUTOSAVE 5000
587 
594 #define NO_EMERGENCY_SAVE
595 
602 /*#define BACKUP_SAVE_AT_HOME*/
603 
621 #define RESET_LOCATION_TIME 3600
622 
628 #define BEAT_INTERVAL 3
629 
630 #endif /* CONFIG_H */