2022-02-19 02:31:16 +01:00
|
|
|
//=====================================================================================//
|
|
|
|
//
|
|
|
|
// Purpose: Implementation of the pylon server backend.
|
|
|
|
//
|
|
|
|
// $NoKeywords: $
|
|
|
|
//=====================================================================================//
|
|
|
|
|
|
|
|
#include <core/stdafx.h>
|
2022-04-09 16:16:40 +02:00
|
|
|
#include <tier1/cvar.h>
|
2022-04-02 02:48:54 +02:00
|
|
|
#include <engine/net.h>
|
2022-02-19 02:31:16 +01:00
|
|
|
#include <engine/host_state.h>
|
|
|
|
#include <engine/sys_utils.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()
|
|
|
|
{
|
2022-05-12 19:39:55 +02:00
|
|
|
#ifndef CLIENT_DLL
|
2022-05-24 19:26:05 +02:00
|
|
|
if (g_pHostState->m_bActiveGame && sv_pylonVisibility->GetBool()) // Check for active game.
|
2022-02-19 02:31:16 +01:00
|
|
|
{
|
|
|
|
std::string m_szHostToken = std::string();
|
|
|
|
std::string m_szHostRequestMessage = std::string();
|
2022-03-26 01:19:02 +01:00
|
|
|
|
2022-02-19 02:31:16 +01:00
|
|
|
bool result = g_pR5net->PostServerHost(m_szHostRequestMessage, m_szHostToken,
|
|
|
|
ServerListing{
|
2022-03-26 01:19:02 +01:00
|
|
|
hostname->GetString(),
|
2022-02-19 02:31:16 +01:00
|
|
|
std::string(g_pHostState->m_levelName),
|
|
|
|
"",
|
2022-03-26 01:19:02 +01:00
|
|
|
hostport->GetString(),
|
|
|
|
mp_gamemode->GetString(),
|
2022-02-19 02:31:16 +01:00
|
|
|
false,
|
|
|
|
std::to_string(*g_nServerRemoteChecksum),
|
|
|
|
std::string(),
|
2022-05-27 02:24:34 +02:00
|
|
|
g_svNetKey.c_str()
|
2022-02-19 02:31:16 +01:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2022-05-12 19:39:55 +02:00
|
|
|
#endif // !CLIENT_DLL
|
2022-02-19 02:31:16 +01:00
|
|
|
}
|