Flip 'sv_rcon_sendlogs' if netcon is not input only

This commit is contained in:
Kawe Mazidjatari 2023-08-05 01:11:32 +02:00
parent 5e4ea7d25a
commit 759d8d6d2e
2 changed files with 11 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}