Crossfire Server, Trunk  R20708
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 
253 #define NO_POLYMORPH
254 
261 /*
262 #define PARTY_KILL_LOG 20
263 */
264 
286 /* GD */
287 
288 #define PERM_EXP_GAIN_RATIO 0.50f
289 #define PERM_EXP_MAX_LOSS_RATIO 0.50f
290 
298 #ifndef WIN32 /* ***win32 disable watchdog as win32 default */
299 #define WATCHDOG
300 #endif
301 
302 
303 /***********************************************************************
304  * SECTION 2 - Machine/Compiler specific stuff.
305  *
306  * Short list of items:
307  * O_NDELAY - If you don't have O_NDELAY, uncomment it.
308  *
309  ***********************************************************************/
310 
320 /*
321 #define O_NDELAY O_NONBLOCK
322 */
323 
324 
325 /***********************************************************************
326  * Section 3
327  *
328  * General file and other defaults that don't need to be changed, and
329  * do not change gameplay as percieved by players much. Some options
330  * may affect memory consumption however.
331  *
332  * Values:
333  *
334  * BANFILE - ban certain users/hosts.
335  * CSPORT - port to use for new client/server
336  * DMFILE - file with dm/wizard access lists
337  * LOGFILE - where to log if using -daemon option
338  * MAP_ - various map timeout and swapping parameters
339  * MAX_OBJECTS - how many objects to keep in memory.
340  * MAX_OBJECTS_LWM - only swap maps out if below that value
341  * MOTD - message of the day - printed each time someone joins the game
342  * PERM_FILE - limit play times
343  * SHUTDOWN - used when shutting down the server
344  * SOCKETBUFSIZE - size of buffer used internally by the server for storing
345  * backlogged messages.
346  * TMPDIR - directory to use for temp files
347  * UNIQUE_DIR - directory to put unique item files into
348  * USE_CALLOC for some memory requests
349  ***********************************************************************
350  */
351 
356 #ifndef BANFILE
357 #define BANFILE "ban_file"
358 #endif
359 
364 #define CSPORT 13327 /* old port + 1 */
365 
370 #ifndef DMFILE
371 #define DMFILE "dm_file"
372 #endif
373 
378 #ifndef LOGFILE
379 #ifdef WIN32 /* change define path */
380 #define LOGFILE "var\\crossfire.log"
381 #else
382 #define LOGFILE "/var/log/crossfire/logfile"
383 #endif
384 #endif
385 
409 #define MAP_MAXTIMEOUT 1000
410 
411 #define MAP_MINTIMEOUT 500
412 
427 #define MAP_MAXRESET 7200
428 
429 #define MAP_DEFAULTRESET 7200
430 
444 #define MAX_OBJECTS 100000
445 
468 /*#define MAX_OBJECTS_LWM MAX_OBJECTS/2*/
469 
486 /*#define MEMORY_DEBUG 1*/
487 
494 #define MOTD "motd"
495 
500 #define PERM_FILE "forbid"
501 
508 #ifndef SHUTDOWN_FILE
509 #define SHUTDOWN_FILE "shutdown"
510 #endif
511 
522 #define SOCKETBUFSIZE 256*1024
523 
534 /*#define TMPDIR "/home/hugin/a/crossfire/crossfire/tmp"*/
535 #ifdef WIN32 /* change define path tmp */
536 #define TMPDIR "tmp"
537 #else
538 #define TMPDIR "/tmp"
539 #endif
540 
546 #define UNIQUE_DIR "unique-items"
547 
553 #ifdef WIN32 /* change define path city */
554 # define EMERGENCY_MAPPATH "\\world\\world_105_115"
555 #else
556 # define EMERGENCY_MAPPATH "/world/world_105_115"
557 #endif
558 # define EMERGENCY_X 5
559 # define EMERGENCY_Y 37
560 
565 #define MAPDIR "maps"
566 #define TEMPLATE_DIR "template-maps"
567 #define ARCHETYPES "archetypes"
568 #define REGIONS "regions.reg"
569 #define HIGHSCORE "highscore"
570 #define TREASURES "treasures"
571 #define BANISHFILE "banish_file"
572 
573 #define MAX_ERRORS 25
574 #define STARTMAX 500
575 #define OBJ_EXPAND 100
577 #define HIGHSCORE_LENGTH 1000
579 #define ARCHTABLE 8192
580 #define MAXSTRING 20
581 
582 #define COMMAND_HASH_SIZE 107
584 /***********************************************************************
585  * Section 4 - save player options.
586  *
587  * There are a lot of things that deal with the save files, and what
588  * gets saved with them, so I put them in there own section.
589  *
590  ***********************************************************************/
591 
602 #ifndef PLAYERDIR
603 #define PLAYERDIR "players"
604 #endif
605 
617 #define SAVE_MODE 0660
618 #define SAVE_DIR_MODE 0770
619 
620 /* NOTE ON SAVE_INTERVAL and AUTOSAVE: Only one of these two really
621  * needs to be selected. You can set both, and things will work fine,
622  * however, it just means that a lot more saving will be done, which
623  * can slow things down some.
624  */
625 
636 /*#define SAVE_INTERVAL 300*/
637 
648 #define AUTOSAVE 5000
649 
656 #define NO_EMERGENCY_SAVE
657 
664 /*#define BACKUP_SAVE_AT_HOME*/
665 
683 #define RESET_LOCATION_TIME 3600
684 
690 #define BEAT_INTERVAL 3
691 
692 #endif /* CONFIG_H */