Crossfire Server, Trunk  R20513
init.c
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 1999-2014 Mark Wedel and the Crossfire Development Team
5  * Copyright (c) 1992 Frank Tore Johansen
6  *
7  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
8  * welcome to redistribute it under certain conditions. For details, please
9  * see COPYING and LICENSE.
10  *
11  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
12  */
13 
19 #define EXTERN
20 #define INIT_C
21 
22 #include "global.h"
23 
24 #include <stdlib.h>
25 #include <string.h>
26 
27 #include "object.h"
28 #include "output_file.h"
29 
30 static void init_environ(void);
31 static void init_defaults(void);
32 static void init_dynamic(void);
33 static void init_clocks(void);
34 static void init_attackmess(void);
35 
36 /*
37  * You unforunately need to looking in include/global.h to see what these
38  * correspond to.
39  */
40 struct Settings settings = {
41  NULL, /* Logfile */
42  CSPORT, /* Client/server port */
43 
44  llevInfo, /* Debug level */
45  0, NULL, /* dumpvalues, dumparg */
46  CONFDIR,
47  DATADIR,
48  LOCALDIR,
51  TMPDIR,
59  SIMPLE_EXP,
61  SET_TITLE,
67  REAL_WIZ,
71  "", /* Who format specifier */
72  "", /* who wiz format specifier */
73  MOTD,
74  "rules",
75  "news",
76  "", /* DM_MAIL */
77  0, /* This and the next 3 values are metaserver values */
78  "",
79  "",
80  0,
81  "",
82  0, 0, 0, 0, 0, 0, 0, /* worldmap settings*/
83  NULL, EMERGENCY_X, EMERGENCY_Y,
84  0,
85  1.0,
86  /* Armor enchantment stuff */
92  1, /* no_player_stealing */
93  0, /* create_home_portals */
94  1, /* personalized_blessings */
95  5000000, /* pk_max_experience */
96  10, /* pk_max_experience_percent */
97  0, /* allow_denied_spells_writing */
98  0, /* allow_broken_converters */
99  0, /* log_timestamp */
100  NULL, /* log_timestamp_format */
101  3, /* starting_stat_min */
102  18, /* starting_stat_max */
103  85, /* starting_stat_points */
104  115, /* roll_stat_points */
105  0, /* max_stat - will be loaded from stats file */
106  1, /* special_break_map, 1 for historical reasons */
107  NULL, /* disabled_plugins */
108  0, /* ignore_plugin_compatibility */
109  FALSE, /* account_block_create */
110  NULL, /* Trusted host for account creation. */
111 };
112 
114 
120 const char *const spellpathnames[NRSPELLPATHS] = {
121  "Protection",
122  "Fire",
123  "Frost",
124  "Electricity",
125  "Missiles",
126  "Self",
127  "Summoning",
128  "Abjuration",
129  "Restoration",
130  "Detonation",
131  "Mind",
132  "Creation",
133  "Teleportation",
134  "Information",
135  "Transmutation",
136  "Transferrence",
137  "Turning",
138  "Wounding",
139  "Death",
140  "Light"
141 };
142 
143 
155 static void init_emergency_mappath(void) {
156  char filename[MAX_BUF], tmpbuf[MAX_BUF];
157  FILE *fp;
158  int online = 0;
159 
161 
162  /* If this file doesn't exist, not a big deal */
163  snprintf(filename, sizeof(filename), "%s/%s/.emergency", settings.datadir, settings.mapdir);
164  fp = fopen(filename, "r");
165  if (fp != NULL) {
166  while (fgets(tmpbuf, MAX_BUF-1, fp)) {
167  if (tmpbuf[0] == '#')
168  continue; /* ignore comments */
169 
170  if (online == 0) {
171  tmpbuf[strlen(tmpbuf)-1] = 0; /* kill newline */
172  free(settings.emergency_mapname);
173  settings.emergency_mapname = strdup_local(tmpbuf);
174  } else if (online == 1) {
175  settings.emergency_x = atoi(tmpbuf);
176  } else if (online == 2) {
177  settings.emergency_y = atoi(tmpbuf);
178  }
179  online++;
180  if (online > 2)
181  break;
182  }
183  fclose(fp);
184  if (online <= 2)
185  LOG(llevError, "Online read partial data from %s\n", filename);
186  LOG(llevDebug, "emergency map set to %s (%d, %d)\n",
187  settings.emergency_mapname,
188  settings.emergency_x, settings.emergency_y);
189  }
190 }
191 
192 
201 void init_library(void) {
202  init_environ();
203  init_globals();
204  init_stats(FALSE); /* Needs to be fairly early, since the loader will check
205  * against the settings.max_stat value
206  */
207  init_hash_table();
208  i18n_init();
209  init_objects();
210  init_block();
211  read_bmap_names();
212  read_smooth();
213  init_anim(); /* Must be after we read in the bitmaps */
214  init_archetypes(); /* Reads all archetypes from file */
215  init_attackmess();
216  init_clocks();
218  init_experience();
219 
220  /* init_dynamic() loads a map, so needs a region */
221  if (init_regions() != 0) {
222  LOG(llevError, "Please check that your maps are correctly installed.\n");
223  exit(EXIT_FAILURE);
224  }
225 
226  init_dynamic();
227 }
228 
234 static void init_environ(void) {
235  char *cp;
236 
237  cp = getenv("CROSSFIRE_LIBDIR");
238  if (cp)
239  settings.datadir = cp;
240  cp = getenv("CROSSFIRE_LOCALDIR");
241  if (cp)
242  settings.localdir = cp;
243  cp = getenv("CROSSFIRE_PLAYERDIR");
244  if (cp)
245  settings.playerdir = cp;
246  cp = getenv("CROSSFIRE_MAPDIR");
247  if (cp)
248  settings.mapdir = cp;
249  cp = getenv("CROSSFIRE_ARCHETYPES");
250  if (cp)
251  settings.archetypes = cp;
252  cp = getenv("CROSSFIRE_TREASURES");
253  if (cp)
254  settings.treasures = cp;
255  cp = getenv("CROSSFIRE_UNIQUEDIR");
256  if (cp)
257  settings.uniquedir = cp;
258  cp = getenv("CROSSFIRE_TEMPLATEDIR");
259  if (cp)
260  settings.templatedir = cp;
261  cp = getenv("CROSSFIRE_TMPDIR");
262  if (cp)
263  settings.tmpdir = cp;
264 }
265 
272 void init_globals(void) {
273  memset(&statistics, 0, sizeof(struct Statistics));
274 
275  /* Log to stderr by default. */
276  logfile = stderr;
277 
278  /* Try to open the log file specified on the command-line. */
279  if (settings.logfilename != NULL) {
280  logfile = fopen(settings.logfilename, "a");
281 
282  /* If writable, set buffer mode to per-line. */
283  if (logfile != NULL) {
284  setvbuf(logfile, NULL, _IOLBF, 0);
285  } else {
286  logfile = stderr;
287 
288  LOG(llevError, "Could not open '%s' for logging.\n",
289  settings.logfilename);
290  }
291  }
292 
293  exiting = 0;
294  first_player = NULL;
295  first_friendly_object = NULL;
296  first_map = NULL;
297  first_treasurelist = NULL;
298  first_artifactlist = NULL;
299  first_archetype = NULL;
300  *first_map_ext_path = 0;
301  warn_archetypes = 0;
302  nroftreasures = 0;
303  nrofartifacts = 0;
304  nrofallowedstr = 0;
305  ring_arch = NULL;
306  amulet_arch = NULL;
307  staff_arch = NULL;
308  undead_name = add_string("undead");
310  num_animations = 0;
311  animations = NULL;
313  init_defaults();
314 }
315 
326 void free_globals(void) {
327  int msg, attack;
328  objectlink *friend;
329  region *reg;
330 
332  for (msg = 0; msg < NROFATTACKMESS; msg++)
333  for (attack = 0; attack < MAXATTACKMESS; attack++) {
334  free(attack_mess[msg][attack].buf1);
335  free(attack_mess[msg][attack].buf2);
336  free(attack_mess[msg][attack].buf3);
337  }
338 
339  free(settings.emergency_mapname);
340 
341  while (first_friendly_object) {
342  friend = first_friendly_object->next;
344  first_friendly_object = friend;
345  }
346 
347  free_experience();
348 
349  while (first_region) {
350  reg = first_region->next;
357  first_region = reg;
358  }
359 }
360 
366 void init_objects(void) {
367 #ifndef MEMORY_DEBUG
368  int i;
369 #endif
370  /* Initialize all objects: */
371  objects = NULL;
372  active_objects = NULL;
373 
374 #ifdef MEMORY_DEBUG
375  free_objects = NULL;
376 #else
378  objarray[0].prev = NULL,
379  objarray[0].next = &objarray[1],
382  for (i = 1; i < STARTMAX-1; i++) {
383  objarray[i].next = &objarray[i+1];
384  objarray[i].prev = &objarray[i-1];
387  }
388  objarray[STARTMAX-1].next = NULL;
389  objarray[STARTMAX-1].prev = &objarray[STARTMAX-2];
390  SET_FLAG(&objarray[STARTMAX-1], FLAG_REMOVED);
391  SET_FLAG(&objarray[STARTMAX-1], FLAG_FREED);
392 #endif
393 }
394 
399 static void init_defaults(void) {
400  nroferrors = 0;
401 }
402 
411 static void init_dynamic(void) {
413  while (at) {
414  if (at->clone.type == MAP && at->clone.subtype == MAP_TYPE_LEGACY) {
415  if (at->clone.race) {
417  sizeof(first_map_ext_path));
418  }
419  if (EXIT_PATH(&at->clone)) {
420  mapstruct *first;
421 
422  snprintf(first_map_path, sizeof(first_map_path), "%s", EXIT_PATH(&at->clone));
423  first = ready_map_name(first_map_path, 0);
424  if (!first) {
425  LOG(llevError, "Initial map %s can't be found! Please ensure maps are correctly installed.\n", first_map_path);
426  LOG(llevError, "Unable to continue without initial map.\n");
427  abort();
428  }
429  delete_map(first);
430  return;
431  }
432  }
433  at = at->next;
434  }
435  LOG(llevError, "You need a archetype called 'map' and it have to contain start map\n");
436  exit(-1);
437 }
438 
440 unsigned long todtick;
441 
446 void write_todclock(void) {
447  char filename[MAX_BUF];
448  FILE *fp;
449  OutputFile of;
450 
451  snprintf(filename, sizeof(filename), "%s/clockdata", settings.localdir);
452  fp = of_open(&of, filename);
453  if (fp == NULL)
454  return;
455  fprintf(fp, "%lu", todtick);
456  of_close(&of);
457 }
458 
463 static void init_clocks(void) {
464  char filename[MAX_BUF];
465  FILE *fp;
466  static int has_been_done = 0;
467 
468  if (has_been_done)
469  return;
470  else
471  has_been_done = 1;
472 
473  snprintf(filename, sizeof(filename), "%s/clockdata", settings.localdir);
474  fp = fopen(filename, "r");
475  if (fp == NULL) {
476  LOG(llevError, "Can't open %s.\n", filename);
477  todtick = 0;
478  write_todclock();
479  return;
480  }
481  /* Read TOD and default to 0 on failure. */
482  if (fscanf(fp, "%lu", &todtick) == 1) {
483  LOG(llevDebug, "clockdata: todtick is %lu\n", todtick);
484  fclose(fp);
485  } else {
486  LOG(llevError, "Couldn't parse todtick, using default value 0\n");
487  todtick = 0;
488  fclose(fp);
489  write_todclock();
490  }
491 }
492 
499 static void init_attackmess(void) {
500  char buf[MAX_BUF];
501  char filename[MAX_BUF];
502  char *cp, *p;
503  FILE *fp;
504  static int has_been_done = 0;
505  int mess = -1, level;
506  int mode = 0, total = 0;
507 
508  if (has_been_done)
509  return;
510  else
511  has_been_done = 1;
512 
513  snprintf(filename, sizeof(filename), "%s/attackmess", settings.datadir);
514  fp = fopen(filename, "r");
515  if (fp == NULL) {
516  LOG(llevError, "Can't open %s.\n", filename);
517  return;
518  }
519 
520  level = 0;
521  while (fgets(buf, MAX_BUF, fp) != NULL) {
522  if (*buf == '#')
523  continue;
524  cp = strchr(buf, '\n');
525  if (cp != NULL)
526  *cp = '\0';
527  cp = buf;
528  while (*cp == ' ') /* Skip blanks */
529  cp++;
530 
531  if (strncmp(cp, "TYPE:", 5) == 0) {
532  p = strtok(buf, ":");
533  p = strtok(NULL, ":");
534  if (mode == 1) {
535  attack_mess[mess][level].level = -1;
536  attack_mess[mess][level].buf1 = NULL;
537  attack_mess[mess][level].buf2 = NULL;
538  attack_mess[mess][level].buf3 = NULL;
539  }
540  level = 0;
541  mess = atoi(p);
542  mode = 1;
543  continue;
544  }
545  if (mode == 1) {
546  p = strtok(buf, "=");
547  attack_mess[mess][level].level = atoi(buf);
548  p = strtok(NULL, "=");
549  if (p != NULL)
550  attack_mess[mess][level].buf1 = strdup_local(p);
551  else
552  attack_mess[mess][level].buf1 = strdup_local("");
553  mode = 2;
554  continue;
555  } else if (mode == 2) {
556  p = strtok(buf, "=");
557  attack_mess[mess][level].level = atoi(buf);
558  p = strtok(NULL, "=");
559  if (p != NULL)
560  attack_mess[mess][level].buf2 = strdup_local(p);
561  else
562  attack_mess[mess][level].buf2 = strdup_local("");
563  mode = 3;
564  continue;
565  } else if (mode == 3) {
566  p = strtok(buf, "=");
567  attack_mess[mess][level].level = atoi(buf);
568  p = strtok(NULL, "=");
569  if (p != NULL)
570  attack_mess[mess][level].buf3 = strdup_local(p);
571  else
572  attack_mess[mess][level].buf3 = strdup_local("");
573  mode = 1;
574  level++;
575  total++;
576  continue;
577  }
578  }
579  LOG(llevDebug, "attackmsg: %d messages in %d categories\n", total, mess+1);
580  fclose(fp);
581 }
EXTERN FILE * logfile
Used by server/daemon.c.
Definition: global.h:144
Error, serious thing.
Definition: logger.h:11
#define RESURRECTION
Definition: config.h:160
#define STAT_LOSS_ON_DEATH
Definition: config.h:163
#define SPELL_FAILURE_EFFECTS
Definition: config.h:157
#define BALANCED_STAT_LOSS
Definition: config.h:149
#define SPELLPOINT_LEVEL_DEPEND
Definition: config.h:155
int init_regions(void)
Initialises regions from the regions file.
Definition: region.c:292
void init_anim(void)
Loads the lib/animations file.
Definition: anim.c:44
Information.
Definition: logger.h:12
Definition: object.h:125
struct Statistics statistics
Merged spell statistics.
Definition: init.c:113
Used to link together several objects.
Definition: object.h:442
const char * race
Human, goblin, dragon, etc.
Definition: object.h:318
void init_block(void)
initialises the array used by the LOS routines.
Definition: los.c:88
#define TEMPLATE_DIR
Definition: config.h:565
#define DEATH_PENALTY_RATIO
Definition: config.h:151
#define SET_FLAG(xyz, p)
Definition: define.h:223
int level
Definition: attack.h:119
#define SEARCH_ITEMS
Definition: config.h:161
EXTERN int num_animations
Definition: global.h:166
#define strdup_local
Definition: compat.h:25
EXTERN objectlink * first_friendly_object
Objects monsters will go after.
Definition: global.h:123
#define PERMANENT_EXPERIENCE_RATIO
Definition: config.h:150
#define ARMOR_SPEED_IMPROVEMENT
Definition: config.h:170
char * buf1
Definition: attack.h:120
#define PK_LUCK_PENALTY
Definition: config.h:164
#define EMERGENCY_MAPPATH
These define the players starting map and location on that map, and where emergency saves are defined...
Definition: config.h:555
mapstruct * ready_map_name(const char *name, int flags)
Makes sure the given map is loaded and swapped in.
Definition: map.c:1803
const char * playerdir
Where the player files are.
Definition: global.h:246
object clone
An object from which to do object_copy()
Definition: object.h:470
struct obj * prev
Pointer to the previous object in the free/used list.
Definition: object.h:278
void init_archetypes(void)
Initialises the internal linked list of archetypes (read from file).
Definition: arch.c:182
#define TMPDIR
Your tmp-directory should be large enough to hold the uncompressed map-files for all who are playing...
Definition: config.h:537
void init_globals(void)
Initialises all global variables.
Definition: init.c:272
#define ARMOR_SPEED_LINEAR
Definition: config.h:171
uint8_t subtype
Subtype of object.
Definition: object.h:339
#define NOT_PERMADETH
Definition: config.h:162
#define ARMOR_MAX_ENCHANT
Definition: config.h:167
void init_library(void)
It is vital that init_library() is called by any functions using this library.
Definition: init.c:201
static void init_attackmess(void)
Initializes the attack messages.
Definition: init.c:499
void init_experience(void)
This loads the experience table from the exp_table file.
Definition: exp.c:167
#define FALSE
Definition: compat.h:11
#define MAP_TYPE_LEGACY
These are map subtypes.
Definition: map.h:57
#define SPELL_ENCUMBRANCE
Definition: config.h:156
EXTERN char first_map_ext_path[MAX_BUF]
Path used for per-race start maps.
Definition: global.h:154
Global type definitions and header inclusions.
#define DEATH_PENALTY_LEVEL
Definition: config.h:152
#define safe_strncpy
Definition: compat.h:23
const char * treasures
Location of the treasures file.
Definition: global.h:250
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:465
const char * logfilename
Logfile to use.
Definition: global.h:238
const char *const spellpathnames[NRSPELLPATHS]
Perhaps not the best place for this, but needs to be in some file in the common area so that standalo...
Definition: init.c:120
uint16_t emergency_y
Coordinates to use on that map.
Definition: global.h:298
#define FLAG_REMOVED
Object is not in any map or invenory.
Definition: define.h:232
object * active_objects
List of active objects that need to be processed.
Definition: object.c:62
EXTERN archetype * amulet_arch
Definition: global.h:162
char * name
Shortend name of the region as maps refer to it.
Definition: map.h:278
void init_hash_table(void)
Initialises the hash-table used by the shared string library.
Definition: shstr.c:55
void i18n_init(void)
Initializes the i18n subsystem.
Definition: languages.c:168
#define ARMOR_WEIGHT_LINEAR
Definition: config.h:169
int read_smooth(void)
Reads the smooth file to know how to smooth datas.
Definition: image.c:323
void write_todclock(void)
Write out the current time to the file so time does not reset every time the server reboots...
Definition: init.c:446
#define STARTMAX
How big array of objects to start with.
Definition: config.h:573
static void init_emergency_mappath(void)
This loads the emergency map information from a .emergency file in the map directory.
Definition: init.c:155
static void init_defaults(void)
Initialises global variables which can be changed by options.
Definition: init.c:399
static void init_environ(void)
Initializes values from the environmental variables.
Definition: init.c:234
EXTERN const char * undead_name
Definition: global.h:163
This is used for various performance tracking statistics, or just how often certain events are done...
Definition: global.h:345
const char * tmpdir
Directory to use for temporary files.
Definition: global.h:253
#define EMERGENCY_Y
Definition: config.h:558
struct regiondef * next
Pointer to next region, NULL for the last one.
Definition: map.h:277
This is a game region.
Definition: map.h:276
#define EMERGENCY_X
Definition: config.h:557
#define snprintf
Definition: win32.h:46
#define MAXATTACKMESS
Definition: attack.h:19
#define RESET_LOCATION_TIME
By selecting the following, whenever a player does a backup save (with the &#39;save&#39; command)...
Definition: config.h:682
int of_close(OutputFile *of)
Closes an output file.
Definition: output_file.c:61
object * objects
Pointer to the list of used objects.
Definition: object.c:60
#define SIMPLE_EXP
Definition: config.h:154
char * parent_name
So that parent and child regions can be defined in any order, we keep hold of the parent_name during ...
Definition: map.h:279
#define EXIT_PATH(xyz)
Definition: define.h:455
EXTERN long nroferrors
If it exceeds MAX_ERRORS, call fatal()
Definition: global.h:136
uint16_t emergency_x
Definition: global.h:298
EXTERN Animations * animations
Definition: global.h:165
#define REGIONS
Definition: config.h:567
static void init_dynamic(void)
Initializes first_map_path from the archetype collection.
Definition: init.c:411
#define NROFATTACKMESS
Definition: attack.h:18
#define LOCALDIR
Definition: win32.h:103
#define PLAYERDIR
If you want the players to be able to save their characters between games, define SAVE_PLAYER and set...
Definition: config.h:602
const char * templatedir
Directory for the template map.
Definition: global.h:252
void free_experience(void)
Frees experience-related memory.
Definition: exp.c:261
#define FREE_AND_CLEAR_STR(xyz)
Release the shared string, and set it to NULL.
Definition: global.h:208
const char * archetypes
Name of the archetypes file - libdir is prepended.
Definition: global.h:248
void free_globals(void)
Cleans all memory allocated for global variables.
Definition: init.c:326
EXTERN treasurelist * first_treasurelist
First treasure.
Definition: global.h:120
Server settings.
Definition: global.h:237
EXTERN artifactlist * first_artifactlist
First artifact.
Definition: global.h:121
#define MAX_BUF
Used for all kinds of things.
Definition: define.h:35
#define NRSPELLPATHS
Number of spell paths.
Definition: spells.h:40
#define ARCHETYPES
Definition: config.h:566
object * free_objects
Pointer to the list of unused objects.
Definition: object.c:61
#define RECYCLE_TMP_MAPS
Definition: config.h:159
void read_bmap_names(void)
This reads the bmaps file to get all the bitmap names and stuff.
Definition: image.c:180
struct obj * next
Pointer to the next object in the free/used list.
Definition: object.h:277
const char * uniquedir
Directory for the unique items.
Definition: global.h:251
#define CSPORT
CSPORT is the port used for the new client/server code.
Definition: config.h:363
EXTERN long nrofartifacts
Only used in malloc_info().
Definition: global.h:148
const char * datadir
Read only data files.
Definition: global.h:244
#define TREASURES
Definition: config.h:569
EXTERN long nrofallowedstr
Only used in malloc_info().
Definition: global.h:149
void init_objects(void)
Sets up and initialises the linked list of free and used objects.
Definition: init.c:366
Object structure, the core of Crossfire.
EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]
Attack messages the player gets when hitting/getting hit.
Definition: attack.h:131
const char * localdir
Read/write data files.
Definition: global.h:245
#define DATADIR
Definition: win32.h:98
char * jailmap
Where a player that is arrested in this region should be imprisoned.
Definition: map.h:297
struct oblnk * next
Next item to link to.
Definition: object.h:444
void init_stats(int reload)
This loads statistic bonus/penalties from the stat_bonus file.
Definition: living.c:2487
Only for debugging purposes.
Definition: logger.h:13
EXTERN archetype * staff_arch
Definition: global.h:162
const char * mapdir
Where the map files are.
Definition: global.h:247
EXTERN int exiting
True if the game is about to exit.
Definition: global.h:146
uint8_t type
PLAYER, BULLET, etc.
Definition: object.h:338
struct Settings settings
Server settings.
Definition: init.c:40
EXTERN long trying_emergency_save
True when emergency_save() is reached.
Definition: global.h:135
FILE * of_open(OutputFile *of, const char *fname)
Opens an output file.
Definition: output_file.c:30
struct archt * next
Next archetype in a linked list.
Definition: object.h:467
EXTERN int animations_allocated
Definition: global.h:166
Functions for creating text output files.
object objarray[STARTMAX]
All objects, allocated this way at first.
Definition: object.c:55
void delete_map(mapstruct *m)
Frees the map, including the mapstruct.
Definition: map.c:1741
EXTERN char first_map_path[MAX_BUF]
The start-level.
Definition: global.h:153
#define MAPDIR
These defines tells where, relative to LIBDIR, the maps, the map-index, archetypes highscore and trea...
Definition: config.h:564
#define UNIQUE_DIR
Directory to use for unique items.
Definition: config.h:545
sstring add_string(const char *str)
This will add &#39;str&#39; to the hash table.
Definition: shstr.c:124
EXTERN player * first_player
First player.
Definition: global.h:117
#define ARMOR_WEIGHT_REDUCTION
Definition: config.h:168
#define MOTD
Max objects low water mark (lwm).
Definition: config.h:493
#define CASTING_TIME
Definition: config.h:165
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
Definition: logger.c:51
EXTERN long warn_archetypes
If true, write warnings when failing to find archetypes when loading from file.
Definition: global.h:132
char * msg
The description of the region.
Definition: map.h:293
EXTERN archetype * ring_arch
Definition: global.h:162
EXTERN region * first_region
First region.
Definition: global.h:119
static void init_clocks(void)
Initializes the gametime and TOD counters Called by init_library().
Definition: init.c:463
char * buf3
Definition: attack.h:122
unsigned long todtick
Ingame time.
Definition: init.c:440
char * emergency_mapname
Map to return players to in emergency.
Definition: global.h:297
This is a game-map.
Definition: map.h:325
char * buf2
Definition: attack.h:121
#define REAL_WIZ
Definition: config.h:158
#define FREE_AND_CLEAR(xyz)
Free the pointer and then set it to NULL.
Definition: global.h:203
#define SET_TITLE
Definition: config.h:153
#define SET_FRIENDLY_FIRE
Definition: config.h:166
EXTERN mapstruct * first_map
First map.
Definition: global.h:118
EXTERN archetype * first_archetype
First archetype.
Definition: global.h:122
char * longname
Official title of the region, this might be defined to be the same as name.
Definition: map.h:291
#define CONFDIR
Definition: win32.h:100
#define FLAG_FREED
Object is in the list of free objects.
Definition: define.h:233
EXTERN long nroftreasures
Only used in malloc_info().
Definition: global.h:147