--- deliantra/server/include/client.h 2007/07/12 08:40:14 1.60 +++ deliantra/server/include/client.h 2007/07/24 04:55:34 1.63 @@ -87,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; @@ -157,7 +166,7 @@ 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 */ @@ -192,6 +201,7 @@ 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 @@ -220,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 @@ -262,16 +273,7 @@ void send_drawinfo (const char *msg, int flags = NDI_BLACK); - MTH bool must_send_face (faceidx facenum) - { - if (faces_sent[facenum]) - return false; - - faces_sent[facenum] = true; - return true; - } - - 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);