--- deliantra/server/include/global.h 2007/08/27 06:29:17 1.65
+++ deliantra/server/include/global.h 2018/11/18 15:19:48 1.102
@@ -1,24 +1,26 @@
/*
- * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
- *
- * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
- * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
- * Copyright (©) 1992,2007 Frank Tore Johansen
- *
- * Crossfire TRT is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
+ * This file is part of Deliantra, the Roguelike Realtime MMORPG.
+ *
+ * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team
+ * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
+ * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
+ * Copyright (©) 1992 Frank Tore Johansen
+ *
+ * Deliantra is free software: you can redistribute it and/or modify it under
+ * the terms of the Affero GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or (at your
+ * option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- * The authors can be reached via e-mail to
+ *
+ * You should have received a copy of the Affero GNU General Public License
+ * and the GNU General Public License along with this program. If not, see
+ * .
+ *
+ * The authors can be reached via e-mail to
*/
#ifndef GLOBAL_H
@@ -30,11 +32,18 @@
#define EXTERN extern
#endif
-#include "includes.h"
+// used only for tagging structure members so scripting languages
+// can easily parse the include files.
+#define INTERFACE_CLASS(name)
+#define ACC(meta,member) member
+#define MTH
+#define GENCONST_IV(patterns)
+#include "includes.h"
#include "config.h"
+#include "compiler.h"
#include "define.h"
-#include "logger.h"
+#include "traits.h"
#ifndef TRUE
#define TRUE 1
@@ -44,27 +53,19 @@
#define FALSE 0
#endif
-extern short freearr_x[SIZEOFFREE], freearr_y[SIZEOFFREE];
-extern int maxfree[SIZEOFFREE], freedir[SIZEOFFREE];
+extern int freearr_x[SIZEOFFREE];
+extern int freearr_y[SIZEOFFREE];
+extern int freedir[SIZEOFFREE];
extern int rightof_x[9], rightof_y[9];
extern int leftof_x[9], leftof_y[9];
-// used only for tagging structure members so scripting languages
-// can easily parse the include files.
-#define INTERFACE_CLASS(name)
-#define ACC(meta,member) member
-#define MTH
-
-#if __GNUC__ >= 3
-# define attribute(attrlist) __attribute__(attrlist)
-#else
-# define attribute(attrlist)
-#endif
+extern sint64 levels [MAXNUMLEVELS];
#include "keyword.h"
-#include "traits.h"
+#include "logger.h"
#include "dynbuf.h"
#include "util.h"
+#include "rng.h"
#include "shstr.h"
#include "cfperl.h"
@@ -75,7 +76,7 @@
#include "spells.h"
#include "attack.h" /* needs to be before material.h */
-#include "material.h"
+#include "material.h" /* needs to be before freezethaw.h */
#include "living.h"
#include "object.h"
#include "region.h"
@@ -94,10 +95,11 @@
/* pull in treasure structure */
#include "treasure.h"
-#include "commands.h"
-
/* pull in book structures */
#include "book.h"
+
+#include "quadland.h"
+
/*
* So far only used when dealing with artifacts.
* (now used by alchemy and other code too. Nov 95 b.t).
@@ -120,8 +122,6 @@
/* Now for recipe/alchemy */
#include "recipe.h"
-#include "funcpoint.h"
-
/*****************************************************************************
* GLOBAL VARIABLES: *
*****************************************************************************/
@@ -141,64 +141,35 @@
EXTERN bool init_done; /* Ignores signals until init_done is true */
EXTERN bool in_cleanup; /* True when cleanup() is reached */
-extern tick_t pticks; /* used by various function to determine */
+extern tick_t server_tick; /* used by various function to determine */
/* how often to save the character */
/*
* Misc global variables:
*/
-EXTERN FILE *logfile; /* Used by server/daemon.c */
-
-EXTERN archetype *empty_archetype; /* Nice to have fast access to it */
-EXTERN archetype *map_archeytpe;
EXTERN shstr first_map_path; /* The start-level */
EXTERN shstr first_map_ext_path; /* Path used for per-race start maps */
-EXTERN char errmsg[HUGE_BUF];
EXTERN long ob_count;
-/*
- * Used in treasure.c
- */
-EXTERN archetype *ring_arch, *amulet_arch, *staff_arch, *crown_arch;
-#define SET_ANIMATION(ob,newanim) ob->face = animations [ob->animation_id].faces [newanim]
-#define GET_ANIMATION(ob,anim) animations [ob->animation_id].faces [anim]
-#define GET_ANIM_ID(ob) (ob->animation_id)
-/* NUM_ANIMATIONS returns the number of animations allocated. The last
- * usuable animation will be NUM_ANIMATIONS-1 (for example, if an object
- * has 8 animations, NUM_ANIMATIONS will return 8, but the values will
- * range from 0 through 7.
- */
-#define NUM_ANIMATIONS(ob) (animations[ob->animation_id].num_animations)
-#define NUM_FACINGS(ob) (animations[ob->animation_id].facings)
+extern dynbuf_text msg_dynbuf; // a dynbuf for text messages and other temporary data
extern void emergency_save ();
-extern void cleanup (const char *cause, bool make_core = false);
#include "libproto.h"
#include "sockproto.h"
-#define decrease_ob(xyz) decrease_ob_nr(xyz,1)
-
INTERFACE_CLASS (Settings)
struct Settings {
const char *ACC (RO, logfilename); /* logfile to use */
- int ACC (RW, csport); /* port for new client/server */
- int ACC (RW, debug); /* Default debugging level */
- uint8 dumpvalues; /* Set to dump various values/tables */
- const char *dumparg; /* additional argument for some dump functions */
- uint8 daemonmode; /* If true, detach and become daemon */
- int argc; /* parameters that were passed to the program */
- char **argv; /* Only used by xio.c, so will go away at some time */
+ int ACC (RW, debug); /* Default debugging level */
+ int argc;
+ char **argv;
const char *ACC (RO, confdir); /* configuration files */
const char *ACC (RO, datadir); /* read only data files */
const char *ACC (RO, localdir); /* read/write data files */
const char *ACC (RO, playerdir); /* Where the player files are */
const char *ACC (RO, mapdir); /* Where the map files are */
- const char *ACC (RO, archetypes); /* name of the archetypes file - libdir is prepended */
- const char *ACC (RO, regions); /* name of the regions file - libdir is prepended */
- const char *ACC (RO, treasures); /* location of the treasures file. */
const char *ACC (RO, uniquedir); /* directory for the unique items */
- const char *ACC (RO, templatedir); /* directory for the template map */
const char *ACC (RO, tmpdir); /* Directory to use for temporary files */
sint16 ACC (RW, pk_luck_penalty); /* Amount by which player luck is reduced if they PK */
uint8 ACC (RW, stat_loss_on_death); /* If true, chars lose a random stat when they die */
@@ -214,23 +185,7 @@
uint8 ACC (RW, spell_encumbrance); /* encumbrance effects spells */
uint8 ACC (RW, spell_failure_effects); /* nasty backlash to spell failures */
uint16 ACC (RW, set_friendly_fire); /* Percent of damage done by peaceful player vs player damage */
- uint8 dummy_001;
- uint8 dummy_002;
- uint8 dummy_000;
uint8 ACC (RW, spellpoint_level_depend); /* spell costs go up with level */
- char ACC (RW, motd)[MAX_BUF]; /* name of the motd file */
- const char *ACC (RO, rules); /* name of rules file*/
- const char *ACC (RO, news); /* name of news file*/
- char ACC (RW, dm_mail)[MAX_BUF]; /* DM's Email address */
-
- uint32 ACC (RW, worldmapstartx); /* starting x tile for the worldmap */
- uint32 ACC (RW, worldmapstarty); /* starting y tile for the worldmap */
- uint32 ACC (RW, worldmaptilesx); /* number of tiles wide the worldmap is */
- uint32 ACC (RW, worldmaptilesy); /* number of tiles high the worldmap is */
- uint32 ACC (RW, worldmaptilesizex); /* number of squares wide in a wm tile */
- uint32 ACC (RW, worldmaptilesizey); /* number of squares high in a wm tile */
- uint16 ACC (RW, dynamiclevel); /* how dynamic is the world? */
- uint8 ACC (RW, fastclock); /* if true, clock goes warp 9 */
int ACC (RW, max_level); /* This is read out of exp_table */
float ACC (RW, item_power_factor); /* See note in setings file */
@@ -246,7 +201,9 @@
void reset_signals ();
-#include "plugin.h"
+#ifdef DEVEL
+# include "devel.h"
+#endif
#endif /* GLOBAL_H */