mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 06:31:47 +00:00
Fix filtering favorite servers in Team Arena UI
Filter favorite servers based on cached server info and new info instead of only the cached info. If cached server info is filtered out, don't add it to server list but wait for getinfo response before marking server as invisible.
This commit is contained in:
parent
0b853a659a
commit
6b5674e6bb
1 changed files with 18 additions and 8 deletions
|
@ -3781,6 +3781,12 @@ static void UI_BuildServerDisplayList(int force) {
|
|||
// get the ping for this server
|
||||
ping = trap_LAN_GetServerPing(lanSource, i);
|
||||
if (ping > 0 || ui_netSource.integer == UIAS_FAVORITES) {
|
||||
// Remove favorite servers so they do not appear multiple times
|
||||
// or appear when the cached server info was not filtered out
|
||||
// but the new server info is filtered out.
|
||||
if (ui_netSource.integer == UIAS_FAVORITES) {
|
||||
UI_RemoveServerFromDisplayList(i);
|
||||
}
|
||||
|
||||
trap_LAN_GetServerInfo(lanSource, i, info, MAX_STRING_CHARS);
|
||||
|
||||
|
@ -3789,7 +3795,9 @@ static void UI_BuildServerDisplayList(int force) {
|
|||
|
||||
if (ui_browserShowEmpty.integer == 0) {
|
||||
if (clients == 0) {
|
||||
trap_LAN_MarkServerVisible(lanSource, i, qfalse);
|
||||
if (ping > 0) {
|
||||
trap_LAN_MarkServerVisible(lanSource, i, qfalse);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -3797,7 +3805,9 @@ static void UI_BuildServerDisplayList(int force) {
|
|||
if (ui_browserShowFull.integer == 0) {
|
||||
maxClients = atoi(Info_ValueForKey(info, "sv_maxclients"));
|
||||
if (clients == maxClients) {
|
||||
trap_LAN_MarkServerVisible(lanSource, i, qfalse);
|
||||
if (ping > 0) {
|
||||
trap_LAN_MarkServerVisible(lanSource, i, qfalse);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -3805,21 +3815,21 @@ static void UI_BuildServerDisplayList(int force) {
|
|||
if (uiInfo.joinGameTypes[ui_joinGameType.integer].gtEnum != -1) {
|
||||
game = atoi(Info_ValueForKey(info, "gametype"));
|
||||
if (game != uiInfo.joinGameTypes[ui_joinGameType.integer].gtEnum) {
|
||||
trap_LAN_MarkServerVisible(lanSource, i, qfalse);
|
||||
if (ping > 0) {
|
||||
trap_LAN_MarkServerVisible(lanSource, i, qfalse);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ui_serverFilterType.integer > 0) {
|
||||
if (Q_stricmp(Info_ValueForKey(info, "game"), serverFilters[ui_serverFilterType.integer].basedir) != 0) {
|
||||
trap_LAN_MarkServerVisible(lanSource, i, qfalse);
|
||||
if (ping > 0) {
|
||||
trap_LAN_MarkServerVisible(lanSource, i, qfalse);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// make sure we never add a favorite server twice
|
||||
if (ui_netSource.integer == UIAS_FAVORITES) {
|
||||
UI_RemoveServerFromDisplayList(i);
|
||||
}
|
||||
// insert the server into the list
|
||||
UI_BinaryServerInsertion(i);
|
||||
// done with this server
|
||||
|
|
Loading…
Reference in a new issue