--- deliantra/server/socket/image.C 2006/12/13 21:27:09 1.6 +++ deliantra/server/socket/image.C 2006/12/14 01:12:35 1.7 @@ -314,28 +314,21 @@ */ void -SetFaceMode (char *buf, int len, NewSocket * ns) +SetFaceMode (char *buf, int len, NewSocket *ns) { - char tmp[256]; - int mask = (atoi (buf) & CF_FACE_CACHE), mode = (atoi (buf) & ~CF_FACE_CACHE); if (mode == CF_FACE_NONE) - { - ns->facecache = 1; - } + ns->facecache = 1; else if (mode != CF_FACE_PNG) { - sprintf (tmp, "drawinfo %d %s", NDI_RED, "Warning - send unsupported face mode. Will use Png"); - Write_String_To_Socket (ns, tmp, strlen (tmp)); -#ifdef ESRV_DEBUG - LOG (llevDebug, "SetFaceMode: Invalid mode from client: %d\n", mode); -#endif + SockList sl (MAXSOCKBUF); + sl.printf ("drawinfo %d %s", NDI_RED, "Warning - send unsupported face mode. Will use Png"); + ns->send_packet (sl); } + if (mask) - { - ns->facecache = 1; - } + ns->facecache = 1; } /** @@ -462,8 +455,9 @@ stop = atoi (cp); if (stop < start || *cp == '\0' || (stop - start) > 1000 || stop >= nrofpixmaps) { - sprintf (buf, "replyinfo image_sums %d %d", start, stop); - cs_write_string (ns, buf, strlen (buf)); + sl.printf ("replyinfo image_sums %d %d", start, stop); + ns->send_packet (sl); + sl.reset (); return; }