diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-24 23:35:28 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-24 23:35:28 +0000 |
commit | 53268da81402f37bd77aa5392bba5d2d66b66403 (patch) | |
tree | f64d52755c5d25902db4d2b7233223d6000aa03d /NorthstarDedicatedTest | |
parent | 88a2215c13b5af95584eb452cc3d6ed85ec14c44 (diff) | |
download | NorthstarLauncher-53268da81402f37bd77aa5392bba5d2d66b66403.tar.gz NorthstarLauncher-53268da81402f37bd77aa5392bba5d2d66b66403.zip |
sort servers and fix a formatting issue
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r-- | NorthstarDedicatedTest/masterserver.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/NorthstarDedicatedTest/masterserver.cpp b/NorthstarDedicatedTest/masterserver.cpp index 9e0e2486..e9cf043a 100644 --- a/NorthstarDedicatedTest/masterserver.cpp +++ b/NorthstarDedicatedTest/masterserver.cpp @@ -81,7 +81,7 @@ void MasterServerManager::AuthenticateOriginWithMasterServer(char* uid, char* or httplib::Client http(Cvar_ns_masterserver_hostname->m_pszString); http.set_connection_timeout(25); - spdlog::info("Trying to authenticate with northstar masterserver for user {} {}", uidStr); + spdlog::info("Trying to authenticate with northstar masterserver for user {}", uidStr); if (auto result = http.Get(fmt::format("/client/origin_auth?id={}&token={}", uidStr, tokenStr).c_str())) { @@ -242,6 +242,10 @@ void MasterServerManager::RequestServerList() spdlog::info("Server {} on map {} with playlist {} has {}/{} players", serverObj["name"].GetString(), serverObj["map"].GetString(), serverObj["playlist"].GetString(), serverObj["playerCount"].GetInt(), serverObj["maxPlayers"].GetInt()); } + + std::sort(m_remoteServers.begin(), m_remoteServers.end(), [](RemoteServerInfo& a, RemoteServerInfo& b) { + return a.playerCount > b.playerCount; + }); } else { |