… | |
… | |
115 | struct client : zero_initialised, attachable |
115 | struct client : zero_initialised, attachable |
116 | { |
116 | { |
117 | int ACC (RW, fd); |
117 | int ACC (RW, fd); |
118 | unsigned int inbuf_len; // number of bytes valid in inbuf |
118 | unsigned int inbuf_len; // number of bytes valid in inbuf |
119 | statsinfo stats; |
119 | statsinfo stats; |
120 | int ACC (RO, active); |
120 | object_vector_index ACC (RO, active); |
|
|
121 | player_ptr ACC (RO, pl); |
121 | |
122 | |
122 | /* The following is the setup for a ring buffer for storing output |
123 | /* The following is the setup for a ring buffer for storing output |
123 | * data that the OS can't handle right away. |
124 | * data that the OS can't handle right away. |
124 | */ |
125 | */ |
125 | struct |
126 | struct |
… | |
… | |
160 | bool ACC (RW, extcmd); // call into extensions/plugins |
161 | bool ACC (RW, extcmd); // call into extensions/plugins |
161 | bool ACC (RW, extmap); // extend map comamnd with extra data |
162 | bool ACC (RW, extmap); // extend map comamnd with extra data |
162 | bool ACC (RW, buggy_mapscroll); // client crashes on large mapscrolls |
163 | bool ACC (RW, buggy_mapscroll); // client crashes on large mapscrolls |
163 | bool ACC (RW, darkness); /* True if client wants darkness information */ |
164 | bool ACC (RW, darkness); /* True if client wants darkness information */ |
164 | bool ACC (RW, image2); /* Client wants image2/face2 commands */ |
165 | bool ACC (RW, image2); /* Client wants image2/face2 commands */ |
165 | bool ACC (RW, fxix); // client implements fx and ix (face|image extended) commands |
166 | uint8_t ACC (RW, fxix); // client implements fx and ix (face|image extended) commands |
166 | bool ACC (RW, update_look); /* If true, we need to send the look window */ |
167 | bool ACC (RW, update_look); /* If true, we need to send the look window */ |
167 | bool ACC (RW, has_readable_type); /* If true client accept additional text information */ |
168 | bool ACC (RW, has_readable_type); /* If true client accept additional text information */ |
168 | /* used to arrange text in books, scrolls, or scripted dialogs */ |
169 | /* used to arrange text in books, scrolls, or scripted dialogs */ |
169 | bool ACC (RW, monitor_spells); /* Client wishes to be informed when their spell list changes */ |
170 | bool ACC (RW, monitor_spells); /* Client wishes to be informed when their spell list changes */ |
170 | bool ACC (RW, ext_mapinfos); /* If true client accepts additional info on maps */ |
171 | bool ACC (RW, ext_mapinfos); /* If true client accepts additional info on maps */ |
… | |
… | |
187 | region *ACC (RW, current_region); // CF+ last/current player region |
188 | region *ACC (RW, current_region); // CF+ last/current player region |
188 | int ACC (RW, current_x), ACC (RW, current_y); // CF+ last/current map position |
189 | int ACC (RW, current_x), ACC (RW, current_y); // CF+ last/current map position |
189 | shstr ACC (RW, version); // CF+ client name/version |
190 | shstr ACC (RW, version); // CF+ client name/version |
190 | uint8 ACC (RW, faceset); // CF+ selected faceset |
191 | uint8 ACC (RW, faceset); // CF+ selected faceset |
191 | |
192 | |
192 | player_ptr ACC (RO, pl); |
193 | tstamp ACC (RW, last_send); // last data send on socket. |
193 | |
194 | |
194 | int ACC (RW, rtt), ACC (RW, rttvar); /* round-trip time and -variance, if known */ |
195 | int ACC (RW, rtt), ACC (RW, rttvar); /* round-trip time and -variance, if known */ |
195 | |
196 | |
196 | int ACC (RW, rate_avail); // current rate balance |
197 | int ACC (RW, rate_avail); // current rate balance |
197 | int ACC (RW, max_rate); // max. # of bytes to send per tick |
198 | int ACC (RW, max_rate); // max. # of bytes to send per tick |
198 | faceidx ACC (RW, scrub_idx); // which face to send next |
199 | faceidx ACC (RW, scrub_idx); // which face to send next |
199 | int ACC (RW, bg_scrub); // how many ticks till the next background face send |
200 | int ACC (RW, bg_scrub); // how many ticks till the next background face send |
200 | |
201 | |
201 | faceidx partial_face; |
202 | struct ixsend { |
202 | uint32 partial_face_ofs; // if != 0, need to send remaining bytes of partial_face |
203 | int16_t pri; // unused |
203 | std::vector<faceidx, slice_allocator<faceidx> > askface; // which faces have been requested by the client |
204 | faceidx idx; |
|
|
205 | uint32_t ofs; // if != 0, need to send remaining bytes of partial_face |
|
|
206 | }; |
|
|
207 | std::vector<ixsend, slice_allocator<ixsend> > ixface; // which faces to send to the client using ix |
204 | |
208 | |
205 | std::vector<faceidx, slice_allocator<faceidx> > fxface; // which faces to send using fx |
209 | std::vector<faceidx, slice_allocator<faceidx> > fxface; // which faces to send using fx |
206 | MTH void flush_fx (); // send fx if required |
210 | MTH void flush_fx (); // send fx if required |
207 | |
211 | |
208 | void do_destroy (); |
212 | void do_destroy (); |
209 | void gather_callbacks (AV *&callbacks, event_type event) const; |
213 | void gather_callbacks (AV *&callbacks, event_type event) const; |
210 | |
214 | |
… | |
… | |
260 | void send_drawinfo (const char *msg, int flags = NDI_BLACK); |
264 | void send_drawinfo (const char *msg, int flags = NDI_BLACK); |
261 | MTH void send_face (faceidx facenum); |
265 | MTH void send_face (faceidx facenum); |
262 | MTH void send_image (faceidx facenum); |
266 | MTH void send_image (faceidx facenum); |
263 | MTH void send_faces (object *ob); |
267 | MTH void send_faces (object *ob); |
264 | MTH void send_animation (short anim_num); |
268 | MTH void send_animation (short anim_num); |
265 | MTH void send_msg (int color, const char *type, const char *msg); |
269 | void send_msg (int color, const char *type, const char *msg); |
266 | |
270 | |
267 | // called when something under the player changes |
271 | // called when something under the player changes |
268 | MTH void floorbox_update () { update_look = 1; } |
272 | MTH void floorbox_update () { update_look = 1; } |
269 | // called when the player has been moved |
273 | // called when the player has been moved |
270 | MTH void floorbox_reset () { look_position = 0; floorbox_update (); } |
274 | MTH void floorbox_reset () { look_position = 0; floorbox_update (); } |
… | |
… | |
313 | #define PNG_FACE_INDEX 0 |
317 | #define PNG_FACE_INDEX 0 |
314 | |
318 | |
315 | #define VERSION_CS 1023 /* version >= 1023 understand setup cmd */ |
319 | #define VERSION_CS 1023 /* version >= 1023 understand setup cmd */ |
316 | #define VERSION_SC 1026 |
320 | #define VERSION_SC 1026 |
317 | //#define VERSION_SC 1027 // requestinfo image_info and image_sums, makes extending faces on the fly impossible |
321 | //#define VERSION_SC 1027 // requestinfo image_info and image_sums, makes extending faces on the fly impossible |
318 | #define VERSION_INFO "Crossfire+ Server" |
322 | #define VERSION_INFO "Crossfire TRT Server" |
319 | |
323 | |
320 | typedef object_vector<client, &client::active> sockvec; |
324 | typedef object_vector<client, &client::active> sockvec; |
321 | |
325 | |
322 | extern sockvec clients; |
326 | extern sockvec clients; |
323 | |
327 | |