--- deliantra/server/include/player.h 2006/04/18 16:54:19 1.2 +++ deliantra/server/include/player.h 2006/09/04 11:07:59 1.12 @@ -1,9 +1,4 @@ /* - * static char *rcsid_player_h = - * "$Id$"; - */ - -/* CrossFire, A Multiplayer game for X-windows Copyright (C) 2002 Mark Wedel & Crossfire Development Team @@ -28,7 +23,7 @@ #define NUM_OUTPUT_BUFS 5 typedef struct { - const char *buf; /* Actual string pointer */ + shstr buf; /* Actual string pointer */ uint32 first_update; /* First time this message was stored */ uint16 count; /* How many times we got this message */ } Output_Buf; @@ -37,7 +32,7 @@ /* wand/rod/horn rolled into range_misc. They all use the same body location * anyways. */ -typedef enum rangetype { +enum rangetype { range_bottom = -1, range_none = 0, range_bow = 1, @@ -47,9 +42,9 @@ range_skill = 5, range_builder = 6, range_size = 7 -} rangetype; +}; -typedef enum _bowtype { +enum bowtype_t { bow_normal = 0, bow_threewide = 1, bow_spreadshot = 2, @@ -61,8 +56,8 @@ bow_sw = 8, bow_w = 9, bow_nw = 10, /* must stay at 10 */ - bow_bestarrow = 11 -} bowtype_t; + bow_bestarrow = 11 +}; typedef enum _petmode { pet_normal = 0, @@ -84,9 +79,9 @@ unapply_nochoice=0, /* Will unapply objects when there no choice to unapply */ unapply_never=1, /* will not unapply objects automatically */ unapply_always=2 /* Will unapply whatever is necessary - this goes beyond */ - /* no choice - if there are multiple ojbect of the same type */ - /* that need to be unapplied, there is no way for the player */ - /* to control which of these will be unapplied. */ + /* no choice - if there are multiple ojbect of the same type */ + /* that need to be unapplied, there is no way for the player */ + /* to control which of these will be unapplied. */ } unapplymode; /* not really the player, but tied pretty closely */ @@ -98,25 +93,25 @@ #ifdef PARTY_KILL_LOG struct party_kill { - char killer[MAX_NAME+1],dead[MAX_NAME+1]; - sint64 exp; + char killer[MAX_NAME+1],dead[MAX_NAME+1]; + sint64 exp; } party_kills[PARTY_KILL_LOG]; #endif sint64 total_exp; uint32 kills; } partylist; -typedef struct pl { - struct pl *next; /* Pointer to next player, NULL if this is last */ +// memsettable part of player +struct player_pod +{ object *ob; /* The object representing the player */ - NewSocket socket; /* Socket information for this player */ - struct mapdef *loading; /* When entering a map in progress of loading, not really used */ + mapstruct *loading; /* When entering a map in progress of loading, not really used */ rangetype shoottype; /* Which range-attack is being used by player */ bowtype_t bowtype; /* which firemode? */ petmode_t petmode; /* which petmode? */ object *ranges[range_size];/* object for each range. Set up in fix player. Note */ - /* That not all are used, it is just nice to map this 1:1 */ - /* With the range names */ + /* That not all are used, it is just nice to map this 1:1 */ + /* With the range names */ uint32 golem_count; /* To track the golem */ usekeytype usekeys; /* Method for finding keys for doors */ unapplymode unapply; /* Method for auto unapply */ @@ -136,7 +131,7 @@ /* Try to put all the bitfields together - saves some small amount of memory */ uint32 braced:1; /* Will not move if braced, only attack */ uint32 tmp_invis:1; /* Will invis go away when we attack ? */ - const char *invis_race; /* What race invisible to? */ + shstr invis_race; /* What race invisible to? */ uint32 do_los:1; /* If true, need to call update_los() in draw(), and clear */ uint32 fire_on:1; /* Player should fire object, not move */ uint32 run_on:1; /* Player should keep moving in dir until run is off */ @@ -166,8 +161,8 @@ object *last_used; /* Pointer to object last picked or applied */ uint32 last_used_id; /* Safety measures to be sure it's the same */ sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ - /* the player can see. For maps smaller than */ - /* MAP_CLIENT_.., the upper left is used */ + /* the player can see. For maps smaller than */ + /* MAP_CLIENT_.., the upper left is used */ sint16 bed_x, bed_y; /* x,y - coordinates of respawn (savebed) */ char savebed_map[MAX_BUF]; /* map where player will respawn after death */ @@ -175,7 +170,7 @@ char spellparam[MAX_BUF]; /* What param to add to spells */ char own_title[MAX_NAME]; /* Title the player has chosen for themself */ - /* Note that for dragon players, this is filled in for them */ + /* Note that for dragon players, this is filled in for them */ char title[BIG_NAME]; /* Default title, like fighter, wizard, etc */ sint8 levhp[11]; /* What the player gained on that level */ @@ -197,9 +192,9 @@ #endif partylist *party; /* Party this player is part of */ partylist *party_to_join; /* used when player wants to join a party */ - /* but we will have to get password first */ - /* so we have to remember which party to */ - /* join */ + /* but we will have to get password first */ + /* so we have to remember which party to */ + /* join */ char search_str[MAX_BUF]; /* Item we are looking for */ sint16 encumbrance; /* How much our player is encumbered */ Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */ @@ -207,8 +202,14 @@ uint16 outputs_count; /* Print if this count is exceeded */ object *mark; /* marked object */ uint32 mark_count; /* count of mark object */ - object *transport; /* transport the player is in */ /* Special DM fields */ tag_t* stack_items; /* Item stack for patch/dump/... commands */ int stack_position; /* Current stack position, 0 for no item */ +}; + +typedef struct pl : zero_initialised, attachable, player_pod +{ + struct pl *next; /* Pointer to next player, NULL if this is last */ + NewSocket socket; /* Socket information for this player */ } player; +