aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/serverpresence.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-09-15 00:20:56 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-09-15 00:20:56 +0100
commitba26be9bea801f219fa6340178fd6b13f02d574e (patch)
treef50e67e06f7174daca0c97cf95659c7cbcef8151 /NorthstarDLL/serverpresence.cpp
parentd2907aa522d56a4baacec1c17426f7d6f1fae3a2 (diff)
downloadNorthstarLauncher-ba26be9bea801f219fa6340178fd6b13f02d574e.tar.gz
NorthstarLauncher-ba26be9bea801f219fa6340178fd6b13f02d574e.zip
clang format, fix issues with server registration and rpak loading
Diffstat (limited to 'NorthstarDLL/serverpresence.cpp')
-rw-r--r--NorthstarDLL/serverpresence.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/NorthstarDLL/serverpresence.cpp b/NorthstarDLL/serverpresence.cpp
index 9338cd9c..9b7b0f1a 100644
--- a/NorthstarDLL/serverpresence.cpp
+++ b/NorthstarDLL/serverpresence.cpp
@@ -74,6 +74,7 @@ std::string UnescapeUnicode(const std::string& str)
ServerPresenceManager::ServerPresenceManager()
{
+ // clang-format off
// register convars
Cvar_ns_server_presence_update_rate = new ConVar(
"ns_server_presence_update_rate", "5000", FCVAR_GAMEDLL, "How often we update our server's presence on server lists in ms");
@@ -95,6 +96,7 @@ ServerPresenceManager::ServerPresenceManager()
Cvar_ns_report_server_to_masterserver = new ConVar("ns_report_server_to_masterserver", "1", FCVAR_GAMEDLL, "Whether we should report this server to the masterserver");
Cvar_ns_report_sp_server_to_masterserver = new ConVar("ns_report_sp_server_to_masterserver", "0", FCVAR_GAMEDLL, "Whether we should report this server to the masterserver, when started in singleplayer");
+ // clang-format on
}
void ServerPresenceManager::AddPresenceReporter(ServerPresenceReporter* reporter)
@@ -132,7 +134,7 @@ void ServerPresenceManager::DestroyPresence()
void ServerPresenceManager::RunFrame(double flCurrentTime)
{
- if (!m_bHasPresence && Cvar_ns_report_server_to_masterserver->GetBool()) // don't run until we actually have server presence
+ if (!m_bHasPresence || !Cvar_ns_report_server_to_masterserver->GetBool()) // don't run until we actually have server presence
return;
// don't run if we're sp and don't want to report sp
@@ -202,7 +204,11 @@ void ServerPresenceManager::SetMap(const char* pMapName, bool isInitialising)
void ServerPresenceManager::SetPlaylist(const char* pPlaylistName)
{
// update playlist
- strncpy_s(m_ServerPresence.m_PlaylistName, sizeof(m_ServerPresence.m_PlaylistName), pPlaylistName, sizeof(m_ServerPresence.m_PlaylistName) - 1);
+ strncpy_s(
+ m_ServerPresence.m_PlaylistName,
+ sizeof(m_ServerPresence.m_PlaylistName),
+ pPlaylistName,
+ sizeof(m_ServerPresence.m_PlaylistName) - 1);
// update maxplayers
const char* pMaxPlayers = R2::GetCurrentPlaylistVar("max_players", true);