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.101 by root, Sat Oct 16 22:51:51 2010 UTC vs.
Revision 1.108 by root, Tue Oct 30 17:07:50 2012 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * 5 *
6 * Deliantra is free software: you can redistribute it and/or modify it under 6 * Deliantra is free software: you can redistribute it and/or modify it under
7 * the terms of the Affero GNU General Public License as published by the 7 * the terms of the Affero GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your 8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version. 9 * option) any later version.
10 * 10 *
11 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 * 15 *
16 * You should have received a copy of the Affero GNU General Public License 16 * You should have received a copy of the Affero GNU General Public License
17 * and the GNU General Public License along with this program. If not, see 17 * and the GNU General Public License along with this program. If not, see
18 * <http://www.gnu.org/licenses/>. 18 * <http://www.gnu.org/licenses/>.
19 * 19 *
20 * The authors can be reached via e-mail to <support@deliantra.net> 20 * The authors can be reached via e-mail to <support@deliantra.net>
21 */ 21 */
22 22
23#ifndef CLIENT_H 23#ifndef CLIENT_H
24#define CLIENT_H 24#define CLIENT_H
211 void mapinfo_queue_clear (); 211 void mapinfo_queue_clear ();
212 void mapinfo_queue_run (); 212 void mapinfo_queue_run ();
213 bool mapinfo_try (char *buf); 213 bool mapinfo_try (char *buf);
214 214
215 struct ixsend { 215 struct ixsend {
216 int16_t pri; // unused 216 int16_t pri; // higher means faces are sent earlier, default 0
217 faceidx idx; 217 faceidx idx;
218 uint32_t ofs; // if != 0, need to send remaining bytes of partial_face 218 uint32_t ofs; // if != 0, need to send remaining bytes of partial_face
219 }; 219 };
220 std::vector<ixsend, slice_allocator<ixsend> > ixface; // which faces to send to the client using ix 220 std::vector<ixsend, slice_allocator<ixsend> > ixface; // which faces to send to the client using ix
221 221
222 std::vector<faceidx, slice_allocator<faceidx> > fxface; // which faces to send using fx 222 std::vector<faceidx, slice_allocator<faceidx> > fxface; // which faces to send using fx
223 MTH void flush_fx (); // send fx if required 223 MTH void flush_fx (); // send fx if required
224
225 MTH void invalidate_face (faceidx idx);
226 MTH void invalidate_all_faces ();
224 227
225 void do_destroy (); 228 void do_destroy ();
226 void gather_callbacks (AV *&callbacks, event_type event) const; 229 void gather_callbacks (AV *&callbacks, event_type event) const;
227 230
228 iow socket_ev; void socket_cb (iow &w, int revents); 231 iow socket_ev; void socket_cb (iow &w, int revents);
236 std::bitset<FT_NUM> fx_want; 239 std::bitset<FT_NUM> fx_want;
237 240
238 // if we get an incomplete packet, this is used to hold the data. 241 // if we get an incomplete packet, this is used to hold the data.
239 // we add 2 byte for the header, one for the trailing 0 byte 242 // we add 2 byte for the header, one for the trailing 0 byte
240 uint8 inbuf[MAXSOCKBUF + 2 + 1]; 243 uint8 inbuf[MAXSOCKBUF + 2 + 1];
244 void inbuf_handle ();
241 245
242 enum { MSG_BUF_SIZE = 80, MSG_BUF_COUNT = 10 }; 246 enum { MSG_BUF_SIZE = 80, MSG_BUF_COUNT = 10 };
243 struct msg_buf 247 struct msg_buf
244 { 248 {
245 tick_t expire; 249 tick_t expire;
339 ACC (RW, tcpi.tcpi_snd_cwnd); 343 ACC (RW, tcpi.tcpi_snd_cwnd);
340 ACC (RW, tcpi.tcpi_advmss); 344 ACC (RW, tcpi.tcpi_advmss);
341 ACC (RW, tcpi.tcpi_reordering); 345 ACC (RW, tcpi.tcpi_reordering);
342#endif 346#endif
343 347
344//+GPL
345
346#define CLIENT_SUPPORT_READABLES(__sockPtr,__type)\
347 ( ((__type)>0) &&\
348 ((__sockPtr)->has_readable_type) && \
349 ((__sockPtr)->supported_readables & (1<<(__type))) )
350
351#define FACE_TYPES 1
352#define PNG_FACE_INDEX 0
353
354//-GPL
355
356typedef object_vector<client, &client::active> sockvec; 348typedef object_vector<client, &client::active> sockvec;
357 349
358extern sockvec clients; 350extern sockvec clients;
359 351
360#define for_all_clients(var) \ 352#define for_all_clients(var) \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines