diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-02 03:15:05 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-02 03:15:05 +0000 |
commit | 89d16c9a8a65e3b4872947c58df1ffd97fc63a4b (patch) | |
tree | 1252d9044c803dbe1f8b0330832497b394fdc90e | |
parent | 8d7e759d520915f897bec4b4542f128cc6ad95e5 (diff) | |
download | NorthstarLauncher-89d16c9a8a65e3b4872947c58df1ffd97fc63a4b.tar.gz NorthstarLauncher-89d16c9a8a65e3b4872947c58df1ffd97fc63a4b.zip |
add the ability to disable spewfunc logging
-rw-r--r-- | NorthstarDedicatedTest/dllmain.cpp | 4 | ||||
-rw-r--r-- | NorthstarDedicatedTest/logging.cpp | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/NorthstarDedicatedTest/dllmain.cpp b/NorthstarDedicatedTest/dllmain.cpp index 6acd4798..6ae24292 100644 --- a/NorthstarDedicatedTest/dllmain.cpp +++ b/NorthstarDedicatedTest/dllmain.cpp @@ -26,6 +26,7 @@ #include "miscclientfixes.h" #include "miscserverfixes.h" #include "rpakfilesystem.h" +#include "bansystem.h" #include "memalloc.h" bool initialised = false; @@ -85,7 +86,6 @@ void InitialiseNorthstar() AddDllLoadCallback("engine.dll", WaitForDebugger); AddDllLoadCallback("engine.dll", InitialiseEngineGameUtilFunctions); AddDllLoadCallback("server.dll", InitialiseServerGameUtilFunctions); - AddDllLoadCallback("engine.dll", InitialiseEngineSpewFuncHooks); // dedi patches { @@ -115,7 +115,9 @@ void InitialiseNorthstar() AddDllLoadCallback("client.dll", InitialiseMiscClientFixes); } + AddDllLoadCallback("engine.dll", InitialiseEngineSpewFuncHooks); AddDllLoadCallback("server.dll", InitialiseServerSquirrel); + AddDllLoadCallback("engine.dll", InitialiseBanSystem); AddDllLoadCallback("engine.dll", InitialiseServerAuthentication); AddDllLoadCallback("engine.dll", InitialiseSharedMasterServer); AddDllLoadCallback("server.dll", InitialiseMiscServerScriptCommand); diff --git a/NorthstarDedicatedTest/logging.cpp b/NorthstarDedicatedTest/logging.cpp index 7791299d..e13a9150 100644 --- a/NorthstarDedicatedTest/logging.cpp +++ b/NorthstarDedicatedTest/logging.cpp @@ -202,6 +202,8 @@ void InitialiseLogging() spdlog::default_logger()->sinks().push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>(stream.str(), false)); } +ConVar* Cvar_spewlog_enable; + enum SpewType_t { SPEW_MESSAGE = 0, @@ -217,6 +219,9 @@ EngineSpewFuncType EngineSpewFunc; void EngineSpewFuncHook(void* engineServer, SpewType_t type, const char* format, va_list args) { + if (!Cvar_spewlog_enable->m_nValue) + return; + const char* typeStr; switch (type) { @@ -326,4 +331,6 @@ void InitialiseEngineSpewFuncHooks(HMODULE baseAddress) { HookEnabler hook; ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x11CA80, EngineSpewFuncHook, reinterpret_cast<LPVOID*>(&EngineSpewFunc)); + + Cvar_spewlog_enable = RegisterConVar("spewlog_enable", "1", FCVAR_NONE, "Enables/disables whether the engine spewfunc should be logged"); }
\ No newline at end of file |