--- deliantra/server/include/player.h 2006/12/20 09:14:22 1.29 +++ deliantra/server/include/player.h 2006/12/22 16:34:00 1.31 @@ -132,7 +132,6 @@ sint8 ACC (RW, gen_sp_armour); /* Penalty to sp regen from armour */ sint8 ACC (RW, gen_grace); /* Bonuses to regeneration speed of grace */ sint16 ACC (RW, item_power); /* Total item power of objects equipped */ - uint8 ACC (RW, state); /* Input state of the player (name, password, etc */ uint8 ACC (RW, listening); /* Which priority will be used in info_all */ sint8 ACC (RW, last_level); /* Last level we sent to client */ @@ -163,7 +162,6 @@ living ACC (RO, last_stats); /* Last stats as sent to client */ float ACC (RW, last_speed); /* Last speed as sent to client */ sint16 last_resist[NROFATTACKS]; /* last resist values sent to client */ - int Swap_First; /* First stat player has selected to swap */ object_ptr ACC (RW, last_used); /* Pointer to object last picked or applied */ sint16 ACC (RW, bed_x), ACC (RW, bed_y); /* x,y - coordinates of respawn (savebed) */ @@ -181,8 +179,7 @@ char ACC (RW, killer)[64]; /* Who killed this player. */ - char write_buf[MAX_BUF]; /* Holds arbitrary input from client */ - char input_buf[MAX_BUF]; /* Holds command to run */ + char write_buf[MAX_BUF]; /* Holds arbitrary input from client */ /* should go */ char ACC (RW, password)[16]; /* 2 (seed) + 11 (crypted) + 1 (EOS) + 2 (safety) = 16 */ time_t ACC (RW, last_save_time); @@ -207,10 +204,11 @@ struct player : zero_initialised, attachable, player_pod { - player *next; /* Pointer to next player, NULL if this is last */ - client *ACC (RO, socket); /* Socket information for this player */ + player *ACC (RW, next); /* Pointer to next player, NULL if this is last */ + client *ACC (RO, ns); /* Socket information for this player */ + shstr ACC (RW, invis_race); /* What race invisible to? */ + bool ACC (RW, enable_save); Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */ - shstr invis_race; /* What race invisible to? */ void clear () { @@ -221,5 +219,17 @@ for (int i = 0; i < NUM_OUTPUT_BUFS; i++) outputs[i].buf = 0; } + + static player *create (); + static player *load (const char *path); + void save (bool final = false); + + void connect (client *ns); + + ~player (); + +private: + void set_object (object *op); + player (); };