aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/dedicated.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 21:22:43 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 21:22:43 +0000
commit3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee (patch)
tree5832fe2ee5f8e9334196e9f67cee93fb382ef1a7 /NorthstarDedicatedTest/dedicated.cpp
parentce9cb0134fefaa2bf5a3da0f9de15f013ab7dd27 (diff)
downloadNorthstarLauncher-3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee.tar.gz
NorthstarLauncher-3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee.zip
small dedi changes
Diffstat (limited to 'NorthstarDedicatedTest/dedicated.cpp')
-rw-r--r--NorthstarDedicatedTest/dedicated.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/NorthstarDedicatedTest/dedicated.cpp b/NorthstarDedicatedTest/dedicated.cpp
index b6db8583..cebcd8ad 100644
--- a/NorthstarDedicatedTest/dedicated.cpp
+++ b/NorthstarDedicatedTest/dedicated.cpp
@@ -59,7 +59,11 @@ void RunServer(CDedicatedExports* dedicated)
g_pEngine->Frame();
// this way of getting playercount/maxplayers honestly really sucks, but not got any other methods of doing it rn
- SetConsoleTitleA(fmt::format("Titanfall 2 dedicated server - {} {}/{} players", g_pHostState->m_levelName, g_ServerAuthenticationManager->m_additionalPlayerData.size(), GetCurrentPlaylistVar("max_players", false)).c_str());
+ const char* maxPlayers = GetCurrentPlaylistVar("max_players", false);
+ if (!maxPlayers)
+ maxPlayers = "6";
+
+ SetConsoleTitleA(fmt::format("Titanfall 2 dedicated server - {} {}/{} players", g_pHostState->m_levelName, g_ServerAuthenticationManager->m_additionalPlayerData.size(), maxPlayers).c_str());
Sleep(50);
}
}