--- deliantra/server/include/client.h 2007/06/24 15:33:41 1.56
+++ deliantra/server/include/client.h 2007/07/24 04:55:34 1.63
@@ -1,23 +1,22 @@
/*
- * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game.
+ * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
*
* Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
* Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Crossfire TRT is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Crossfire TRT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
*
* The authors can be reached via e-mail to
*/
@@ -88,6 +87,15 @@
PF_COMMAND6 = 0x08, // command starts at offset 6
};
+// face type.s bit 0 means "has meta info prepended"
+enum {
+ FT_FACE = 0 * 2 + 0, // faces (images)
+ FT_MUSIC = 1 * 2 + 1, // background music
+ FT_SOUND = 2 * 2 + 1, // effects
+ FT_RSRC = 3 * 2 + 0, // generic data files
+ FT_NUM,
+};
+
struct packet_type
{
const char *name;
@@ -158,12 +166,12 @@
bool ACC (RW, newmapcmd); /* Send newmap command when entering new map SMACFIGGEN */
bool ACC (RW, plugincmd); // extend the protocol through a plug-in */
bool ACC (RW, mapinfocmd); // return map info and send map change info
- bool ACC (RW, extcmd); // call into extensions/plugins
+ uint8_t ACC (RW, extcmd); // call into extensions/plugins
bool ACC (RW, extmap); // extend map comamnd with extra data
bool ACC (RW, buggy_mapscroll); // client crashes on large mapscrolls
bool ACC (RW, darkness); /* True if client wants darkness information */
bool ACC (RW, image2); /* Client wants image2/face2 commands */
- bool ACC (RW, fxix); // client implements fx and ix (face|image extended) commands
+ uint8_t ACC (RW, fxix); // client implements fx and ix (face|image extended) commands
bool ACC (RW, update_look); /* If true, we need to send the look window */
bool ACC (RW, has_readable_type); /* If true client accept additional text information */
/* used to arrange text in books, scrolls, or scripted dialogs */
@@ -193,17 +201,21 @@
tstamp ACC (RW, last_send); // last data send on socket.
int ACC (RW, rtt), ACC (RW, rttvar); /* round-trip time and -variance, if known */
+ int ACC (RW, outq); // current socket outq length, or 0 if indeterminable
int ACC (RW, rate_avail); // current rate balance
int ACC (RW, max_rate); // max. # of bytes to send per tick
faceidx ACC (RW, scrub_idx); // which face to send next
int ACC (RW, bg_scrub); // how many ticks till the next background face send
- faceidx partial_face;
- uint32 partial_face_ofs; // if != 0, need to send remaining bytes of partial_face
- std::vector > askface; // which faces have been requested by the client
+ struct ixsend {
+ int16_t pri; // unused
+ faceidx idx;
+ uint32_t ofs; // if != 0, need to send remaining bytes of partial_face
+ };
+ std::vector > ixface; // which faces to send to the client using ix
- std::vector > fxface; // which faces to send using fx
+ std::vector > fxface; // which faces to send using fx
MTH void flush_fx (); // send fx if required
void do_destroy ();
@@ -218,6 +230,7 @@
struct Map lastmap;
std::bitset anims_sent;
std::bitset faces_sent;
+ std::bitset fx_want;
// if we get an incomplete packet, this is used to hold the data.
// we add 2 byte for the header, one for the trailing 0 byte
@@ -259,7 +272,8 @@
void send_packet (packet &sl);
void send_drawinfo (const char *msg, int flags = NDI_BLACK);
- MTH void send_face (faceidx facenum);
+
+ MTH void send_face (faceidx facenum, int pri = 0);
MTH void send_image (faceidx facenum);
MTH void send_faces (object *ob);
MTH void send_animation (short anim_num);