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
This commit is contained in:
Spoike 2005-10-15 23:32:32 +00:00
parent 0665911e31
commit 9a3b7b3dbe

View file

@ -17,7 +17,6 @@ static int multicasttype;
static int requireextension; static int requireextension;
static qboolean ignoreprotocol; static qboolean ignoreprotocol;
#define svc_setname 13 //NQ, not QW
#define svc_setfrags 14 #define svc_setfrags 14
#define svc_updatecolors 17 #define svc_updatecolors 17
@ -77,7 +76,7 @@ void NPP_NQFlush(void)
case svc_setfrags: case svc_setfrags:
bufferlen = 0; bufferlen = 0;
break; break;
case svc_setname: case svc_updatename:
bufferlen = 0; bufferlen = 0;
NPP_SetInfo(&svs.clients[buffer[1]], "name", buffer+2); NPP_SetInfo(&svs.clients[buffer[1]], "name", buffer+2);
break; break;
@ -284,7 +283,7 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
case svc_setview: case svc_setview:
protocollen = sizeof(qbyte)*1 + sizeof(short); protocollen = sizeof(qbyte)*1 + sizeof(short);
break; break;
case svc_setname: case svc_updatename:
break; break;
case svc_setfrags: case svc_setfrags:
protocollen = 4; //or this protocollen = 4; //or this
@ -446,7 +445,7 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
break; break;
} }
break; break;
case svc_setname: case svc_updatename:
case svc_stufftext: case svc_stufftext:
case svc_centerprint: case svc_centerprint:
break; break;
@ -460,8 +459,10 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
{ {
switch(majortype) 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 svcdp_hidelmp:
case svc_setname:
case svc_stufftext: case svc_stufftext:
case svc_centerprint: case svc_centerprint:
if (!data) if (!data)
@ -598,7 +599,9 @@ void NPP_NQWriteString(int dest, char *data) //replacement write func (nq to qw)
{ {
NPP_NQCheckDest(dest); NPP_NQCheckDest(dest);
if (!bufferlen) if (!bufferlen)
{
Con_Printf("NQWriteString: Messages should start with WriteByte\n"); Con_Printf("NQWriteString: Messages should start with WriteByte\n");
}
#ifdef NQPROT #ifdef NQPROT
if (dest == MSG_ONE) { if (dest == MSG_ONE) {
@ -619,7 +622,7 @@ void NPP_NQWriteString(int dest, char *data) //replacement write func (nq to qw)
{ {
switch(majortype) switch(majortype)
{ {
case svc_setname: case svc_updatename:
case svc_stufftext: case svc_stufftext:
case svc_centerprint: case svc_centerprint:
protocollen = bufferlen; protocollen = bufferlen;
@ -684,7 +687,7 @@ void NPP_QWFlush(void)
switch(majortype) 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; bufferlen = 0;
NPP_SetInfo(&svs.clients[buffer[1]], "name", buffer+2); NPP_SetInfo(&svs.clients[buffer[1]], "name", buffer+2);
break; break;