--- deliantra/server/include/global.h 2006/12/15 20:07:02 1.27 +++ deliantra/server/include/global.h 2006/12/31 21:02:04 1.34 @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - The author can be reached via e-mail to crossfire.de + The author can be reached via e-mail to crossfire@schmorp.de */ #ifndef GLOBAL_H @@ -30,15 +30,6 @@ #include "includes.h" -typedef int8_t sint8; -typedef uint8_t uint8; -typedef int16_t sint16; -typedef uint16_t uint16; -typedef int32_t sint32; -typedef uint32_t uint32; -typedef int64_t sint64; -typedef uint64_t uint64; - #include "config.h" #include "define.h" #include "logger.h" @@ -53,8 +44,9 @@ // used only for tagging structure members so scripting languages // can easily parse the include files. -#define ACC_CLASS(name) +#define INTERFACE_CLASS(name) #define ACC(meta,member) member +#define MTH #include "keyword.h" #include "traits.h" @@ -64,7 +56,9 @@ /* This blob, in this order, is needed to actually define maps */ #include "face.h" -/* Include the basic defines from spells.h */ + +#include "spells.h" + #include "attack.h" /* needs to be before material.h */ #include "material.h" #include "living.h" @@ -110,9 +104,6 @@ /* Now for recipe/alchemy */ #include "recipe.h" -/* Now for spells */ -#include "spells.h" - #include "funcpoint.h" /***************************************************************************** @@ -125,7 +116,6 @@ * These are the beginnings of linked lists: */ EXTERN player *first_player; -EXTERN maptile *first_map; EXTERN region *first_region; EXTERN treasurelist *first_treasurelist; EXTERN artifactlist *first_artifactlist; @@ -144,11 +134,10 @@ * Variables set by different flags (see init.c): */ -EXTERN long warn_archetypes; /* If true, write warnings when failing */ +EXTERN bool warn_archetypes; /* If true, write warnings when failing */ /* to find archetypes when loading from file */ -EXTERN long init_done; /* Ignores signals until init_done is true */ -EXTERN long trying_emergency_save; /* True when emergency_save() is reached */ -EXTERN long nroferrors; /* If it exceeds MAX_ERRORS, call fatal() */ +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 */ /* how often to save the character */ @@ -163,8 +152,8 @@ EXTERN archetype *empty_archetype; /* Nice to have fast access to it */ EXTERN archetype *map_archeytpe; -EXTERN char first_map_path[MAX_BUF]; /* The start-level */ -EXTERN char first_map_ext_path[MAX_BUF]; /* Path used for per-race start maps */ +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; @@ -179,9 +168,8 @@ /* Rotate right from bsd sum. This is used in various places for checksumming */ #define ROTATE_RIGHT(c) if ((c) & 01) (c) = ((c) >>1) + 0x80000000; else (c) >>= 1; - -#define SET_ANIMATION(ob,newanim) ob->face=&new_faces[animations[ob->animation_id].faces[newanim]] -#define GET_ANIMATION(ob,anim) (animations[ob->animation_id].faces[anim]) +#define SET_ANIMATION(ob,newanim) ob->face = new_faces + 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 @@ -202,12 +190,15 @@ extern client *init_sockets; +extern void emergency_save (); +extern void cleanup (bool make_core = false); + #include "libproto.h" #include "sockproto.h" #define decrease_ob(xyz) decrease_ob_nr(xyz,1) -ACC_CLASS (Settings) +INTERFACE_CLASS (Settings) struct Settings { char *ACC (RO, logfilename); /* logfile to use */ int ACC (RW, csport); /* port for new client/server */ @@ -245,7 +236,6 @@ 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 ACC (RW, recycle_tmp_maps); /* re-use tmp maps. */ uint8 ACC (RW, explore_mode); /* explore mode allowed? */ uint8 ACC (RW, spellpoint_level_depend); /* spell costs go up with level */ char ACC (RW, motd)[MAX_BUF]; /* name of the motd file */ @@ -262,9 +252,6 @@ uint16 ACC (RW, dynamiclevel); /* how dynamic is the world? */ uint8 ACC (RW, fastclock); /* if true, clock goes warp 9 */ - char *ACC (RW, emergency_mapname); /* map to return players to in emergency */ - uint16 ACC (RW, emergency_x), ACC (RW, emergency_y); /* coordinates to use on that map */ - int ACC (RW, max_level); /* This is read out of exp_table */ float ACC (RW, item_power_factor); /* See note in setings file */