Server list changes
This commit is contained in:
parent
a3554662e3
commit
61d66e7998
@ -143,8 +143,9 @@ namespace server_list
|
|||||||
|
|
||||||
if (column == 2)
|
if (column == 2)
|
||||||
{
|
{
|
||||||
return utils::string::va("%d/%d [%d]", servers[i].clients, servers[index].max_clients,
|
const auto client_count = servers[i].clients - servers[i].bots;
|
||||||
servers[i].bots);
|
return utils::string::va("%d/%d [%d]", client_count, servers[i].max_clients,
|
||||||
|
servers[i].clients);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (column == 3)
|
if (column == 3)
|
||||||
@ -168,6 +169,11 @@ namespace server_list
|
|||||||
void sort_serverlist()
|
void sort_serverlist()
|
||||||
{
|
{
|
||||||
std::stable_sort(servers.begin(), servers.end(), [](const server_info& a, const server_info& b)
|
std::stable_sort(servers.begin(), servers.end(), [](const server_info& a, const server_info& b)
|
||||||
|
{
|
||||||
|
const auto a_players = a.clients - a.bots;
|
||||||
|
const auto b_players = b.clients - b.bots;
|
||||||
|
|
||||||
|
if (a_players == b_players)
|
||||||
{
|
{
|
||||||
if (a.clients == b.clients)
|
if (a.clients == b.clients)
|
||||||
{
|
{
|
||||||
@ -175,6 +181,9 @@ namespace server_list
|
|||||||
}
|
}
|
||||||
|
|
||||||
return a.clients > b.clients;
|
return a.clients > b.clients;
|
||||||
|
}
|
||||||
|
|
||||||
|
return a_players > b_players;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user