diff options
author | Amos <48657826+Mauler125@users.noreply.github.com> | 2022-03-04 00:54:01 +0100 |
---|---|---|
committer | Amos <48657826+Mauler125@users.noreply.github.com> | 2022-03-04 00:54:01 +0100 |
commit | bc7375807af20ad9bb07efa14ed538fce2f9ea00 (patch) | |
tree | f78cfa2738ff40ed4473454c34e8b71632c4253c /NorthstarDedicatedTest/logging.cpp | |
parent | f108edc345d9709dbdc977578bf851b4b3aa0939 (diff) | |
download | NorthstarLauncher-bc7375807af20ad9bb07efa14ed538fce2f9ea00.tar.gz NorthstarLauncher-bc7375807af20ad9bb07efa14ed538fce2f9ea00.zip |
RCON implementation
* Full CNetAdr rewrite (protocol agnostic)
* Full CSocketCreator class rebuild (based on Valve's implementation)
* RCON implementation on server and client
* Misc cleanup
Diffstat (limited to 'NorthstarDedicatedTest/logging.cpp')
-rw-r--r-- | NorthstarDedicatedTest/logging.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/logging.cpp b/NorthstarDedicatedTest/logging.cpp index 4d31981e..96ccac21 100644 --- a/NorthstarDedicatedTest/logging.cpp +++ b/NorthstarDedicatedTest/logging.cpp @@ -10,6 +10,8 @@ #include <Psapi.h> #include <minidumpapiset.h> #include "configurables.h" +#include "rcon_shared.h" +#include "sv_rcon.h" // This needs to be called after hooks are loaded so we can access the command line args void CreateLogFiles() @@ -340,6 +342,16 @@ void EngineSpewFuncHook(void* engineServer, SpewType_t type, const char* format, formatted[endpos - 1] = '\0'; // cut off repeated newline spdlog::info("[SERVER {}] {}", typeStr, formatted); + + if (IsDedicated()) + { + if (CVar_sv_rcon_sendlogs->GetBool()) + { + char sendbuf[2048]{}; + snprintf(sendbuf, sizeof(sendbuf), "[SERVER %s] %s", typeStr, formatted); + g_pRConServer->Send(sendbuf); + } + } } typedef void (*Status_ConMsg_Type)(const char* text, ...); @@ -359,6 +371,14 @@ void Status_ConMsg_Hook(const char* text, ...) formatted[endpos - 1] = '\0'; // cut off repeated newline spdlog::info(formatted); + + if (IsDedicated()) + { + if (CVar_sv_rcon_sendlogs->GetBool()) + { + g_pRConServer->Send(formatted); + } + } } typedef bool (*CClientState_ProcessPrint_Type)(__int64 thisptr, __int64 msg); |