ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/player.h
(Generate patch)

Comparing deliantra/server/include/player.h (file contents):
Revision 1.11 by root, Sun Sep 3 00:18:41 2006 UTC vs.
Revision 1.13 by root, Tue Sep 5 18:18:09 2006 UTC

20 20
21 The authors can be reached via e-mail at crossfire-devel@real-time.com 21 The authors can be reached via e-mail at crossfire-devel@real-time.com
22*/ 22*/
23 23
24#define NUM_OUTPUT_BUFS 5 24#define NUM_OUTPUT_BUFS 5
25typedef struct { 25struct Output_Buf {
26 shstr buf; /* Actual string pointer */ 26 shstr buf; /* Actual string pointer */
27 uint32 first_update; /* First time this message was stored */ 27 uint32 first_update; /* First time this message was stored */
28 uint16 count; /* How many times we got this message */ 28 uint16 count; /* How many times we got this message */
29} Output_Buf; 29};
30
31 30
32/* wand/rod/horn rolled into range_misc. They all use the same body location 31/* wand/rod/horn rolled into range_misc. They all use the same body location
33 * anyways. 32 * anyways.
34 */ 33 */
35enum rangetype { 34enum rangetype {
100 sint64 total_exp; 99 sint64 total_exp;
101 uint32 kills; 100 uint32 kills;
102} partylist; 101} partylist;
103 102
104// memsettable part of player 103// memsettable part of player
105struct player_memset : zero_initialised 104struct player_pod
106{ 105{
107 object *ob; /* The object representing the player */ 106 object *ob; /* The object representing the player */
108 mapstruct *loading; /* When entering a map in progress of loading, not really used */ 107 mapstruct *loading; /* When entering a map in progress of loading, not really used */
109 rangetype shoottype; /* Which range-attack is being used by player */ 108 rangetype shoottype; /* Which range-attack is being used by player */
110 bowtype_t bowtype; /* which firemode? */ 109 bowtype_t bowtype; /* which firemode? */
195 /* but we will have to get password first */ 194 /* but we will have to get password first */
196 /* so we have to remember which party to */ 195 /* so we have to remember which party to */
197 /* join */ 196 /* join */
198 char search_str[MAX_BUF]; /* Item we are looking for */ 197 char search_str[MAX_BUF]; /* Item we are looking for */
199 sint16 encumbrance; /* How much our player is encumbered */ 198 sint16 encumbrance; /* How much our player is encumbered */
200 Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */
201 uint16 outputs_sync; /* How often to print, no matter what */ 199 uint16 outputs_sync; /* How often to print, no matter what */
202 uint16 outputs_count; /* Print if this count is exceeded */ 200 uint16 outputs_count; /* Print if this count is exceeded */
203 object *mark; /* marked object */ 201 object *mark; /* marked object */
204 uint32 mark_count; /* count of mark object */ 202 uint32 mark_count; /* count of mark object */
205 /* Special DM fields */ 203 /* Special DM fields */
206 tag_t* stack_items; /* Item stack for patch/dump/... commands */ 204 tag_t* stack_items; /* Item stack for patch/dump/... commands */
207 int stack_position; /* Current stack position, 0 for no item */ 205 int stack_position; /* Current stack position, 0 for no item */
208}; 206};
209 207
210typedef struct pl : player_memset, attachable<struct pl> 208typedef struct pl : zero_initialised, attachable<struct pl>, player_pod
211{ 209{
212 static data_type get_dt () { return DT_PLAYER; }
213
214 struct pl *next; /* Pointer to next player, NULL if this is last */ 210 struct pl *next; /* Pointer to next player, NULL if this is last */
215 NewSocket socket; /* Socket information for this player */ 211 NewSocket socket; /* Socket information for this player */
212 Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */
213
214 void clear ()
215 {
216 memset (static_cast<player_pod *>(this), 0, sizeof (player_pod));
217 attachable_clear ();
218
219 for (int i = 0; i < NUM_OUTPUT_BUFS; i++)
220 outputs[i].buf = 0;
221 }
216} player; 222} player;
217 223
224

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines