aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/dllmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDedicatedTest/dllmain.cpp')
-rw-r--r--NorthstarDedicatedTest/dllmain.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/NorthstarDedicatedTest/dllmain.cpp b/NorthstarDedicatedTest/dllmain.cpp
index f71a39a8..405d3e82 100644
--- a/NorthstarDedicatedTest/dllmain.cpp
+++ b/NorthstarDedicatedTest/dllmain.cpp
@@ -4,8 +4,12 @@
#include "squirrel.h"
#include "dedicated.h"
#include "sourceconsole.h"
+#include "logging.h"
+#include "concommand.h"
#include <iostream>
+bool initialised = false;
+
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
@@ -20,25 +24,28 @@ BOOL APIENTRY DllMain( HMODULE hModule,
case DLL_PROCESS_DETACH:
break;
}
-
- InitialiseNorthstar();
+
+ if (!initialised)
+ InitialiseNorthstar();
+ initialised = true;
return TRUE;
}
-// this is called from the injector and initialises stuff, dllmain is called multiple times while this should only be called once
+// in the future this will be called from launcher instead of dllmain
void InitialiseNorthstar()
{
- AllocConsole();
- freopen("CONOUT$", "w", stdout);
- AddLoggingSink(DefaultLoggingSink);
-
- // apply hooks
+ InitialiseLogging();
+ // apply initial hooks
InstallInitialHooks();
+ InitialiseInterfaceCreationHooks();
if (IsDedicated())
AddDllLoadCallback("engine.dll", InitialiseDedicated);
+ AddDllLoadCallback("engine.dll", InitialiseConVars);
+ AddDllLoadCallback("engine.dll", InitialiseConCommands);
+
if (!IsDedicated())
{
AddDllLoadCallback("client.dll", InitialiseClientSquirrel);