Optimizations

This commit is contained in:
Kawe Mazidjatari 2022-03-26 01:19:02 +01:00
parent c3ad5f08fb
commit 66ec11079e
2 changed files with 9 additions and 4 deletions

View File

@ -171,10 +171,10 @@ FORCEINLINE void CHostState::Setup(void) const
//-----------------------------------------------------------------------------
FORCEINLINE void CHostState::Think(void) const
{
static bool bInitialized = false;
static CFastTimer banListTimer;
static CFastTimer pylonTimer;
static CFastTimer statsTimer;
static bool bInitialized = false;
static ConVar* hostname = g_pCVar->FindVar("hostname");
if (!bInitialized) // Initialize clocks.

View File

@ -22,16 +22,21 @@ void KeepAliveToPylon()
{
if (g_pHostState->m_bActiveGame && sv_pylonvisibility->GetBool()) // Check for active game.
{
static ConVar* hostname = g_pCVar->FindVar("hostname");
static ConVar* hostport = g_pCVar->FindVar("hostport");
static ConVar* mp_gamemode = g_pCVar->FindVar("mp_gamemode");
std::string m_szHostToken = std::string();
std::string m_szHostRequestMessage = std::string();
DevMsg(eDLL_T::SERVER, "Sending PostServerHost request\n");
bool result = g_pR5net->PostServerHost(m_szHostRequestMessage, m_szHostToken,
ServerListing{
g_pCVar->FindVar("hostname")->GetString(),
hostname->GetString(),
std::string(g_pHostState->m_levelName),
"",
g_pCVar->FindVar("hostport")->GetString(),
g_pCVar->FindVar("mp_gamemode")->GetString(),
hostport->GetString(),
mp_gamemode->GetString(),
false,
std::to_string(*g_nServerRemoteChecksum),
std::string(),