Skip to content

Commit

Permalink
Fix globalservers for Elite Force
Browse files Browse the repository at this point in the history
Vanilla Q3 UI doesn't list multiple master servers. ioquake3 changed
globalservers 0 to be all masters so they show in Q3 UI, moving single
masters from 0-4 to 1-5.

Vanilla Elite Force on the other hand, uses 0-4 for separate master
servers. So restore that behavior.
  • Loading branch information
zturtleman committed Sep 18, 2017
1 parent f4edc94 commit 2bcc90f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4318,13 +4318,24 @@ CL_GlobalServers_f
Originally master 0 was Internet and master 1 was MPlayer.
ioquake3 2008; added support for requesting five separate master servers using 0-4.
ioquake3 2017; made master 0 fetch all master servers and 1-5 request a single master server.
Elite Force requests five separate master servers using master 0-4.
==================
*/
void CL_GlobalServers_f( void ) {
netadr_t to;
int count, i, masterNum;
char command[1024], *masteraddress;

#ifdef ELITEFORCE
if ((count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum >= MAX_MASTER_SERVERS)
{
Com_Printf("usage: globalservers <master# 0-%d> <protocol> [keywords]\n", MAX_MASTER_SERVERS-1);
return;
}

sprintf(command, "sv_master%d", masterNum+1);
#else
if ((count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > MAX_MASTER_SERVERS)
{
Com_Printf("usage: globalservers <master# 0-%d> <protocol> [keywords]\n", MAX_MASTER_SERVERS);
Expand Down Expand Up @@ -4355,6 +4366,7 @@ void CL_GlobalServers_f( void ) {
}

sprintf(command, "sv_master%d", masterNum);
#endif
masteraddress = Cvar_VariableString(command);

if(!*masteraddress)
Expand Down

0 comments on commit 2bcc90f

Please sign in to comment.