From ba26be9bea801f219fa6340178fd6b13f02d574e Mon Sep 17 00:00:00 2001 From: BobTheBob9 Date: Thu, 15 Sep 2022 00:20:56 +0100 Subject: clang format, fix issues with server registration and rpak loading --- NorthstarDLL/logging.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'NorthstarDLL/logging.cpp') diff --git a/NorthstarDLL/logging.cpp b/NorthstarDLL/logging.cpp index 5bd5ae40..7c6d50a6 100644 --- a/NorthstarDLL/logging.cpp +++ b/NorthstarDLL/logging.cpp @@ -31,11 +31,12 @@ const std::unordered_map PrintSpewTypes = { {SpewType_t::SPEW_WARNING, "SPEW_WARNING"}, {SpewType_t::SPEW_ASSERT, "SPEW_ASSERT"}, {SpewType_t::SPEW_ERROR, "SPEW_ERROR"}, - {SpewType_t::SPEW_LOG, "SPEW_LOG"} -}; + {SpewType_t::SPEW_LOG, "SPEW_LOG"}}; +// clang-format off AUTOHOOK(EngineSpewFunc, engine.dll + 0x11CA80, -void,, (void* pEngineServer, SpewType_t type, const char* format, va_list args)) +void, __fastcall, (void* pEngineServer, SpewType_t type, const char* format, va_list args)) +// clang-format on { if (!Cvar_spewlog_enable->GetBool()) return; @@ -109,8 +110,10 @@ void,, (void* pEngineServer, SpewType_t type, const char* format, va_list args)) } // used for printing the output of status +// clang-format off AUTOHOOK(Status_ConMsg, engine.dll + 0x15ABD0, void,, (const char* text, ...)) +// clang-format on { char formatted[2048]; va_list list; @@ -126,8 +129,10 @@ void,, (const char* text, ...)) spdlog::info(formatted); } +// clang-format off AUTOHOOK(CClientState_ProcessPrint, engine.dll + 0x1A1530, bool,, (void* thisptr, uintptr_t msg)) +// clang-format on { char* text = *(char**)(msg + 0x20); @@ -163,8 +168,10 @@ enum class TextMsgPrintType_t HUD_PRINTCENTER }; +// clang-format off AUTOHOOK(TextMsg, client.dll + 0x198710, void,, (BFRead* msg)) +// clang-format on { TextMsgPrintType_t msg_dest = (TextMsgPrintType_t)msg->ReadByte(); @@ -194,8 +201,10 @@ void,, (BFRead* msg)) } } +// clang-format off AUTOHOOK(ConCommand_echo, engine.dll + 0x123680, void,, (const CCommand& arg)) +// clang-format on { if (arg.ArgC() >= 2) spdlog::info("[echo] {}", arg.ArgS()); @@ -231,7 +240,7 @@ void InitialiseLogging() // work regardless of these two lines // freopen("CONOUT$", "w", stdout); // freopen("CONOUT$", "w", stderr); - spdlog::default_logger()->set_pattern("[%H:%M:%S] [%^%l%$] %v"); + spdlog::default_logger()->set_pattern("[%H:%M:%S] [%l] %v"); } ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", EngineSpewFuncHooks, ConVar, (CModule module)) -- cgit v1.2.3