aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/logging.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-09-15 00:20:56 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-09-15 00:20:56 +0100
commitba26be9bea801f219fa6340178fd6b13f02d574e (patch)
treef50e67e06f7174daca0c97cf95659c7cbcef8151 /NorthstarDLL/logging.cpp
parentd2907aa522d56a4baacec1c17426f7d6f1fae3a2 (diff)
downloadNorthstarLauncher-ba26be9bea801f219fa6340178fd6b13f02d574e.tar.gz
NorthstarLauncher-ba26be9bea801f219fa6340178fd6b13f02d574e.zip
clang format, fix issues with server registration and rpak loading
Diffstat (limited to 'NorthstarDLL/logging.cpp')
-rw-r--r--NorthstarDLL/logging.cpp17
1 files changed, 13 insertions, 4 deletions
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<SpewType_t, const char*> 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))