--- deliantra/server/socket/info.C 2006/12/14 02:37:37 1.16 +++ deliantra/server/socket/info.C 2006/12/16 03:08:26 1.21 @@ -45,16 +45,9 @@ * replaced with this, just using black as the color. */ static void -esrv_print_msg (client_socket * ns, int color, const char *str) +esrv_print_msg (client * ns, int color, const char *str) { - packet sl; - - if (ns->status == Ns_Old) - sl.printf ("%s\n", str); - else - sl.printf ("drawinfo %d %s", color, str); - - ns->send_packet (sl); + ns->send_packet_printf ("drawinfo %d %s", color, str); } /** @@ -67,12 +60,9 @@ * message The main message */ static void -esrv_print_ext_msg (client_socket * ns, int color, uint8 type, uint8 subtype, const char *message) +esrv_print_ext_msg (client * ns, int color, uint8 type, uint8 subtype, const char *message) { - packet sl; - - sl.printf ("drawextinfo %d %hhu %hhu %s", color, type, subtype, message); - ns->send_packet (sl); + ns->send_packet_printf ("drawextinfo %d %hhu %hhu %s", color, type, subtype, message); } /** @@ -97,10 +87,7 @@ return; if (pl->type == PLAYER) - { - esrv_print_msg (&pl->contr->socket, colr, (char *) tmp); - return; - } + esrv_print_msg (pl->contr->socket, colr, (char *) tmp); } /** @@ -270,7 +257,8 @@ if (pri >= pl->contr->listening) return; - if (!CLIENT_SUPPORT_READABLES (&pl->contr->socket, type)) + + if (!CLIENT_SUPPORT_READABLES (pl->contr->socket, type)) { char *buf = (char *) malloc (strlen (oldmessage == NULL ? message : oldmessage) + 1); @@ -285,9 +273,7 @@ } } else - { - esrv_print_ext_msg (&pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, message); - } + esrv_print_ext_msg (pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, message); } void @@ -301,7 +287,8 @@ if (pri >= pl->contr->listening) return; - if (!CLIENT_SUPPORT_READABLES (&pl->contr->socket, type)) + + if (!CLIENT_SUPPORT_READABLES (pl->contr->socket, type)) { va_list ap; @@ -320,7 +307,7 @@ vsnprintf (buf, HUGE_BUF, new_format, ap); va_end (ap); strip_media_tag (buf); - esrv_print_ext_msg (&pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, buf); + esrv_print_ext_msg (pl->contr->socket, flags & NDI_COLOR_MASK, type, subtype, buf); } } @@ -639,8 +626,7 @@ for (int x = xmin; x <= xmax; x++) sl << uint8 (map_mark[x + MAGIC_MAP_SIZE * y] & ~FACE_FLOOR); - Send_With_Handling (&pl->contr->socket, &sl); - + pl->contr->socket->send_packet (sl); free (map_mark); }