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

Comparing deliantra/server/include/newserver.h (file contents):
Revision 1.12 by root, Sat Sep 16 22:24:12 2006 UTC vs.
Revision 1.16 by root, Wed Dec 13 18:08:01 2006 UTC

27 new client server communication method. Values defined here are only 27 new client server communication method. Values defined here are only
28 used on the server side code. For shared client/server values, see 28 used on the server side code. For shared client/server values, see
29 newclient.h 29 newclient.h
30*/ 30*/
31 31
32
33#ifndef NEWSERVER_H 32#ifndef NEWSERVER_H
34#define NEWSERVER_H 33#define NEWSERVER_H
35 34
36/* Reduce this from 50 to 5 - as it is now, there will never be more 35/* Reduce this from 50 to 5 - as it is now, there will never be more
37 * than 3 anyways. 36 * than 3 anyways.
39 38
40#define NUM_LOOK_OBJECTS 50 39#define NUM_LOOK_OBJECTS 50
41 40
42struct MapCell 41struct MapCell
43{ 42{
43 UUID player; // this is, unfortunately, very wasteful of memory space, but pretty bandwidth-efficient
44 int count; /* This is really darkness in the map1 command */
44 short faces[MAP_LAYERS]; 45 uint16 faces[MAP_LAYERS];
45 uint16 smooth[MAP_LAYERS]; 46 uint16 smooth[MAP_LAYERS];
46 int count; /* This is really darkness in the map1 command */
47 unsigned char stat_hp; // health of something in this space, or 0 47 unsigned char stat_hp; // health of something in this space, or 0
48 tag_t player; // this is, unfortunately, very wasteful of memory space, but pretty bandwidth-efficient 48 unsigned char flags;
49}; 49};
50 50
51/* This basically defines the largest size an 51/* This basically defines the largest size an
52 * archetype may be - it is used for allocation of 52 * archetype may be - it is used for allocation of
53 * some structures, as well as determining how far 53 * some structures, as well as determining how far
54 * we should look for the heads of big images. 54 * we should look for the heads of big images.
55 */ 55 */
56#define MAX_HEAD_OFFSET 8 56#define MAX_HEAD_OFFSET 8
57 57
58# define MAX_CLIENT_X (MAP_CLIENT_X + MAX_HEAD_OFFSET) 58#define MAX_CLIENT_X (MAP_CLIENT_X + MAX_HEAD_OFFSET)
59#define MAX_CLIENT_Y (MAP_CLIENT_Y + MAX_HEAD_OFFSET) 59#define MAX_CLIENT_Y (MAP_CLIENT_Y + MAX_HEAD_OFFSET)
60 60
61struct Map 61struct Map
62{ 62{
63 struct MapCell cells[MAX_CLIENT_X][MAX_CLIENT_Y]; 63 struct MapCell cells[MAX_CLIENT_X][MAX_CLIENT_Y];
100}; 100};
101 101
102/* how many times we are allowed to give the wrong password before being kicked. */ 102/* how many times we are allowed to give the wrong password before being kicked. */
103# define MAX_PASSWORD_FAILURES 5 103# define MAX_PASSWORD_FAILURES 5
104 104
105ACC_CLASS (player_TODO) // should become player when newsocket is a baseclass of player
105struct NewSocket 106struct NewSocket
106{ 107{
107 enum Sock_Status status; 108 enum Sock_Status status;
108 int fd; 109 int ACC (RW, fd);
109 struct Map lastmap; 110 struct Map lastmap;
110 size_t faces_sent_len; /* This is the number of elements allocated in faces_sent[] */ 111 size_t faces_sent_len; /* This is the number of elements allocated in faces_sent[] */
111 uint8 *faces_sent; /* This is a bitmap on sent face status */ 112 uint8 *faces_sent; /* This is a bitmap on sent face status */
112 uint8 anims_sent[MAXANIMNUM]; 113 uint8 anims_sent[MAXANIMNUM];
113 struct statsinfo stats; 114 struct statsinfo stats;
114 /* If we get an incomplete packet, this is used to hold the data. */ 115 /* If we get an incomplete packet, this is used to hold the data. */
115 SockList inbuf; 116 SockList inbuf;
116 char *host; /* Which host it is connected from (ip address) */ 117 char *ACC (RW, host); /* Which host it is connected from (ip address) */
117 uint8 password_fails; /* how many times the player has failed to give the right password */ 118 uint8 ACC (RW, password_fails); /* how many times the player has failed to give the right password */
118 Buffer outputbuffer; /* For undeliverable data */ 119 Buffer outputbuffer; /* For undeliverable data */
119 uint32 facecache:1; /* If true, client is caching images */ 120 uint32 ACC (RO, facecache):1; /* If true, client is caching images */
120 uint32 sent_scroll:1; 121 uint32 ACC (RO, sent_scroll):1;
121 uint32 sound:1; /* does the client want sound */ 122 uint32 ACC (RO, sound):1; /* does the client want sound */
122 uint32 exp64:1; /* Client wants 64 bit exp data, as well as skill data */ 123 uint32 ACC (RO, exp64):1; /* Client wants 64 bit exp data, as well as skill data */
123 uint32 newmapcmd:1; /* Send newmap command when entering new map SMACFIGGEN */ 124 uint32 ACC (RO, newmapcmd):1; /* Send newmap command when entering new map SMACFIGGEN */
124 uint32 plugincmd:1; /* CF+ extend the protocol through a plug-in */ 125 uint32 ACC (RO, plugincmd):1; /* CF+ extend the protocol through a plug-in */
125 uint32 mapinfocmd:1; /* CF+ return map info and send map change info */ 126 uint32 ACC (RO, mapinfocmd):1; /* CF+ return map info and send map change info */
126 uint32 extcmd:1; /* CF+ call into extensions/plugins */ 127 uint32 ACC (RO, extcmd):1; /* CF+ call into extensions/plugins */
127 uint32 extmap:1; /* CF+ extend map comamnd with extra data */ 128 uint32 ACC (RO, extmap):1; /* CF+ extend map comamnd with extra data */
128 uint32 buggy_mapscroll:1; /* CF+ client crashes on large mapscrolls */ 129 uint32 ACC (RO, buggy_mapscroll):1; /* CF+ client crashes on large mapscrolls */
129 uint32 darkness:1; /* True if client wants darkness information */ 130 uint32 ACC (RO, darkness):1; /* True if client wants darkness information */
130 uint32 image2:1; /* Client wants image2/face2 commands */ 131 uint32 ACC (RO, image2):1; /* Client wants image2/face2 commands */
131 uint32 update_look:1; /* If true, we need to send the look window */ 132 uint32 ACC (RO, update_look):1; /* If true, we need to send the look window */
132 uint32 can_write:1; /* Can we write to this socket? */ 133 uint32 ACC (RO, can_write):1; /* Can we write to this socket? */
133 uint32 has_readable_type:1; /* If true client accept additional text information 134 uint32 ACC (RO, has_readable_type):1; /* If true client accept additional text information
134 used to arrange text in books, scrolls, or scripted dialogs */ 135 used to arrange text in books, scrolls, or scripted dialogs */
135 uint32 monitor_spells:1; /* Client wishes to be informed when their spell list changes */ 136 uint32 ACC (RO, monitor_spells):1; /* Client wishes to be informed when their spell list changes */
136 uint32 supported_readables; /* each bit is a readable supported by client */
137 uint32 cs_version, sc_version; /* versions of the client */
138 enum MapMode mapmode; /* Type of map commands the client wants. */
139 uint16 look_position; /* start of drawing of look window */
140 uint8 mapx, mapy; /* How large a map the client wants */
141 uint8 itemcmd; /* What version of the 'item' protocol command to use */
142 uint8 faceset; /* Set the client is using, default 0 */
143 uint32 ext_mapinfos:1; /* If true client accept additionnal info on maps */ 137 uint32 ACC (RO, ext_mapinfos):1; /* If true client accept additionnal info on maps */
144 /* Below are flags for extedend infos to pass to client 138 /* Below are flags for extedend infos to pass to client
145 * with S->C mapextended command */ 139 * with S->C mapextended command */
146 uint32 EMI_smooth:1; /* Send smooth in extendmapinfos */ 140 uint32 ACC (RO, EMI_smooth):1; /* Send smooth in extendmapinfos */
141 uint32 ACC (RW, supported_readables); /* each bit is a readable supported by client */
142 uint32 ACC (RW, cs_version), ACC (RW, sc_version); /* versions of the client */
143 enum MapMode mapmode; /* Type of map commands the client wants. */
144 uint16 ACC (RW, look_position); /* start of drawing of look window */
145 uint8 ACC (RW, mapx), ACC (RW, mapy); /* How large a map the client wants */
146 uint8 ACC (RW, itemcmd); /* What version of the 'item' protocol command to use */
147 uint8 ACC (RW, faceset); /* Set the client is using, default 0 */
147 148
148 maptile *current_map; // CF+ last/current player map 149 maptile *ACC (RW, current_map); // CF+ last/current player map
149 int current_x, current_y; // CF+ last/current map position 150 int ACC (RW, current_x), ACC (RW, current_y); // CF+ last/current map position
150 char client[64]; // CF+ client name/version 151 char ACC (RW, client)[64]; // CF+ client name/version
151
152 /* Below here is information only relevant for old sockets */
153 char *comment; /* name or listen comment */
154 enum Old_Mode old_mode;
155}; 152};
156 153
157#define CLIENT_SUPPORT_READABLES(__sockPtr,__type)\ 154#define CLIENT_SUPPORT_READABLES(__sockPtr,__type)\
158 ( ((__type)>0) &&\ 155 ( ((__type)>0) &&\
159 ((__sockPtr)->has_readable_type) && \ 156 ((__sockPtr)->has_readable_type) && \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines