From 9a3b7b3dbe6948ca0c11c7bf0bf20912c6f8fcb6 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 15 Oct 2005 23:32:32 +0000 Subject: [PATCH] Got rid of a define, using the protocol.h version instead. Also fixed a bug that exhibits itself in requiem, shortly after you die. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1472 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/net_preparse.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/engine/server/net_preparse.c b/engine/server/net_preparse.c index 62d452516..b793d15ca 100644 --- a/engine/server/net_preparse.c +++ b/engine/server/net_preparse.c @@ -17,7 +17,6 @@ static int multicasttype; static int requireextension; static qboolean ignoreprotocol; -#define svc_setname 13 //NQ, not QW #define svc_setfrags 14 #define svc_updatecolors 17 @@ -77,7 +76,7 @@ void NPP_NQFlush(void) case svc_setfrags: bufferlen = 0; break; - case svc_setname: + case svc_updatename: bufferlen = 0; NPP_SetInfo(&svs.clients[buffer[1]], "name", buffer+2); break; @@ -284,7 +283,7 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw) case svc_setview: protocollen = sizeof(qbyte)*1 + sizeof(short); break; - case svc_setname: + case svc_updatename: break; case svc_setfrags: protocollen = 4; //or this @@ -446,7 +445,7 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw) break; } break; - case svc_setname: + case svc_updatename: case svc_stufftext: case svc_centerprint: break; @@ -460,8 +459,10 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw) { switch(majortype) { + case svc_updatename: + if (bufferlen < 2) + break; //don't truncate the name if the mod is sending the slot number case svcdp_hidelmp: - case svc_setname: case svc_stufftext: case svc_centerprint: if (!data) @@ -598,7 +599,9 @@ void NPP_NQWriteString(int dest, char *data) //replacement write func (nq to qw) { NPP_NQCheckDest(dest); if (!bufferlen) + { Con_Printf("NQWriteString: Messages should start with WriteByte\n"); + } #ifdef NQPROT if (dest == MSG_ONE) { @@ -619,7 +622,7 @@ void NPP_NQWriteString(int dest, char *data) //replacement write func (nq to qw) { switch(majortype) { - case svc_setname: + case svc_updatename: case svc_stufftext: case svc_centerprint: protocollen = bufferlen; @@ -684,7 +687,7 @@ void NPP_QWFlush(void) switch(majortype) { - case svc_setname: //not a standard feature, but hey, if a progs wants bots. + case svc_updatename: //not a standard feature, but hey, if a progs wants bots. bufferlen = 0; NPP_SetInfo(&svs.clients[buffer[1]], "name", buffer+2); break;