diff options
author | Thilo Schulz <arny@ats.s.bawue.de> | 2011-06-25 00:17:44 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-10 21:52:53 +0000 |
commit | 6635ea88585693a3aa1aa4c6594c6ba738cb76d3 (patch) | |
tree | b5487c3c28d6937e937821b739c9e1f2b6abe2d9 | |
parent | c3e744cb77eedbf0e27514a01845491b68b6d887 (diff) |
Fix ipv6 server query
-rw-r--r-- | src/client/cl_main.c | 24 |
1 files changed, 18 insertions, 6 deletions
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++) { |