--- deliantra/server/include/global.h 2007/03/06 19:02:35 1.46 +++ deliantra/server/include/global.h 2007/05/17 14:14:55 1.59 @@ -1,5 +1,5 @@ /* - * CrossFire, A Multiplayer game for X-windows + * CrossFire, A Multiplayer game * * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team * Copyright (C) 2002 Mark Wedel & Crossfire Development Team @@ -25,6 +25,8 @@ #ifndef GLOBAL_H #define GLOBAL_H +//#define _GLIBCXX_CONCEPT_CHECKS + #ifndef EXTERN #define EXTERN extern #endif @@ -49,6 +51,12 @@ #define ACC(meta,member) member #define MTH +#if __GNUC__ >= 3 +# define attribute(attrlist) __attribute__(attrlist) +#else +# define attribute(attrlist) +#endif + #include "keyword.h" #include "traits.h" #include "dynbuf.h" @@ -64,6 +72,7 @@ #include "material.h" #include "living.h" #include "object.h" +#include "region.h" #include "map.h" #include "tod.h" @@ -111,12 +120,9 @@ * GLOBAL VARIABLES: * *****************************************************************************/ -extern facetile *new_faces; - /* * These are the beginnings of linked lists: */ -EXTERN treasurelist *first_treasurelist; EXTERN artifactlist *first_artifactlist; EXTERN archetype *first_archetype; EXTERN objectlink *first_friendly_object; /* Objects monsters will go after */ @@ -127,21 +133,15 @@ * Variables set by different flags (see init.c): */ -EXTERN bool warn_archetypes; /* If true, write warnings when failing */ - /* to find archetypes when loading from file */ EXTERN bool init_done; /* Ignores signals until init_done is true */ EXTERN bool in_cleanup; /* True when cleanup() is reached */ -extern long pticks; /* used by various function to determine */ +extern tick_t pticks; /* used by various function to determine */ /* how often to save the character */ /* * Misc global variables: */ EXTERN FILE *logfile; /* Used by server/daemon.c */ -EXTERN int exiting; /* True if the game is about to exit */ -EXTERN long nroftreasures; /* Only used in malloc_info() */ -EXTERN long nrofartifacts; /* Only used in malloc_info() */ -EXTERN long nrofallowedstr; /* Only used in malloc_info() */ EXTERN archetype *empty_archetype; /* Nice to have fast access to it */ EXTERN archetype *map_archeytpe; @@ -155,11 +155,7 @@ */ EXTERN archetype *ring_arch, *amulet_arch, *staff_arch, *crown_arch; -EXTERN std::vector animations; -EXTERN int num_animations, animations_allocated; -EXTERN uint32_t bmaps_checksum; - -#define SET_ANIMATION(ob,newanim) ob->face = new_faces + animations [ob->animation_id].faces [newanim] +#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 @@ -175,11 +171,6 @@ extern int rightof_x[9], rightof_y[9]; extern int leftof_x[9], leftof_y[9]; -extern facetile *blank_face, *empty_face; -extern facetile *dark_faces[]; - -extern client *init_sockets; - extern void emergency_save (); extern void cleanup (const char *cause, bool make_core = false); @@ -190,25 +181,25 @@ INTERFACE_CLASS (Settings) struct Settings { - char *ACC (RO, logfilename); /* logfile to use */ + 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 */ - char *dumparg; /* additional argument for some dump functions */ + 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 */ - char *ACC (RO, confdir); /* configuration files */ - char *ACC (RO, datadir); /* read only data files */ - char *ACC (RO, localdir); /* read/write data files */ - char *ACC (RO, playerdir); /* Where the player files are */ - char *ACC (RO, mapdir); /* Where the map files are */ - char *ACC (RO, archetypes); /* name of the archetypes file - libdir is prepended */ - char *ACC (RO, regions); /* name of the regions file - libdir is prepended */ - char *ACC (RO, treasures); /* location of the treasures file. */ - char *ACC (RO, uniquedir); /* directory for the unique items */ - char *ACC (RO, templatedir); /* directory for the template map */ - char *ACC (RO, tmpdir); /* Directory to use for temporary files */ + 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 */ uint8 ACC (RW, permanent_exp_ratio); /* how much exp should be 'permenant' and unable to be lost*/ @@ -223,14 +214,14 @@ 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 ACC (RW, casting_time); /* it takes awhile to cast a spell */ - uint8 ACC (RW, real_wiz); /* use mud-like wizards */ + 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 */ - char *ACC (RO, rules); /* name of rules file*/ - char *ACC (RO, news); /* name of news file*/ - char ACC (RW, dm_mail)[MAX_BUF]; /* DM's Email address */ + 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 */ @@ -249,12 +240,12 @@ int ACC (RW, armor_speed_improvement); /* Speed improvement */ uint8 ACC (RW, armor_weight_linear); /* If 1, weight reduction is linear, else exponantiel */ uint8 ACC (RW, armor_speed_linear); /* If 1, speed improvement is linear, else exponantiel */ - uint8 ACC (RW, no_player_stealing); /* If 1, can not steal from other players */ - uint8 ACC (RW, create_home_portals); /* If 1, can create portals in personal maps */ }; extern Settings settings; +void reset_signals (); + #include "plugin.h" #include "cfperl.h"