aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/logging.cpp
diff options
context:
space:
mode:
authorAmos <48657826+Mauler125@users.noreply.github.com>2022-03-04 00:54:01 +0100
committerAmos <48657826+Mauler125@users.noreply.github.com>2022-03-04 00:54:01 +0100
commitbc7375807af20ad9bb07efa14ed538fce2f9ea00 (patch)
treef78cfa2738ff40ed4473454c34e8b71632c4253c /NorthstarDedicatedTest/logging.cpp
parentf108edc345d9709dbdc977578bf851b4b3aa0939 (diff)
downloadNorthstarLauncher-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.cpp20
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);