1
0
mirror of https://github.com/Mauler125/r5sdk.git synced 2025-02-09 19:15:03 +01:00

Only attempt to send RCON log if its not from the client

This commit is contained in:
Kawe Mazidjatari 2023-04-16 11:59:56 +02:00
parent a11012f3bf
commit 5f4b436ec6

@ -212,6 +212,17 @@ const char* GetContextNameByIndex(eDLL_T context, const bool ansiColor = false)
return contextName;
}
bool LoggedFromClient(eDLL_T context)
{
#ifndef DEDICATED
return (context == eDLL_T::CLIENT || context == eDLL_T::SCRIPT_CLIENT
|| context == eDLL_T::UI || context == eDLL_T::SCRIPT_UI
|| context == eDLL_T::NETCON);
#else
return false;
#endif // !DEDICATED
}
//-----------------------------------------------------------------------------
// Purpose: Show logs to all console interfaces (va_list version)
// Input : logType -
@ -364,8 +375,11 @@ void CoreMsgV(LogType_t logType, LogLevel_t logLevel, eDLL_T context,
if (bToConsole)
{
#ifndef CLIENT_DLL
RCONServer()->Send(formatted, pszUpTime, sv_rcon::response_t::SERVERDATA_RESPONSE_CONSOLE_LOG,
static_cast<int>(context), static_cast<int>(logType));
if (!LoggedFromClient(context))
{
RCONServer()->Send(formatted, pszUpTime, sv_rcon::response_t::SERVERDATA_RESPONSE_CONSOLE_LOG,
static_cast<int>(context), static_cast<int>(logType));
}
#endif // !CLIENT_DLL
#ifndef DEDICATED
g_ImGuiLogger->debug(message);