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

Comparing deliantra/server/include/client.h (file contents):
Revision 1.11 by root, Tue Dec 19 05:41:21 2006 UTC vs.
Revision 1.13 by root, Wed Dec 20 09:14:22 2006 UTC

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 <tr1/unordered_set>
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
33struct MapCell 34struct MapCell
75 * instead of having a bunch of different fields that needed to 76 * instead of having a bunch of different fields that needed to
76 * get toggled. 77 * get toggled.
77 */ 78 */
78enum MapMode { Map0Cmd = 0, Map1Cmd = 1, Map1aCmd = 2 }; 79enum MapMode { Map0Cmd = 0, Map1Cmd = 1, Map1aCmd = 2 };
79 80
80/* The following is the setup for a ring buffer for storing outbut 81/* The following is the setup for a ring buffer for storing output
81 * data that the OS can't handle right away. 82 * data that the OS can't handle right away.
82 */ 83 */
83 84
84struct Buffer 85struct Buffer
85{ 86{
112 { 113 {
113 sfree<char> (data, datalen + 1); 114 sfree<char> (data, datalen + 1);
114 } 115 }
115}; 116};
116 117
118struct refitem
119{
120 object_ptr op;
121};
122
123// this represents a container on the client side.
124// right now, there are only ever two of them:
125// the inventory and the floor/open container
126//TODO: unused as of yet
127struct client_container : vector< refitem, slice_allocator<refitem> >
128{
129 client *ns;
130 enum { CC_NONE, CC_INVENTORY, CC_MAPSPACE, CC_CONTAINER } type;
131
132 bool item_changed; // one of the items in here possibly changed
133
134 // for mapspace and container
135 int x, y;
136 maptile *map;
137
138 // for container
139 object *env;
140
141 client_container (client *ns)
142 : ns (ns), type (CC_NONE) { }
143
144 tag_t tag () const;
145
146 inline iterator merge_item (iterator i, object *op);
147
148 void clear ();
149 void update ();
150
151 void set_mapspace (maptile *map, int x, int y);
152 void set_container (object *env);
153};
154
117/* how many times we are allowed to give the wrong password before being kicked. */ 155/* how many times we are allowed to give the wrong password before being kicked. */
118#define MAX_PASSWORD_FAILURES 5 156#define MAX_PASSWORD_FAILURES 5
119 157
120ACC_CLASS (client) // should become player when newsocket is a baseclass of player 158ACC_CLASS (client) // should become player when newsocket is a baseclass of player
121struct client : zero_initialised, attachable_base 159struct client : zero_initialised, attachable_base
122{ 160{
123 enum Sock_Status status; 161 enum Sock_Status status;
124 int ACC (RW, fd); 162 int ACC (RW, fd);
125 unsigned int inbuf_len; // number of bytes valid in inbuf 163 unsigned int inbuf_len; // number of bytes valid in inbuf
126 uint8 *faces_sent; // This is a bitmap on sent face status 164 uint8 *faces_sent; // This is a bitmap on sent face status
127 struct statsinfo stats; 165 statsinfo stats;
166
167 client_container cc_inv, cc_other;
128 168
129 char *ACC (RW, host); /* Which host it is connected from (ip address) */ 169 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 */ 170 uint8 ACC (RW, password_fails); /* how many times the player has failed to give the right password */
131 Buffer outputbuffer; 171 Buffer outputbuffer;
132 172

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines