… | |
… | |
24 | #ifndef CLIENT_H |
24 | #ifndef CLIENT_H |
25 | #define CLIENT_H |
25 | #define CLIENT_H |
26 | |
26 | |
27 | #include <deque> |
27 | #include <deque> |
28 | #include <bitset> |
28 | #include <bitset> |
|
|
29 | #include <list> |
29 | |
30 | |
30 | // (possibly) max. number of objects "per page" in the ground container |
31 | // (possibly) max. number of objects "per page" in the ground container |
31 | #define FLOORBOX_PAGESIZE 50 |
32 | #define FLOORBOX_PAGESIZE 50 |
32 | |
33 | |
33 | struct MapCell |
34 | struct MapCell |
… | |
… | |
112 | { |
113 | { |
113 | sfree<char> (data, datalen + 1); |
114 | sfree<char> (data, datalen + 1); |
114 | } |
115 | } |
115 | }; |
116 | }; |
116 | |
117 | |
|
|
118 | // this represents a container on the client side. |
|
|
119 | // right now, there are only ever two of them: |
|
|
120 | // the inventory and the floor/open container |
|
|
121 | //TODO: unused as of yet |
|
|
122 | struct client_container |
|
|
123 | { |
|
|
124 | enum { CC_NONE, CC_INVENTORY, CC_MAPSPACE, CC_CONTAINER } type; |
|
|
125 | |
|
|
126 | // for mapspace and container |
|
|
127 | sint16 x, y; |
|
|
128 | maptile *map; |
|
|
129 | |
|
|
130 | // for container |
|
|
131 | object *env; |
|
|
132 | }; |
|
|
133 | |
117 | /* how many times we are allowed to give the wrong password before being kicked. */ |
134 | /* how many times we are allowed to give the wrong password before being kicked. */ |
118 | #define MAX_PASSWORD_FAILURES 5 |
135 | #define MAX_PASSWORD_FAILURES 5 |
119 | |
136 | |
120 | ACC_CLASS (client) // should become player when newsocket is a baseclass of player |
137 | ACC_CLASS (client) // should become player when newsocket is a baseclass of player |
121 | struct client : zero_initialised, attachable_base |
138 | struct client : zero_initialised, attachable_base |
122 | { |
139 | { |
123 | enum Sock_Status status; |
140 | enum Sock_Status status; |
124 | int ACC (RW, fd); |
141 | int ACC (RW, fd); |
125 | unsigned int inbuf_len; // number of bytes valid in inbuf |
142 | unsigned int inbuf_len; // number of bytes valid in inbuf |
126 | uint8 *faces_sent; // This is a bitmap on sent face status |
143 | uint8 *faces_sent; // This is a bitmap on sent face status |
127 | struct statsinfo stats; |
144 | statsinfo stats; |
|
|
145 | |
|
|
146 | client_container cc_inv, cc_other; |
128 | |
147 | |
129 | char *ACC (RW, host); /* Which host it is connected from (ip address) */ |
148 | char *ACC (RW, host); /* Which host it is connected from (ip address) */ |
130 | uint8 ACC (RW, password_fails); /* how many times the player has failed to give the right password */ |
149 | uint8 ACC (RW, password_fails); /* how many times the player has failed to give the right password */ |
131 | Buffer outputbuffer; |
150 | Buffer outputbuffer; |
132 | |
151 | |