--- deliantra/server/include/client.h 2006/12/19 05:41:21 1.11 +++ deliantra/server/include/client.h 2006/12/20 09:14:22 1.13 @@ -26,6 +26,7 @@ #include #include +#include // (possibly) max. number of objects "per page" in the ground container #define FLOORBOX_PAGESIZE 50 @@ -77,7 +78,7 @@ */ enum MapMode { Map0Cmd = 0, Map1Cmd = 1, Map1aCmd = 2 }; -/* The following is the setup for a ring buffer for storing outbut +/* The following is the setup for a ring buffer for storing output * data that the OS can't handle right away. */ @@ -114,6 +115,43 @@ } }; +struct refitem +{ + object_ptr op; +}; + +// this represents a container on the client side. +// right now, there are only ever two of them: +// the inventory and the floor/open container +//TODO: unused as of yet +struct client_container : vector< refitem, slice_allocator > +{ + client *ns; + enum { CC_NONE, CC_INVENTORY, CC_MAPSPACE, CC_CONTAINER } type; + + bool item_changed; // one of the items in here possibly changed + + // for mapspace and container + int x, y; + maptile *map; + + // for container + object *env; + + client_container (client *ns) + : ns (ns), type (CC_NONE) { } + + tag_t tag () const; + + inline iterator merge_item (iterator i, object *op); + + void clear (); + void update (); + + void set_mapspace (maptile *map, int x, int y); + void set_container (object *env); +}; + /* how many times we are allowed to give the wrong password before being kicked. */ #define MAX_PASSWORD_FAILURES 5 @@ -124,7 +162,9 @@ 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 - struct statsinfo stats; + statsinfo stats; + + client_container cc_inv, cc_other; char *ACC (RW, host); /* Which host it is connected from (ip address) */ uint8 ACC (RW, password_fails); /* how many times the player has failed to give the right password */