--- deliantra/server/socket/info.C 2006/12/13 21:27:09 1.13 +++ deliantra/server/socket/info.C 2006/12/14 01:21:58 1.15 @@ -47,19 +47,14 @@ static void esrv_print_msg (NewSocket * ns, int color, const char *str) { - char buf[HUGE_BUF]; + packet sl; if (ns->status == Ns_Old) - { - snprintf (buf, HUGE_BUF, "%s\n", str); - } + sl.printf ("%s\n", str); else - { - snprintf (buf, HUGE_BUF, "drawinfo %d %s", color, str); - } + sl.printf ("drawinfo %d %s", color, str); -/* LOG(llevDebug,"sending %s to socket, len=%d\n", buf, strlen(buf));*/ - Write_String_To_Socket (ns, buf, strlen (buf)); + ns->send_packet (sl); } /** @@ -74,13 +69,10 @@ static void esrv_print_ext_msg (NewSocket * ns, int color, uint8 type, uint8 subtype, const char *message) { - char buf[HUGE_BUF]; - - snprintf (buf, HUGE_BUF, "drawextinfo %d %hhu %hhu %s", color, type, subtype, message); - Write_String_To_Socket (ns, buf, strlen (buf)); - -/* LOG(llevDebug,"sending %s to socket, len=%d", buf, strlen(buf));*/ + packet sl; + sl.printf ("drawextinfo %d %hhu %hhu %s", color, type, subtype, message); + ns->send_packet (sl); } /** @@ -639,7 +631,7 @@ ymax = y > ymax ? y : ymax; } - SockList sl (MAXSOCKBUF); + packet sl; sl.printf ("magicmap %d %d %d %d ", (xmax - xmin + 1), (ymax - ymin + 1), MAGIC_MAP_HALF - xmin, MAGIC_MAP_HALF - ymin); @@ -649,7 +641,6 @@ Send_With_Handling (&pl->contr->socket, &sl); - sl.free (); free (map_mark); }