Amos 8079e0ed4c Heavy cleanup for CHostState methods and signatures
* Add Cbuf_AddText and Cbuf_Execute signatures.
* Remove additional VGui stuff from dedicated statemachine.
* Move signatures to their respective headers.
* De-inline 'CHostState::FrameUpdate()'
* Ported al new patters to GAMEDLL_S1, CEngine still recreation needs extra work
2022-02-19 02:31:16 +01:00

42 lines
1.4 KiB
C++

//=====================================================================================//
//
// Purpose: Implementation of the pylon server backend.
//
// $NoKeywords: $
//=====================================================================================//
#include <core/stdafx.h>
#include <tier0/cvar.h>
#include <engine/host_state.h>
#include <engine/sys_utils.h>
#include <engine/net_chan.h>
#include <squirrel/sqinit.h>
#include <networksystem/r5net.h>
#include <networksystem/pylon.h>
//-----------------------------------------------------------------------------
// Purpose: Send keep alive request to Pylon Master Server.
// NOTE: When Pylon update reaches indev remove this and implement properly.
//-----------------------------------------------------------------------------
void KeepAliveToPylon()
{
if (g_pHostState->m_bActiveGame && sv_pylonvisibility->GetBool()) // Check for active game.
{
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(),
std::string(g_pHostState->m_levelName),
"",
g_pCVar->FindVar("hostport")->GetString(),
g_pCVar->FindVar("mp_gamemode")->GetString(),
false,
std::to_string(*g_nServerRemoteChecksum),
std::string(),
g_szNetKey.c_str()
}
);
}
}