From 759d8d6d2e183f615dd5925a641734f336628e8b Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 5 Aug 2023 01:11:32 +0200 Subject: [PATCH] Flip 'sv_rcon_sendlogs' if netcon is not input only --- r5dev/common/global.cpp | 2 +- r5dev/engine/server/sv_rcon.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/r5dev/common/global.cpp b/r5dev/common/global.cpp index 5a64de03..6c5770b9 100644 --- a/r5dev/common/global.cpp +++ b/r5dev/common/global.cpp @@ -322,7 +322,7 @@ void ConVar_StaticInit(void) sv_simulateBots = ConVar::StaticCreate("sv_simulateBots", "1", FCVAR_RELEASE, "Simulate user commands for bots on the server.", true, 0.f, false, 0.f, nullptr, nullptr); sv_rcon_debug = ConVar::StaticCreate("sv_rcon_debug" , "0" , FCVAR_RELEASE, "Show rcon debug information ( !slower! ).", false, 0.f, false, 0.f, nullptr, nullptr); - sv_rcon_sendlogs = ConVar::StaticCreate("sv_rcon_sendlogs" , "1" , FCVAR_RELEASE, "Network console logs to connected and authenticated sockets.", false, 0.f, false, 0.f, nullptr, nullptr); + sv_rcon_sendlogs = ConVar::StaticCreate("sv_rcon_sendlogs" , "0" , FCVAR_RELEASE, "Network console logs to connected and authenticated sockets.", false, 0.f, false, 0.f, nullptr, nullptr); sv_rcon_banpenalty = ConVar::StaticCreate("sv_rcon_banpenalty" , "10", FCVAR_RELEASE, "Number of minutes to ban users who fail rcon authentication.", false, 0.f, false, 0.f, nullptr, nullptr); sv_rcon_maxfailures = ConVar::StaticCreate("sv_rcon_maxfailures", "10", FCVAR_RELEASE, "Max number of times an user can fail rcon authentication before being banned.", true, 1.f, false, 0.f, nullptr, nullptr); sv_rcon_maxignores = ConVar::StaticCreate("sv_rcon_maxignores" , "15", FCVAR_RELEASE, "Max number of times an user can ignore the instruction message before being banned.", true, 1.f, false, 0.f, nullptr, nullptr); diff --git a/r5dev/engine/server/sv_rcon.cpp b/r5dev/engine/server/sv_rcon.cpp index 25a63cb9..321a2921 100644 --- a/r5dev/engine/server/sv_rcon.cpp +++ b/r5dev/engine/server/sv_rcon.cpp @@ -426,8 +426,16 @@ bool CRConServer::ProcessMessage(const char* pMsgBuf, const int nMsgLen) { if (data.m_bAuthorized) { - // "0" means the netconsole is input only. - data.m_bInputOnly = !atoi(request.requestval().c_str()); + // request value "0" means the netconsole is input only. + const bool bWantLog = atoi(request.requestval().c_str()) != NULL; + + data.m_bInputOnly = !bWantLog; + if (bWantLog && !sv_rcon_sendlogs->GetBool()) + { + // Toggle it on since there's at least 1 netconsole that + // wants to receive logs. + sv_rcon_sendlogs->SetValue(bWantLog); + } } break; }