aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/logging.cpp
diff options
context:
space:
mode:
authorKawe Mazidjatari <48657826+Mauler125@users.noreply.github.com>2022-02-23 22:27:08 +0100
committerGitHub <noreply@github.com>2022-02-23 18:27:08 -0300
commit4f28a07d0562ca905bbcdb010b69604c330194bb (patch)
tree32ce0e8b0eff10cba6944a561e3538931a6033b6 /NorthstarDedicatedTest/logging.cpp
parent8c9f34283f8670dda98959d0785d682e6f652a93 (diff)
downloadNorthstarLauncher-4f28a07d0562ca905bbcdb010b69604c330194bb.tar.gz
NorthstarLauncher-4f28a07d0562ca905bbcdb010b69604c330194bb.zip
ConVar class rebuild (#90)
* Implement CCvar class with mapped out vtable funcs * Rebuilded ConVar class + code overhaul to use new system * ConVar class is now properly mapped out for r2 (0x80 in size). * Reimplemented and exposed all frequently used ConVar class methods to the SDK. * Implement frequently used CCvar class methods. * Implement all CCVarIteratorInternal class methods. * Performed additional cleanup over the SDK to use new system instead. * ConVar class improvements + rebuilded ConCommand struct * Fix actual struct size for ConCommand
Diffstat (limited to 'NorthstarDedicatedTest/logging.cpp')
-rw-r--r--NorthstarDedicatedTest/logging.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/NorthstarDedicatedTest/logging.cpp b/NorthstarDedicatedTest/logging.cpp
index ec46bedc..4d31981e 100644
--- a/NorthstarDedicatedTest/logging.cpp
+++ b/NorthstarDedicatedTest/logging.cpp
@@ -230,7 +230,7 @@ EngineSpewFuncType EngineSpewFunc;
void EngineSpewFuncHook(void* engineServer, SpewType_t type, const char* format, va_list args)
{
- if (!Cvar_spewlog_enable->m_nValue)
+ if (!Cvar_spewlog_enable->GetBool())
return;
const char* typeStr;
@@ -390,8 +390,7 @@ void InitialiseEngineSpewFuncHooks(HMODULE baseAddress)
hook, (char*)baseAddress + 0x1A1530, CClientState_ProcessPrint_Hook,
reinterpret_cast<LPVOID*>(&CClientState_ProcessPrint_Original));
- Cvar_spewlog_enable =
- RegisterConVar("spewlog_enable", "1", FCVAR_NONE, "Enables/disables whether the engine spewfunc should be logged");
+ Cvar_spewlog_enable = new ConVar("spewlog_enable", "1", FCVAR_NONE, "Enables/disables whether the engine spewfunc should be logged");
}
#include "bitbuf.h"
@@ -422,7 +421,7 @@ void TextMsgHook(BFRead* msg)
char text[256];
msg->ReadString(text, sizeof(text));
- if (!Cvar_cl_showtextmsg->m_nValue)
+ if (!Cvar_cl_showtextmsg->GetBool())
return;
switch (msg_dest)
@@ -451,5 +450,5 @@ void InitialiseClientPrintHooks(HMODULE baseAddress)
// "TextMsg" usermessage
ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x198710, TextMsgHook, reinterpret_cast<LPVOID*>(&TextMsg_Original));
- Cvar_cl_showtextmsg = RegisterConVar("cl_showtextmsg", "1", FCVAR_NONE, "Enable/disable text messages printing on the screen.");
+ Cvar_cl_showtextmsg = new ConVar("cl_showtextmsg", "1", FCVAR_NONE, "Enable/disable text messages printing on the screen.");
} \ No newline at end of file