From 6635ea88585693a3aa1aa4c6594c6ba738cb76d3 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sat, 25 Jun 2011 00:17:44 +0000 Subject: Fix ipv6 server query --- src/client/cl_main.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/client') diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 05406179..3907c685 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -4070,12 +4070,24 @@ void CL_GlobalServers_f( void ) { cls.numglobalservers = -1; cls.pingUpdateSource = AS_GLOBAL; - 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. + // 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", + cl_gamename->string, Cmd_Argv(2)); + } + else + { + Com_sprintf(command, sizeof(command), "getserversExt %s %s ipv6", + cl_gamename->string, Cmd_Argv(2)); + } + } + else + Com_sprintf(command, sizeof(command), "getservers %s", Cmd_Argv(2)); for (i=3; i < count; i++) { -- cgit