forked from fte/fteqw
1
0
Fork 0

protocol fixes for bot clients

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2339 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-07-02 04:27:56 +00:00
parent f51b6bbff6
commit cb447fa3f7
2 changed files with 31 additions and 17 deletions

View File

@ -259,14 +259,22 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
NPP_NQCheckDest(dest);
#ifdef NQPROT
if (dest == MSG_ONE) {
if (dest == MSG_ONE)
{
client_t *cl = Write_GetClient();
if (cl && !ISQWCLIENT(cl))
if (cl)
{
ClientReliableCheckBlock(cl, sizeof(qbyte));
ClientReliableWrite_Byte(cl, data);
if (cl->protocol == SCP_BAD) // is a bot
return;
else if (!ISQWCLIENT(cl))
{
ClientReliableCheckBlock(cl, sizeof(qbyte));
ClientReliableWrite_Byte(cl, data);
return;
}
}
} else
}
else
MSG_WriteByte (NQWriteDest(dest), data);
#endif
@ -933,7 +941,7 @@ void NPP_QWCheckDest(int dest)
{
if (dest == MSG_ONE)
{
/*client_t *cl = Write_GetClient();
/* client_t *cl = Write_GetClient();
if (!cl)
{
Con_Printf("Not a client\n");
@ -945,7 +953,7 @@ void NPP_QWCheckDest(int dest)
NPP_QWFlush();
}
cldest = cl;
*/
*/
}
else
{
@ -967,15 +975,22 @@ void NPP_QWWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
NPP_QWCheckDest(dest);
#ifdef NQPROT
if (dest == MSG_ONE) {
if (dest == MSG_ONE)
{
client_t *cl = Write_GetClient();
if (cl && ISQWCLIENT(cl))
if (cl)
{
ClientReliableCheckBlock(cl, sizeof(qbyte));
ClientReliableWrite_Byte(cl, data);
return;
if (ISQWCLIENT(cl))
{
ClientReliableCheckBlock(cl, sizeof(qbyte));
ClientReliableWrite_Byte(cl, data);
return;
}
else if (cl->protocol == SCP_BAD) // is a bot
return;
}
} else
}
else
MSG_WriteByte (QWWriteDest(dest), data);
#endif
if (!bufferlen) //new message section

View File

@ -1329,7 +1329,7 @@ void SV_WritePlayerToClient(sizebuf_t *msg, clstate_t *ent)
{ // don't show the corpse looking around...
cmd.angles[0] = 0;
cmd.angles[1] = ent->angles[1]*65535/360;
cmd.angles[0] = 0;
cmd.angles[2] = 0;
}
cmd.buttons = 0; // never send buttons
@ -1621,11 +1621,10 @@ void SV_WritePlayersToClient (client_t *client, edict_t *clent, qbyte *pvs, size
for (j=0,cl=svs.clients ; j<sv.allocated_client_slots ; j++,cl++)
{
isbot = !cl->state && (cl->name[0] || cl->protocol == SCP_BAD);
if (cl->state != cs_spawned) //this includes bots
if (!isbot || progstype == PROG_QW) //unless they're NQ bots...
continue;
continue;
isbot = (cl->name[0] || cl->protocol == SCP_BAD);
ent = cl->edict;
if (cl->viewent && ent == clent)
{