mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Added indev Pylon(MasterServer) broadcasting to dedi. Read description for further information.
Dedicated RemoteFunctionCallsChecksum needs fixing because its currently always null. Hidden needs to be implemented. I wouldn't say its needed currently till the Pylon re-write hits indev branch.
This commit is contained in:
parent
58fe36911b
commit
0228f59062
@ -4,6 +4,35 @@
|
||||
#include "engine/net_chan.h"
|
||||
#include "tier0/cvar.h"
|
||||
#include "client/IVEngineClient.h"
|
||||
#include "networksystem/r5net.h"
|
||||
#include "squirrel/sqinit.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->m_iValue == 1) // Check for active game.
|
||||
{
|
||||
std::string m_szHostToken = std::string();
|
||||
std::string m_szHostRequestMessage = std::string();
|
||||
DevMsg(eDLL_T::CLIENT, "Sending PostServerHost request\n");
|
||||
bool result = g_pR5net->PostServerHost(m_szHostRequestMessage, m_szHostToken,
|
||||
ServerListing{
|
||||
g_pCvar->FindVar("hostname")->m_pzsCurrentValue,
|
||||
std::string(g_pHostState->m_levelName),
|
||||
"",
|
||||
g_pCvar->FindVar("hostport")->m_pzsCurrentValue,
|
||||
g_pCvar->FindVar("mp_gamemode")->m_pzsCurrentValue,
|
||||
false,
|
||||
std::to_string(*g_nRemoteFunctionCallsChecksum), // BUG BUG: Checksum is null on dedi
|
||||
std::string(),
|
||||
g_szNetKey.c_str()
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: state machine's main processing loop
|
||||
@ -48,6 +77,15 @@ void HCHostState_FrameUpdate(void* rcx, void* rdx, float time)
|
||||
ConCommandBase* disconnect = (ConCommandBase*)g_pCvar->FindCommand("disconnect");
|
||||
disconnect->AddFlags(FCVAR_SERVER_CAN_EXECUTE); // Make sure server is not restricted to this.
|
||||
|
||||
static std::thread PylonThread([]() // Pylon request thread.
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
KeepAliveToPylon();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
|
||||
}
|
||||
});
|
||||
|
||||
if (net_userandomkey->m_pParent->m_iValue == 1)
|
||||
{
|
||||
HNET_GenerateKey();
|
||||
|
@ -101,7 +101,8 @@ void IConVar_InitConVar()
|
||||
cm_return_false_cmdquery_cheats = IConVar_RegisterConVar("cm_return_false_cmdquery_cheats", "0", FCVAR_RELEASE, "Returns false on all FCVAR_DEVELOPMENTONLY and FCVAR_CHEAT ConVar/ConCommand queries ( !warning! ).", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
//-------------------------------------------------------------------------
|
||||
// SERVER |
|
||||
sv_showconnecting = IConVar_RegisterConVar("sv_showconnecting", "1", FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT, "Logs information about the connecting client to the console.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
sv_showconnecting = IConVar_RegisterConVar("sv_showconnecting", "1", FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT, "Logs information about the connecting client to the console.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
sv_pylonvisibility = IConVar_RegisterConVar("sv_pylonvisibility", "0", FCVAR_RELEASE, "Determines the visiblity to the Pylon Master Server, 0 = Not visible, 1 = Visible, 2 = Hidden BUG BUG: not implemented yet.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
//-------------------------------------------------------------------------
|
||||
// CLIENT |
|
||||
cl_drawconsoleoverlay = IConVar_RegisterConVar("cl_drawconsoleoverlay", "1", FCVAR_RELEASE, "Draw the console overlay at the top of the screen.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
|
@ -52,6 +52,34 @@
|
||||
#define FCVAR_SERVER_CANNOT_QUERY (1<<29) // If this is set, then the server is not allowed to query this cvar's value (via IServerPluginHelpers::StartQueryCvarValue).
|
||||
#define FCVAR_CLIENTCMD_CAN_EXECUTE (1<<30) // IVEngineClient::ClientCmd is allowed to execute this command.
|
||||
|
||||
/*
|
||||
class ConVar : ConCommandBase, IConVar; [MI] (#classinformer)
|
||||
dq offset ? ? _R4ConVar@@6B@; const ConVar::`RTTI Complete Object Locator'
|
||||
|
||||
dq offset ??_G__ExceptionPtr@@QEAAPEAXI@Z_0; 0 Index
|
||||
dq offset sub_1401F9930
|
||||
dq offset loc_14046FE90
|
||||
dq offset ConVar__AddFlags
|
||||
dq offset ConVar__RemoveFlags
|
||||
dq offset sub_14046FEA0
|
||||
dq offset loc_14046FF70
|
||||
dq offset ConVar__GetHelpString
|
||||
dq offset sub_14046FEC0
|
||||
dq offset sub_14046FEE0
|
||||
dq offset ConVar__IsRegistered
|
||||
dq offset ConVar__GetDllIdentifier
|
||||
dq offset sub_14046F3F0
|
||||
dq offset sub_14046F470
|
||||
dq offset ConVar__InternalSetFloatValue; The one below also does something similar
|
||||
dq offset sub_140470340
|
||||
dq offset sub_140470420; Seems to be InternalSetInt below maybe ?
|
||||
dq offset sub_140470510
|
||||
dq offset nullsub
|
||||
dq offset sub_140470300
|
||||
dq offset sub_1404701A0
|
||||
dq offset RegisterConVar; #STR: "Convar '%s' is flagged as both FCVAR_ARCHIVE and FCVAR_ARC
|
||||
*/
|
||||
|
||||
class ConVar
|
||||
{
|
||||
public:
|
||||
|
@ -11,6 +11,7 @@ ConVar* cm_return_false_cmdquery_cheats = new ConVar();
|
||||
//-------------------------------------------------------------------------
|
||||
// SERVER |
|
||||
ConVar* sv_showconnecting = new ConVar();
|
||||
ConVar* sv_pylonvisibility = new ConVar();
|
||||
//-------------------------------------------------------------------------
|
||||
// CLIENT |
|
||||
ConVar* cl_drawconsoleoverlay = new ConVar();
|
||||
|
@ -22,6 +22,7 @@ extern ConVar* cm_return_false_cmdquery_cheats;
|
||||
//-------------------------------------------------------------------------
|
||||
// SERVER |
|
||||
extern ConVar* sv_showconnecting;
|
||||
extern ConVar* sv_pylonvisibility;
|
||||
//-------------------------------------------------------------------------
|
||||
// CLIENT |
|
||||
extern ConVar* cl_drawconsoleoverlay;
|
||||
|
Loading…
x
Reference in New Issue
Block a user