--- deliantra/server/include/client.h 2006/12/22 16:34:00 1.16 +++ deliantra/server/include/client.h 2006/12/25 11:25:49 1.21 @@ -79,7 +79,6 @@ /* The following is the setup for a ring buffer for storing output * data that the OS can't handle right away. */ - struct Buffer { char data[SOCKETBUFSIZE]; @@ -96,7 +95,6 @@ ST_CONFIRM_QUIT, ST_CHANGE_CLASS, - ST_CONFIGURE, ST_GET_PARTY_PASSWORD, }; @@ -166,13 +164,13 @@ /* how many times we are allowed to give the wrong password before being kicked. */ #define MAX_PASSWORD_FAILURES 5 -ACC_CLASS (client) // should become player when newsocket is a baseclass of player -struct client : zero_initialised, attachable +INTERFACE_CLASS (client) // should become player when newsocket is a baseclass of player +struct client : zero_initialised, attachable { int ACC (RW, fd); unsigned int inbuf_len; // number of bytes valid in inbuf uint8 *faces_sent; // This is a bitmap on sent face status - statsinfo stats; + statsinfo stats; client_container cc_inv, cc_other; Buffer outputbuffer; @@ -181,10 +179,10 @@ uint8 ACC (RW, state); /* Input state of the player (name, password, etc */ uint8 ACC (RW, password_fails); /* how many times the player has failed to give the right password */ + bool ACC (RW, afk); /* player is afk */ bool ACC (RW, facecache); /* If true, client is caching images */ bool ACC (RW, sent_scroll); bool ACC (RW, sound); /* does the client want sound */ - bool ACC (RW, exp64); /* Client wants 64 bit exp data, as well as skill data */ bool ACC (RW, newmapcmd); /* Send newmap command when entering new map SMACFIGGEN */ bool ACC (RW, plugincmd); /* CF+ extend the protocol through a plug-in */ bool ACC (RW, mapinfocmd); /* CF+ return map info and send map change info */ @@ -214,14 +212,14 @@ int ACC (RW, current_x), ACC (RW, current_y); // CF+ last/current map position char ACC (RW, version)[64]; // CF+ client name/version - player *ACC (RO, pl);//TODO should not be here, preferably + player_ptr ACC (RO, pl); int ACC (RW, rtt), ACC (RW, rttvar); /* round-trip time and -variance, if known */ client (int fd, const char *from_ip); ~client (); - void destroy (); - bool destroyed () const { return state == ST_DEAD; } + void do_destroy (); + void gather_callbacks (AV *&callbacks, event_type event) const; iw cmd_ev; void cmd_cb (iw &w); iow socket_ev; void socket_cb (iow &w, int got);