diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/cl_main.c | 45 | ||||
-rw-r--r-- | src/ui/ui_main.c | 19 |
2 files changed, 12 insertions, 52 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 5166804f..10bc313f 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -2453,7 +2453,7 @@ CL_ServersResponsePacket =================== */ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extended ) { - int i, j, count, total; + int i, count, total; netadr_t addresses[MAX_SERVERSPERPACKET]; int numservers; byte* buffptr; @@ -2570,18 +2570,6 @@ void CL_ServersResponsePacket( const netadr_t* from, msg_t *msg, qboolean extend // 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] ); Q_strncpyz( server->label, label, sizeof( server->label ) ); // advance to next slot @@ -4001,9 +3989,9 @@ void CL_GlobalServers_f( void ) { int count, i, masterNum; char command[1024], *masteraddress; - if ((count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > MAX_MASTER_SERVERS - 1) + if ((count = Cmd_Argc()) < 2 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > MAX_MASTER_SERVERS - 1) { - Com_Printf("usage: globalservers <master# 0-%d> <protocol> [keywords]\n", MAX_MASTER_SERVERS - 1); + Com_Printf("usage: globalservers <master# 0-%d> [keywords]\n", MAX_MASTER_SERVERS - 1); return; } @@ -4034,27 +4022,12 @@ void CL_GlobalServers_f( void ) { cls.numglobalservers = -1; cls.pingUpdateSource = AS_GLOBAL; - // Use the extended query for IPv6 masters - if (to.type == NA_IP6 || to.type == NA_MULTICAST6) - { - int v4enabled = Cvar_VariableIntegerValue("net_enabled") & NET_ENABLEV4; - - if(v4enabled) - { - Com_sprintf(command, sizeof(command), "getserversExt %s %s ipv6", - cl_gamename->string, Cmd_Argv(2)); - } - else - { - Com_sprintf(command, sizeof(command), "getserversExt %s %s", - cl_gamename->string, Cmd_Argv(2)); - } - - // TODO: test if we only have an IPv6 connection. If it's the case, - // request IPv6 servers only by appending " ipv6" to the command - } - else - Com_sprintf(command, sizeof(command), "getservers %s", Cmd_Argv(2)); + Com_sprintf( command, sizeof( command ), "getserversExt %s %d", + cl_gamename->string, PROTOCOL_VERSION ); + // TODO: test if we only have IPv4/IPv6, if so request only the relevant + // servers with getserversExt %s %d ipvX + // not that big a deal since the extra servers won't respond to getinfo + // anyway. for (i=3; i < count; i++) { diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index b776521e..b3482727 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -1080,7 +1080,6 @@ UI_StartServerRefresh */ static void UI_StartServerRefresh( qboolean full ) { - int i; char *ptr; int time; qtime_t q; @@ -1120,20 +1119,10 @@ static void UI_StartServerRefresh( qboolean full ) if( ui_netSource.integer == AS_GLOBAL || ui_netSource.integer == AS_MPLAYER ) { - if( ui_netSource.integer == AS_GLOBAL ) - i = 0; - else - i = 1; - - ptr = UI_Cvar_VariableString( "debug_protocol" ); + qboolean global = ui_netSource.integer == AS_GLOBAL; - if( strlen( ptr ) ) - trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d %s full empty\n", i, ptr ) ); - else - { - trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d %d full empty\n", i, - (int)trap_Cvar_VariableValue( "protocol" ) ) ); - } + trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d full empty\n", + global ? 0 : 1 ) ); } } @@ -4125,8 +4114,6 @@ void UI_Init( qboolean inGameLoad ) uiInfo.serverStatus.currentServerCinematic = -1; uiInfo.previewMovie = -1; - trap_Cvar_Register( NULL, "debug_protocol", "", 0 ); - UI_ParseResolutions( ); } |