aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/logging.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-10 22:21:29 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-10 22:21:29 +0100
commit0a9a44ce15bb772b3193fbee481768e7327db1a9 (patch)
tree855b235161de35ade7d86ce2d847483aa46b31e4 /NorthstarDLL/logging.cpp
parent2ae34b67e36b8ba05132d481876eb4ed7a826283 (diff)
downloadNorthstarLauncher-0a9a44ce15bb772b3193fbee481768e7327db1a9.tar.gz
NorthstarLauncher-0a9a44ce15bb772b3193fbee481768e7327db1a9.zip
completely remove old hooking
Diffstat (limited to 'NorthstarDLL/logging.cpp')
-rw-r--r--NorthstarDLL/logging.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/NorthstarDLL/logging.cpp b/NorthstarDLL/logging.cpp
index ac22f58c..d1a4f5fd 100644
--- a/NorthstarDLL/logging.cpp
+++ b/NorthstarDLL/logging.cpp
@@ -2,7 +2,7 @@
#include "logging.h"
#include "convar.h"
#include "concommand.h"
-#include "configurables.h"
+#include "nsprefix.h"
#include "bitbuf.h"
#include "spdlog/sinks/basic_file_sink.h"
@@ -225,34 +225,25 @@ void InitialiseLogging()
{
AllocConsole();
- // don't redirect conout if already open
- /* FILE* pConoutFile = fopen("CONOUT$", "w");
- if (pConoutFile)
- {
- fclose(pConoutFile);
- freopen("CONOUT$", "w", stdout);
- freopen("CONOUT$", "w", stderr);
- }*/
-
- // Bind stdin to receive console input.
+ // Bind stdout to receive console output.
FILE* fp;
freopen_s(&fp, "CONOUT$", "w", stdout);
- freopen_s(&fp, "CONOUT$", "W", stderr);
+ _dup2(_fileno(stdout), _fileno(stderr));
spdlog::default_logger()->set_pattern("[%H:%M:%S] [%l] %v");
}
-ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", EngineSpewFuncHooks, ConCommand, [](HMODULE baseAddress)
+ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", EngineSpewFuncHooks, ConCommand, (HMODULE baseAddress))
{
AUTOHOOK_DISPATCH_MODULE(engine.dll)
Cvar_spewlog_enable = new ConVar("spewlog_enable", "1", FCVAR_NONE, "Enables/disables whether the engine spewfunc should be logged");
-})
+}
-ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientPrintHooks, ConVar, [](HMODULE baseAddress)
+ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientPrintHooks, ConVar, (HMODULE baseAddress))
{
AUTOHOOK_DISPATCH_MODULE(client.dll)
Cvar_cl_showtextmsg = new ConVar("cl_showtextmsg", "1", FCVAR_NONE, "Enable/disable text messages printing on the screen.");
pInternalCenterPrint = (ICenterPrint*)((char*)baseAddress + 0x216E940);
-}) \ No newline at end of file
+} \ No newline at end of file