+// returns true, if it's sensible to continue the processing
+static qboolean NetConn_ClientParsePacket_ServerList_PrepareQuery( int protocol, const char *ipstring ) {
+ int n;
+ serverlist_entry_t *entry;
+
+ // ignore the rest of the message if the serverlist is full
+ if( serverlist_cachecount == SERVERLIST_TOTALSIZE )
+ return false;
+ // also ignore it if we have already queried it (other master server response)
+ for( n = 0 ; n < serverlist_cachecount ; n++ )
+ if( !strcmp( ipstring, serverlist_cache[ n ].info.cname ) )
+ break;
+
+ entry = &serverlist_cache[n];
+
+ if( n < serverlist_cachecount ) {
+ // the entry has already been queried once or
+ return true;
+ }
+
+ memset(entry, 0, sizeof(entry));
+ entry->protocol = protocol;
+ // store the data the engine cares about (address and ping)
+ strlcpy (entry->info.cname, ipstring, sizeof(entry->info.cname));
+
+ // no, then reset the ping right away
+ entry->info.ping = -1;
+ // we also want to increase the serverlist_cachecount then
+ serverlist_cachecount++;
+ serverquerycount++;
+
+ entry->query = SQS_QUERYING;
+
+ return true;
+}
+