--- deliantra/server/socket/image.C 2007/03/14 15:44:47 1.32 +++ deliantra/server/socket/image.C 2007/04/03 00:21:38 1.39 @@ -240,15 +240,6 @@ void client::send_face (faceidx facenum) { - if (!facecache) - { - send_drawinfo ( - "*** Please enable face caching or use a client that supports it.\n", - NDI_RED - ); - return send_image (facenum); - } - // never send face 0. ever. it does not exist. if (!facenum) return; @@ -266,6 +257,17 @@ faces_sent[facenum] = true; + // if for some reason we let a client without face caching connect, + // we better support that decision here and implement it. + if (!facecache) + return send_image (facenum); + + if (fxix) + { + fxface.push_back (facenum); + return; + } + packet sl; if (force_face0) @@ -293,6 +295,34 @@ } } +void client::flush_fx () +{ + while (!fxface.empty ()) + { + packet sl ("fx"); + + do + { + faceidx facenum = fxface.back (); fxface.pop_back (); + + const facedata *d = face_data (facenum, faceset); + + if (d) + { + sl << ber32 (facenum) + << data8 (d->chksum, CHKSUM_SIZE); + + faceinfo *f = face_info (facenum); + if (f->smooth && EMI_smooth) + sl << ber32 (f->smooth); + } + } + while (!fxface.empty () && sl.room () > CHKSUM_SIZE + 8 + 8); + + send_packet (sl); + } +} + void client::send_image (faceidx facenum) { @@ -308,6 +338,11 @@ return; } + faces_sent[facenum] = true; + + if (force_image_newmap) + force_newmap = true; + packet sl; sl << (image2 ? "image2 " : "image ")