aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/dllmain.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-07-17 22:33:00 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-07-17 22:33:00 +0100
commitca5db71e8215a6c5660fe03088a6d7349f55f817 (patch)
tree534b79d2599475b1da3edb4f232223d9e32d3174 /NorthstarDedicatedTest/dllmain.cpp
parent51d3d4a40c8579e29571bc80d35bbb62fa50661b (diff)
downloadNorthstarLauncher-ca5db71e8215a6c5660fe03088a6d7349f55f817.tar.gz
NorthstarLauncher-ca5db71e8215a6c5660fe03088a6d7349f55f817.zip
add support for custom convars and concommands
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);