mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Reboot RCON server if 'net_usesocketsforloopback' changed
Reboot so it could update accordingly, just like the game's UDP sockets.
This commit is contained in:
parent
f97cf6c249
commit
c6748edcc9
@ -551,6 +551,7 @@ void ConVar::InitShipped(void)
|
||||
mp_gamemode->RemoveFlags(FCVAR_DEVELOPMENTONLY);
|
||||
mp_gamemode->RemoveChangeCallback(mp_gamemode->m_fnChangeCallbacks[0]);
|
||||
mp_gamemode->InstallChangeCallback(MP_GameMode_Changed_f, false);
|
||||
net_usesocketsforloopback->InstallChangeCallback(NET_UseSocketsForLoopbackChanged_f, false);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -736,6 +736,33 @@ void NET_UseRandomKeyChanged_f(IConVar* pConVar, const char* pOldString, float f
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=====================
|
||||
NET_UseSocketsForLoopbackChanged_f
|
||||
|
||||
Use random AES encryption
|
||||
key for game packets
|
||||
=====================
|
||||
*/
|
||||
void NET_UseSocketsForLoopbackChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue)
|
||||
{
|
||||
if (ConVar* pConVarRef = g_pCVar->FindVar(pConVar->GetCommandName()))
|
||||
{
|
||||
if (strcmp(pOldString, pConVarRef->GetString()) == NULL)
|
||||
return; // Same value.
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
// Reboot the RCON server to switch address type.
|
||||
if (RCONServer()->IsInitialized())
|
||||
{
|
||||
DevMsg(eDLL_T::SERVER, "Rebooting RCON server...\n");
|
||||
RCONServer()->Shutdown();
|
||||
RCONServer()->Init();
|
||||
}
|
||||
#endif // !CLIENT_DLL
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=====================
|
||||
SIG_GetAdr_f
|
||||
|
@ -39,6 +39,7 @@ void VPK_Unmount_f(const CCommand& args);
|
||||
void NET_SetKey_f(const CCommand& args);
|
||||
void NET_GenerateKey_f(const CCommand& args);
|
||||
void NET_UseRandomKeyChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
||||
void NET_UseSocketsForLoopbackChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
||||
void SIG_GetAdr_f(const CCommand& args);
|
||||
void CON_Help_f(const CCommand& args);
|
||||
#ifndef DEDICATED
|
||||
|
Loading…
x
Reference in New Issue
Block a user