mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-27 22:42:09 +00:00
Fixed viewing sv_master[3-5] in q3_ui server browser (don't give engine fake sources).
This commit is contained in:
parent
85ae08e800
commit
f220db0e08
1 changed files with 27 additions and 11 deletions
|
@ -333,6 +333,28 @@ static int QDECL ArenaServers_Compare( const void *arg1, const void *arg2 ) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=================
|
||||||
|
ArenaServers_SourceForLAN
|
||||||
|
|
||||||
|
Convert ui's g_servertype to AS_* used by trap calls.
|
||||||
|
=================
|
||||||
|
*/
|
||||||
|
int ArenaServers_SourceForLAN(void) {
|
||||||
|
switch( g_servertype ) {
|
||||||
|
default:
|
||||||
|
case UIAS_LOCAL:
|
||||||
|
return AS_LOCAL;
|
||||||
|
case UIAS_GLOBAL1:
|
||||||
|
case UIAS_GLOBAL2:
|
||||||
|
case UIAS_GLOBAL3:
|
||||||
|
case UIAS_GLOBAL4:
|
||||||
|
case UIAS_GLOBAL5:
|
||||||
|
return AS_GLOBAL;
|
||||||
|
case UIAS_FAVORITES:
|
||||||
|
return AS_FAVORITES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
|
@ -853,11 +875,11 @@ static void ArenaServers_DoRefresh( void )
|
||||||
{
|
{
|
||||||
if (g_servertype != UIAS_FAVORITES) {
|
if (g_servertype != UIAS_FAVORITES) {
|
||||||
if (g_servertype == UIAS_LOCAL) {
|
if (g_servertype == UIAS_LOCAL) {
|
||||||
if (!trap_LAN_GetServerCount(g_servertype)) {
|
if (!trap_LAN_GetServerCount(AS_LOCAL)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (trap_LAN_GetServerCount(g_servertype) < 0) {
|
if (trap_LAN_GetServerCount(ArenaServers_SourceForLAN()) < 0) {
|
||||||
// still waiting for response
|
// still waiting for response
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -929,7 +951,7 @@ static void ArenaServers_DoRefresh( void )
|
||||||
if (g_servertype == UIAS_FAVORITES) {
|
if (g_servertype == UIAS_FAVORITES) {
|
||||||
g_arenaservers.numqueriedservers = g_arenaservers.numfavoriteaddresses;
|
g_arenaservers.numqueriedservers = g_arenaservers.numfavoriteaddresses;
|
||||||
} else {
|
} else {
|
||||||
g_arenaservers.numqueriedservers = trap_LAN_GetServerCount(g_servertype);
|
g_arenaservers.numqueriedservers = trap_LAN_GetServerCount(ArenaServers_SourceForLAN());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (g_arenaservers.numqueriedservers > g_arenaservers.maxservers)
|
// if (g_arenaservers.numqueriedservers > g_arenaservers.maxservers)
|
||||||
|
@ -959,7 +981,7 @@ static void ArenaServers_DoRefresh( void )
|
||||||
if (g_servertype == UIAS_FAVORITES) {
|
if (g_servertype == UIAS_FAVORITES) {
|
||||||
strcpy( adrstr, g_arenaservers.favoriteaddresses[g_arenaservers.currentping] );
|
strcpy( adrstr, g_arenaservers.favoriteaddresses[g_arenaservers.currentping] );
|
||||||
} else {
|
} else {
|
||||||
trap_LAN_GetServerAddressString(g_servertype, g_arenaservers.currentping, adrstr, MAX_ADDRESSLENGTH );
|
trap_LAN_GetServerAddressString(ArenaServers_SourceForLAN(), g_arenaservers.currentping, adrstr, MAX_ADDRESSLENGTH );
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy( g_arenaservers.pinglist[j].adrstr, adrstr );
|
strcpy( g_arenaservers.pinglist[j].adrstr, adrstr );
|
||||||
|
@ -1333,7 +1355,6 @@ ArenaServers_MenuInit
|
||||||
static void ArenaServers_MenuInit( void ) {
|
static void ArenaServers_MenuInit( void ) {
|
||||||
int i;
|
int i;
|
||||||
int y;
|
int y;
|
||||||
int value;
|
|
||||||
static char statusbuffer[MAX_STATUSLENGTH];
|
static char statusbuffer[MAX_STATUSLENGTH];
|
||||||
|
|
||||||
// zero set all our globals
|
// zero set all our globals
|
||||||
|
@ -1581,12 +1602,7 @@ static void ArenaServers_MenuInit( void ) {
|
||||||
|
|
||||||
ArenaServers_LoadFavorites();
|
ArenaServers_LoadFavorites();
|
||||||
|
|
||||||
g_servertype = Com_Clamp( 0, 3, ui_browserMaster.integer );
|
g_arenaservers.master.curvalue = g_servertype = Com_Clamp( 0, 6, ui_browserMaster.integer );
|
||||||
// hack to get rid of MPlayer stuff
|
|
||||||
value = g_servertype;
|
|
||||||
if (value >= 1)
|
|
||||||
value--;
|
|
||||||
g_arenaservers.master.curvalue = value;
|
|
||||||
|
|
||||||
g_gametype = Com_Clamp( 0, 4, ui_browserGameType.integer );
|
g_gametype = Com_Clamp( 0, 4, ui_browserGameType.integer );
|
||||||
g_arenaservers.gametype.curvalue = g_gametype;
|
g_arenaservers.gametype.curvalue = g_gametype;
|
||||||
|
|
Loading…
Reference in a new issue