mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-28 06:52:35 +00:00
Another change to server parsing as a server reporting in from 69.79.84.0/24 with the master server could screw up the server list in ioquake3 clients.
This commit is contained in:
parent
845de6a960
commit
c281b6aca0
1 changed files with 26 additions and 30 deletions
|
@ -1843,7 +1843,6 @@ void CL_ServersResponsePacket( netadr_t from, msg_t *msg ) {
|
||||||
int numservers;
|
int numservers;
|
||||||
byte* buffptr;
|
byte* buffptr;
|
||||||
byte* buffend;
|
byte* buffend;
|
||||||
netadrtype_t family = NA_IP;
|
|
||||||
|
|
||||||
Com_Printf("CL_ServersResponsePacket\n");
|
Com_Printf("CL_ServersResponsePacket\n");
|
||||||
|
|
||||||
|
@ -1857,46 +1856,42 @@ void CL_ServersResponsePacket( netadr_t from, msg_t *msg ) {
|
||||||
numservers = 0;
|
numservers = 0;
|
||||||
buffptr = msg->data;
|
buffptr = msg->data;
|
||||||
buffend = buffptr + msg->cursize;
|
buffend = buffptr + msg->cursize;
|
||||||
while (buffptr+1 < buffend)
|
|
||||||
{
|
|
||||||
// advance to initial token
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (*buffptr == '\\')
|
|
||||||
{
|
|
||||||
family = NA_IP;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if(*buffptr == '/')
|
|
||||||
{
|
|
||||||
family = NA_IP6;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffptr++;
|
// advance to initial token
|
||||||
}
|
do
|
||||||
while (buffptr < buffend);
|
{
|
||||||
|
if(*buffptr == '\\' || *buffptr == '/')
|
||||||
|
break;
|
||||||
|
|
||||||
buffptr++;
|
buffptr++;
|
||||||
|
} while (buffptr < buffend);
|
||||||
|
|
||||||
if(family == NA_IP)
|
while (buffptr + 1 < buffend)
|
||||||
|
{
|
||||||
|
if (*buffptr == '\\')
|
||||||
{
|
{
|
||||||
if (buffend - buffptr < sizeof(addresses[numservers].ip) + sizeof(addresses[numservers].port) + sizeof("\\EOT") - 1)
|
buffptr++;
|
||||||
|
|
||||||
|
if (buffend - buffptr < sizeof(addresses[numservers].ip) + sizeof(addresses[numservers].port) + 1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
for(i = 0; i < sizeof(addresses[numservers].ip); i++)
|
for(i = 0; i < sizeof(addresses[numservers].ip); i++)
|
||||||
addresses[numservers].ip[i] = *buffptr++;
|
addresses[numservers].ip[i] = *buffptr++;
|
||||||
|
|
||||||
|
addresses[numservers].type = NA_IP;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (buffend - buffptr < sizeof(addresses[numservers].ip6) + sizeof(addresses[numservers].port) + sizeof("\\EOT") - 1)
|
buffptr++;
|
||||||
|
|
||||||
|
if (buffend - buffptr < sizeof(addresses[numservers].ip6) + sizeof(addresses[numservers].port) + 1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
for(i = 0; i < sizeof(addresses[numservers].ip6); i++)
|
for(i = 0; i < sizeof(addresses[numservers].ip6); i++)
|
||||||
addresses[numservers].ip6[i] = *buffptr++;
|
addresses[numservers].ip6[i] = *buffptr++;
|
||||||
}
|
|
||||||
|
|
||||||
addresses[numservers].type = family;
|
addresses[numservers].type = NA_IP6;
|
||||||
|
}
|
||||||
|
|
||||||
// parse out port
|
// parse out port
|
||||||
addresses[numservers].port = (*buffptr++) << 8;
|
addresses[numservers].port = (*buffptr++) << 8;
|
||||||
|
@ -1912,8 +1907,9 @@ void CL_ServersResponsePacket( netadr_t from, msg_t *msg ) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// parse out EOT
|
// parse out EOT
|
||||||
if (buffptr[1] == 'E' && buffptr[2] == 'O' && buffptr[3] == 'T')
|
// not anymore.. as servers from 69.79.84.0/24 can screw up the server list with this.
|
||||||
break;
|
// if (buffptr[1] == 'E' && buffptr[2] == 'O' && buffptr[3] == 'T')
|
||||||
|
// break;
|
||||||
}
|
}
|
||||||
|
|
||||||
count = cls.numglobalservers;
|
count = cls.numglobalservers;
|
||||||
|
|
Loading…
Reference in a new issue