[quake3-commits] r1861 - trunk/code/client
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun Feb 6 12:59:23 EST 2011
Author: thilo
Date: 2011-02-06 12:59:23 -0500 (Sun, 06 Feb 2011)
New Revision: 1861
Modified:
trunk/code/client/cl_main.c
Log:
Fix adding multiple entries for same server when using globalservers several times, patch by Tequila
Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c 2011-02-06 17:33:51 UTC (rev 1860)
+++ trunk/code/client/cl_main.c 2011-02-06 17:59:23 UTC (rev 1861)
@@ -2239,7 +2239,7 @@
===================
*/
void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extended ) {
- int i, count, total;
+ int i, j, count, total;
netadr_t addresses[MAX_SERVERSPERPACKET];
int numservers;
byte* buffptr;
@@ -2320,6 +2320,18 @@
// build net address
serverInfo_t *server = &cls.globalServers[count];
+ // Tequila: It's possible to have sent many master server requests. Then
+ // we may receive many times the same addresses from the master server.
+ // We just avoid to add a server if it is still in the global servers list.
+ for (j = 0; j < count; j++)
+ {
+ if (NET_CompareAdr(cls.globalServers[j].adr, addresses[i]))
+ break;
+ }
+
+ if (j < count)
+ continue;
+
CL_InitServerInfo( server, &addresses[i] );
// advance to next slot
count++;
More information about the quake3-commits
mailing list