1 /* File: config.h */
2 
3 /* Purpose: Angband specific configuration stuff */
4 
5 /* Note : Much of the functionality of this file is being phased into
6  * mangband.cfg.  This will allow server reconfiguration without recompilation.
7  */
8 
9 /*
10  * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
11  *
12  * This software may be copied and distributed for educational, research, and
13  * not for profit purposes provided that this copyright and statement are
14  * included in all such copies.
15  */
16 
17 
18 /*
19  * Look through the following lines, and where a comment includes the
20  * tag "OPTION:", examine the associated "#define" statements, and decide
21  * whether you wish to keep, comment, or uncomment them.  You should not
22  * have to modify any lines not indicated by "OPTION".
23  *
24  * Note: Also examine the "system" configuration file "h-config.h"
25  * and the variable initialization file "variable.c".  If you change
26  * anything in "variable.c", you only need to recompile that file.
27  *
28  * And finally, remember that the "Makefile" will specify some rather
29  * important compile time options, like what visual module to use.
30  */
31 
32 /*
33  * define this if you wish to limit players to one character playing
34  * at a time on the server.  Note this doesn't stop them from just
35  * using two computers side by side, but most won't have this.
36 #define LIMIT_PLAYER_CONNECTIONS
37  */
38 
39 /*
40  * OPTION: Set the metaserver address.  The metaserver keeps track of
41  * all running servers so people can find an active server with other
42  * players on.  Define this to be an empty string if you don't want to
43  * report to a metaserver.
44  */
45 #define	META_ADDRESS "mangband.org"
46 
47 
48 /*
49  * OPTION: Set a vhost bind address.  This is used in two ways.
50  * For one, it sets the name the metaserver will list for the IP.
51  * This is useful if your IP has a different reverse address (or no
52  * reverse address), and you'd like the metaserver to list you by
53  * the established name here.
54  *
55  * This is also useful if you have multiple IP's on a single box,
56  * and care which one the server binds too, (for name purposes, perhaps).
57  * Note that this would allow multiple servers to run on a single
58  * machine as well.
59  *
60 #define	BIND_NAME "tester"
61 #define	BIND_IP "192.168.1.199"
62 */
63 
64 
65 /*
66  * OPTION: Disconnect starving players.  If defined, starving players
67  * will be kicked out of the game (to protect their characters), given
68  * they've been AFK for at least the specified number of seconds.
69  */
70 #define DISCONNECT_STARVING (60 * 3)
71 
72 /*
73  * OPTION: Allow the use of "sound" in various places.
74  */
75 #define USE_SOUND
76 
77 /*
78  * OPTION: Allow the use of "graphics" in various places
79  */
80 #define USE_GRAPHICS
81 
82 /*
83  * OPTION: Default fonts (when using X11)
84  */
85 #define DEFAULT_X11_FONT_SCREEN		DEFAULT_X11_FONT
86 #define DEFAULT_X11_FONT_MIRROR		DEFAULT_X11_FONT
87 #define DEFAULT_X11_FONT_RECALL		DEFAULT_X11_FONT
88 #define DEFAULT_X11_FONT_CHOICE		DEFAULT_X11_FONT
89 
90 
91 
92 /*
93  * OPTION: Hack -- Macintosh stuff
94  */
95 #ifdef MACINTOSH
96 
97 /* Do not handle signals */
98 /* also available using the -Z switch on startup for mangband */
99 # undef HANDLE_SIGNALS
100 
101 #endif
102 
103 /*
104  * OPTION: See the Makefile(s), where several options may be declared.
105  *
106  * Some popular options include "USE_GCU" (allow use with Unix "curses"),
107  * "USE_X11" (allow basic use with Unix X11), "USE_XAW" (allow use with
108  * Unix X11 plus the Athena Widget set), and "USE_CAP" (allow use with
109  * the "termcap" library, or with hard-coded vt100 terminals).
110  *
111  * The old "USE_NCU" option has been replaced with "USE_GCU".
112  *
113  * Several other such options are available for non-unix machines,
114  * such as "MACINTOSH", "WINDOWS", "USE_IBM", "USE_EMX".
115  *
116  * You may also need to specify the "system", using defines such as
117  * "SOLARIS" (for Solaris), etc, see "h-config.h" for more info.
118  */
119 
120 
121 /*
122  * OPTION: Include some debugging code.  Note that this option may
123  * result in a server that crashes more frequently, as a core dump
124  * will be done instead of killing the bad connection.
125  */
126 /* #define DEBUG */
127 
128 
129 /*
130  * OPTION: define "SPECIAL_BSD" for using certain versions of UNIX
131  * that use the 4.4BSD Lite version of Curses in "main-gcu.c"
132  */
133 /* #define SPECIAL_BSD */
134 
135 
136 /*
137  * OPTION: Use the POSIX "termios" methods in "main-gcu.c"
138  */
139 #define USE_TPOSIX
140 
141 /*
142  * OPTION: Use the "termio" methods in "main-gcu.c"
143  */
144 /* #define USE_TERMIO */
145 
146 /*
147  * OPTION: Use the icky BSD "tchars" methods in "main-gcu.c"
148  */
149 /* #define USE_TCHARS */
150 
151 
152 
153 /*
154  * OPTION: Use the "curs_set()" call in "main-gcu.c".
155  * Hack -- This option will not work on most BSD machines
156  */
157 #if defined(SYS_V) || defined(linux) || defined(__FreeBSD__)
158 # define USE_CURS_SET
159 #endif
160 
161 
162 
163 /*
164  * OPTION: Default font (when using X11).
165  */
166 #define DEFAULT_X11_FONT		"9x15"
167 
168 /*
169  * OPTION: for multi-user machines running the game setuid to some other
170  * user (like 'games') this SAFE_SETUID option allows the program to drop
171  * its privileges when saving files that allow for user specified pathnames.
172  * This lets the game be installed system wide without major security
173  * concerns.  There should not be any side effects on any machines.
174  *
175  * This will handle "gids" correctly once the permissions are set right.
176  * --VERY DANGEROUS IN MANGBAND.
177  */
178 #define SAFE_SETUID
179 
180 
181 /*
182  * This flag enables the "POSIX" methods for "SAFE_SETUID".
183  */
184 #ifdef _POSIX_SAVED_IDS
185 # define SAFE_SETUID_POSIX
186 #endif
187 
188 
189 /*
190  * This "fix" is from "Yoshiaki KASAHARA <kasahara@csce.kyushu-u.ac.jp>"
191  * It prevents problems on (non-Solaris) Suns using "SAFE_SETUID".
192  */
193 #if defined(sun) && !defined(SOLARIS)
194 # undef SAFE_SETUID_POSIX
195 #endif
196 
197 
198 /*
199  * OPTION: Verify savefile Checksums (Angband 2.7.0 and up)
200  * This option can help prevent "corruption" of savefiles, and also
201  * stop intentional modification by amateur users.
202  */
203 #define VERIFY_CHECKSUMS
204 
205 
206 /*
207  * OPTION: Forbid the use of "fiddled" savefiles.  As far as I can tell,
208  * a fiddled savefile is one with an internal timestamp different from
209  * the actual timestamp.  Thus, turning this option on forbids one from
210  * copying a savefile to a different name.  Combined with disabling the
211  * ability to save the game without quitting, and with some method of
212  * stopping the user from killing the process at the tombstone screen,
213  * this should prevent the use of backup savefiles.  It may also stop
214  * the use of savefiles from other platforms, so be careful.
215  */
216 /* #define VERIFY_TIMESTAMP */
217 
218 
219 /*
220  * OPTION: Forbid the "savefile over-write" cheat, in which you simply
221  * run another copy of the game, loading a previously saved savefile,
222  * and let that copy over-write the "dead" savefile later.  This option
223  * either locks the savefile, or creates a fake "xxx.lok" file to prevent
224  * the use of the savefile until the file is deleted.  Not ready yet.
225  */
226 /* #define VERIFY_SAVEFILE */
227 
228 
229 /*
230  * OPTION: Use wider corrdiors (room for two people abreast).
231  */
232 #define WIDE_CORRIDORS
233 
234 /*
235  * OPTION: Do not switch to manual targeting if there are no
236  * targets in the vicinity of player (un-Angband), display a prompt instead
237  */
238 #define NOTARGET_PROMPT
239 
240 /*
241  * OPTION: Enable experimental command overloading.
242  * Command overloads eat more bandwitch, but give more flexibility.
243  */
244 #define COMMAND_OVERLOAD
245 
246 /*
247  * OPTION: Hack -- Compile in support for "Cyborg" mode
248  */
249 /* #define ALLOW_BORG */
250 
251 /*
252  * OPTION: Hack -- Compile in support for "Wizard Commands"
253  */
254 /* #define ALLOW_WIZARD */
255 
256 /*
257  * OPTION: Hack -- Compile in support for "Spoiler Generation"
258  */
259 /* #define ALLOW_SPOILERS */
260 
261 
262 /*
263  * OPTION: Allow "do_cmd_colors" at run-time
264  */
265 #define ALLOW_COLORS
266 
267 /*
268  * OPTION: Allow "do_cmd_visuals" at run-time
269  */
270 #define ALLOW_VISUALS
271 
272 /*
273  * OPTION: Allow "do_cmd_macros" at run-time
274  */
275 #define ALLOW_MACROS
276 
277 
278 /*
279  * OPTION: Allow characteres to be "auto-rolled"
280  * --broken in mangband.
281  */
282 /* #define ALLOW_AUTOROLLER */
283 
284 
285 /*
286  * OPTION: Allow monsters to "flee" when hit hard
287  */
288 #define ALLOW_FEAR
289 
290 /*
291  * OPTION: Allow monsters to "flee" from strong players
292  */
293 #define ALLOW_TERROR
294 
295 
296 /*
297  * OPTION: Allow parsing of the ascii template files in "init.c".
298  * This must be defined if you do not have valid binary image files.
299  * It should be usually be defined anyway to allow easy "updating".
300  */
301 #define ALLOW_TEMPLATES
302 
303 /*
304  * OPTION: Allow loading of pre-2.7.0 savefiles.  Note that it takes
305  * about 15K of code in "save-old.c" to parse the old savefile format.
306  * Angband 2.8.0 will ignore a lot of info from pre-2.7.0 savefiles.
307  * --broken in mangband.
308  */
309 /* #define ALLOW_OLD_SAVEFILES */
310 
311 /* Use the new houseless code for Wilderness levels, including invaders. */
312 /*
313 #define DEVEL_TOWN_COMPATIBILITY 0
314 */
315 
316 
317 /*
318  * OPTION: Delay the loading of the "f_text" array until it is actually
319  * needed, saving ~1K, since "feature" descriptions are unused.
320  * --broken in mangband.
321  */
322 /* #define DELAY_LOAD_F_TEXT */
323 
324 /*
325  * OPTION: Delay the loading of the "k_text" array until it is actually
326  * needed, saving ~1K, since "object" descriptions are unused.
327  * --broken in mangband.
328  */
329 /* #define DELAY_LOAD_K_TEXT */
330 
331 /*
332  * OPTION: Delay the loading of the "a_text" array until it is actually
333  * needed, saving ~1K, since "artifact" descriptions are unused.
334  * --broken in mangband.
335  */
336 /* #define DELAY_LOAD_A_TEXT */
337 
338 /*
339  * OPTION: Delay the loading of the "e_text" array until it is actually
340  * needed, saving ~1K, since "ego-item" descriptions are unused.
341  * --broken in mangband.
342  */
343 /* #define DELAY_LOAD_E_TEXT */
344 
345 /*
346  * OPTION: Delay the loading of the "r_text" array until it is actually
347  * needed, saving ~60K, but "simplifying" the "monster" descriptions.
348  * --broken in mangband.
349  */
350 /* #define DELAY_LOAD_R_TEXT */
351 
352 /*
353  * OPTION: Delay the loading of the "v_text" array until it is actually
354  * needed, saving ~1K, but "destroying" the "vault" generation.
355  * --broken in mangband.
356  */
357 /* #define DELAY_LOAD_V_TEXT */
358 
359 
360 /*
361  * OPTION: Handle signals
362  */
363 #define HANDLE_SIGNALS
364 
365 
366 /*
367  * OPTION: Hack -- Windows stuff
368  */
369 #if defined(WINDOWS) || defined(__WIN32__)
370 
371 /* Do not handle signals */
372 #undef HANDLE_SIGNALS
373 
374 #endif
375 
376 
377 /*
378  * Allow "Wizards" to yield "high scores"
379  * --broken in mangband.
380  */
381 /* #define SCORE_WIZARDS */
382 
383 /*
384  * Allow "Borgs" to yield "high scores"
385  * --broken in mangband.
386  */
387 /* #define SCORE_BORGS */
388 
389 /*
390  * Allow "Cheaters" to yield "high scores"
391  * --broken in mangband.
392  */
393 /* #define SCORE_CHEATERS */
394 
395 
396 
397 
398 /*
399  * OPTION: Allow use of the "flow_by_smell" and "flow_by_sound"
400  * software options, which enable "monster flowing".
401  * --broken in mangband.
402  */
403 /* #define MONSTER_FLOW */
404 
405 
406 /*
407  * OPTION: Maximum flow depth when using "MONSTER_FLOW"
408  */
409 #define MONSTER_FLOW_DEPTH 32
410 
411 
412 
413 /*
414  * OPTION: Allow use of extended spell info	-DRS-
415  */
416 #define DRS_SHOW_SPELL_INFO
417 
418 /*
419  * OPTION: Allow use of the monster health bar	-DRS-
420  */
421 #define DRS_SHOW_HEALTH_BAR
422 
423 
424 /*
425  * OPTION: Enable the "smart_learn" and "smart_cheat" options.
426  * They let monsters make more "intelligent" choices about attacks
427  * (including spell attacks) based on their observations of the
428  * player's reactions to previous attacks.  The "smart_cheat" option
429  * lets the monster know how the player would react to an attack
430  * without actually needing to make the attack.  The "smart_learn"
431  * option requires that a monster make a "failed" attack before
432  * learning that the player is not harmed by that attack.
433  *
434  * This adds about 3K to the memory and about 5K to the executable.
435  * --broken in mangband.
436  */
437 /* #define DRS_SMART_OPTIONS */
438 
439 
440 
441 /*
442  * OPTION: Enable the "track_follow" and "track_target" options.
443  * They let monsters follow the player's foot-prints, or remember
444  * the player's recent locations.  This code has been removed from
445  * the current version because it is being rewritten by Billy, and
446  * until it is ready, it will not work.  Do not define this option.
447  * --broken in mangband.
448  */
449 /* #define WDT_TRACK_OPTIONS */
450 
451 
452 
453 
454 
455 /*
456  * OPTION: Set the "default" path to the angband "lib" directory.
457  *
458  * See "main.c" for usage, and note that this value is only used on
459  * certain machines, primarily Unix machines.  If this value is used,
460  * it will be over-ridden by the "ANGBAND_PATH" environment variable,
461  * if that variable is defined and accessable.  The final slash is
462  * optional, but it may eventually be required.
463  *
464  * Using the value "./lib/" below tells Angband that, by default,
465  * the user will run "angband" from the same directory that contains
466  * the "lib" directory.  This is a reasonable (but imperfect) default.
467  *
468  * If at all possible, you should change this value to refer to the
469  * actual location of the "lib" folder, for example, "/tmp/angband/lib/"
470  * or "/usr/games/lib/angband/", or "/pkg/angband/lib".
471  */
472 #ifndef PKGDATADIR
473 # define PKGDATADIR DEFAULT_PATH
474 #endif
475 #ifndef LOCALSTATEDIR
476 # define LOCALSTATEDIR DEFAULT_PATH
477 #endif
478 
479 
480 /*
481  * On multiuser systems, add the "uid" to savefile names
482  */
483 #ifdef SET_UID
484 # define SAVEFILE_USE_UID
485 #endif
486 
487 
488 /*
489  * OPTION: Check the "time" against "lib/file/hours.txt"
490  * --not used in mangband
491  */
492 /* #define CHECK_TIME */
493 
494 /*
495  * OPTION: Check the "load" against "lib/file/load.txt"
496  * This may require the 'rpcsvs' library
497  * --not used in mangband
498  */
499 /* #define CHECK_LOAD */
500 
501 
502 /*
503  * OPTION: For some brain-dead computers with no command line interface,
504  * namely Macintosh, there has to be some way of "naming" your savefiles.
505  * The current "Macintosh" hack is to make it so whenever the character
506  * name changes, the savefile is renamed accordingly.  But on normal
507  * machines, once you manage to "load" a savefile, it stays that way.
508  * Macintosh is particularly weird because you can load savefiles that
509  * are not contained in the "lib:save:" folder, and if you change the
510  * player's name, it will then save the savefile elsewhere.  Note that
511  * this also gives a method of "bypassing" the "VERIFY_TIMESTAMP" code.
512  */
513 #if defined(MACINTOSH) || defined(WINDOWS) || defined(AMIGA)
514 # define SAVEFILE_MUTABLE
515 #endif
516 
517 
518 /*
519  * OPTION: Capitalize the "user_name" (for "default" player name)
520  * This option is only relevant on SET_UID machines.
521  */
522 #define CAPITALIZE_USER_NAME
523 
524 
525 
526 /*
527  * OPTION: Shimmer Multi-Hued monsters/objects
528  */
529 #define SHIMMER_MONSTERS
530 #define SHIMMER_OBJECTS
531 
532 
533 
534 /*
535  * Hack -- Special "ancient machine" versions
536  */
537 #if defined(USE_286) || defined(ANGBAND_LITE_MAC)
538 # ifndef ANGBAND_LITE
539 #  define ANGBAND_LITE
540 # endif
541 #endif
542 
543 /*
544  * OPTION: Attempt to minimize the size of the game
545  */
546 #ifndef ANGBAND_LITE
547 /* #define ANGBAND_LITE */
548 #endif
549 
550 /*
551  * Hack -- React to the "ANGBAND_LITE" flag
552  */
553 #ifdef ANGBAND_LITE
554 # undef ALLOW_COLORS
555 # undef ALLOW_VISUALS
556 # undef ALLOW_MACROS
557 # undef MONSTER_FLOW
558 # undef WDT_TRACK_OPTIONS
559 # undef DRS_SMART_OPTIONS
560 # undef ALLOW_OLD_SAVEFILES
561 # undef ALLOW_BORG
562 # undef ALLOW_WIZARD
563 # undef ALLOW_SPOILERS
564 # undef ALLOW_TEMPLATES
565 # undef DELAY_LOAD_R_TEXT
566 # define DELAY_LOAD_R_TEXT
567 #endif
568 
569 
570 
571 /*
572  * OPTION: Attempt to prevent all "cheating"
573  */
574 #define VERIFY_HONOR
575 
576 
577 /*
578  * React to the "VERIFY_HONOR" flag
579  */
580 #ifdef VERIFY_HONOR
581 # define VERIFY_SAVEFILE
582 # define VERIFY_CHECKSUMS
583 # define VERIFY_TIMESTAMPS
584 #endif
585 
586 
587 /*
588  * OPTION: Use "blocking getch() calls" in "main-gcu.c".
589  * Hack -- Note that this option will NOT work on many BSD machines
590  * Currently used whenever available, if you get a warning about
591  * "nodelay()" undefined, then make sure to undefine this.
592  */
593 #if defined(SYS_V) || defined(AMIGA) || defined(linux)
594 # define USE_GETCH
595 #endif
596 
597 /*
598  * OPTION: for the AFS distributed file system, define this to ensure that
599  * the program is secure with respect to the setuid code.  This option has
600  * not been tested (to the best of my knowledge).  This option may require
601  * some weird tricks with "player_uid" and such involving "defines".
602  * Note that this option used the AFS library routines Authenticate(),
603  * bePlayer(), beGames() to enforce the proper priviledges.
604  * You may need to turn "SAFE_SETUID" off to use this option.
605  */
606 /* #define SECURE */
607 
608