--- deliantra/server/socket/lowlevel.C 2006/12/14 01:12:35 1.13 +++ deliantra/server/socket/lowlevel.C 2006/12/14 01:21:58 1.14 @@ -82,11 +82,11 @@ /*********************************************************************** * - * SockList functions/utilities + * packet functions/utilities * **********************************************************************/ -SockList &SockList::operator <<(const data &v) +packet &packet::operator <<(const data &v) { if (v.len) { @@ -97,25 +97,25 @@ return *this; } -SockList &SockList::operator <<(const data8 &v) +packet &packet::operator <<(const data8 &v) { unsigned int len = min (v.len, 0x00FF); return *this << uint8 (len) << data (v.ptr, len); } -SockList &SockList::operator <<(const data16 &v) +packet &packet::operator <<(const data16 &v) { unsigned int len = min (v.len, 0xFFFF); return *this << uint16 (len) << data (v.ptr, len); } -SockList &SockList::operator <<(const char *v) +packet &packet::operator <<(const char *v) { return *this << data (v, strlen (v ? v : 0)); } void -SockList::printf (const char *format, ...) +packet::printf (const char *format, ...) { va_list ap; va_start (ap, format); @@ -368,7 +368,7 @@ */ void -NewSocket::send_packet (SockList &sl) +NewSocket::send_packet (packet &sl) { Send_With_Handling (this, &sl); } @@ -376,11 +376,10 @@ void NewSocket::send_packet (const char *buf, int len) { - SockList sl (MAXSOCKBUF); + packet sl; sl << data (buf, len); send_packet (sl); - sl.free (); } void @@ -392,11 +391,11 @@ /** * Calls Write_To_Socket to send data to the client. * - * The only difference in this function is that we take a SockList + * The only difference in this function is that we take a packet *, and we prepend the length information. */ void -Send_With_Handling (NewSocket *ns, SockList *msg) +Send_With_Handling (NewSocket *ns, packet *msg) { unsigned char sbuf[4];