Merge pull request #12710 from pchote/spectator-sort
Sort servers with spectators above empty servers.
This commit is contained in:
@@ -371,13 +371,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (g.State == (int)ServerState.WaitingPlayers && g.Players > 0)
|
if (g.State == (int)ServerState.WaitingPlayers && g.Players > 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
// Then servers with spectators
|
||||||
|
if (g.State == (int)ServerState.WaitingPlayers && g.Spectators > 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
// Then active games
|
// Then active games
|
||||||
if (g.State >= (int)ServerState.GameStarted)
|
if (g.State >= (int)ServerState.GameStarted)
|
||||||
return 1;
|
return 2;
|
||||||
|
|
||||||
// Empty servers are shown at the end because a flood of empty servers
|
// Empty servers are shown at the end because a flood of empty servers
|
||||||
// at the top of the game list make the community look dead
|
// at the top of the game list make the community look dead
|
||||||
return 2;
|
return 3;
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var loop in modGames.OrderBy(listOrder).ThenByDescending(g => g.Players))
|
foreach (var loop in modGames.OrderBy(listOrder).ThenByDescending(g => g.Players))
|
||||||
|
|||||||
Reference in New Issue
Block a user