--- deliantra/server/socket/init.C 2006/12/14 00:01:35 1.12 +++ deliantra/server/socket/init.C 2006/12/14 01:12:35 1.13 @@ -61,8 +61,6 @@ void InitConnection (NewSocket *ns, const char *from_ip) { - SockList sl; - char buf[256]; int bufsize = 65535; /*Supposed absolute upper limit */ int oldbufsize; int buflen = sizeof (int); @@ -141,10 +139,15 @@ ns->sent_scroll = 0; ns->host = strdup_local (from_ip); - sprintf ((char *) buf, "version %d %d %s\n", VERSION_CS, VERSION_SC, VERSION_INFO); - sl.buf = (unsigned char *) buf; - sl.len = strlen ((char *) buf); - Send_With_Handling (ns, &sl); + + { + SockList sl (MAXSOCKBUF); + + sl.printf ("version %d %d %s\n", VERSION_CS, VERSION_SC, VERSION_INFO); + Send_With_Handling (ns, &sl); + sl.free (); + } + #ifdef CS_LOGSTATS if (socket_info.nconns > cst_tot.max_conn) cst_tot.max_conn = socket_info.nconns; @@ -270,7 +273,8 @@ void final_free_player (player *pl) { - cs_write_string (&pl->socket, "goodbye", 8); + pl->socket.send_packet ("goodbye"); free_newsocket (&pl->socket); free_player (pl); } +