aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/dedicated.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-03-18 09:37:03 +0000
committerGitHub <noreply@github.com>2022-03-18 09:37:03 +0000
commit92f77b231ac324cc1326bef31251fc6b86df1f3b (patch)
tree1d5a2843af2db31305a96c194e8b21280dccd340 /NorthstarDedicatedTest/dedicated.cpp
parent50e69bde548c5a1af3385f0eff6aa14c088c21c5 (diff)
downloadNorthstarLauncher-92f77b231ac324cc1326bef31251fc6b86df1f3b.tar.gz
NorthstarLauncher-92f77b231ac324cc1326bef31251fc6b86df1f3b.zip
refactor dll load callbacks to lower number of dedicated.h includes (#109)
Diffstat (limited to 'NorthstarDedicatedTest/dedicated.cpp')
-rw-r--r--NorthstarDedicatedTest/dedicated.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/NorthstarDedicatedTest/dedicated.cpp b/NorthstarDedicatedTest/dedicated.cpp
index 52d3802d..9372b7a5 100644
--- a/NorthstarDedicatedTest/dedicated.cpp
+++ b/NorthstarDedicatedTest/dedicated.cpp
@@ -4,6 +4,7 @@
#include "gameutils.h"
#include "serverauthentication.h"
#include "masterserver.h"
+
bool IsDedicated()
{
// return CommandLine()->CheckParm("-dedicated");
@@ -118,9 +119,6 @@ DWORD WINAPI ConsoleInputThread(PVOID pThreadParameter)
void InitialiseDedicated(HMODULE engineAddress)
{
- if (!IsDedicated())
- return;
-
spdlog::info("InitialiseDedicated");
{
@@ -417,6 +415,7 @@ void InitialiseDedicated(HMODULE engineAddress)
CommandLine()->AppendParm("-nomenuvid", 0);
CommandLine()->AppendParm("-nosound", 0);
CommandLine()->AppendParm("-windowed", 0);
+ CommandLine()->AppendParm("-nomessagebox", 0);
CommandLine()->AppendParm("+host_preload_shaders", "0");
CommandLine()->AppendParm("+net_usesocketsforloopback", "1");
@@ -455,9 +454,6 @@ void InitialiseDedicatedOrigin(HMODULE baseAddress)
// for any big ea lawyers, this can't be used to play the game without origin, game will throw a fit if you try to do anything without
// an origin id as a client for dedi it's fine though, game doesn't care if origin is disabled as long as there's only a server
- if (!IsDedicated())
- return;
-
char* ptr = (char*)GetProcAddress(GetModuleHandleA("tier0.dll"), "Tier0_InitOrigin");
TempReadWrite rw(ptr);
*ptr = (char)0xC3; // ret
@@ -473,9 +469,6 @@ void PrintFatalSquirrelErrorHook(void* sqvm)
void InitialiseDedicatedServerGameDLL(HMODULE baseAddress)
{
- if (!IsDedicated())
- return;
-
HookEnabler hook;
ENABLER_CREATEHOOK(hook, baseAddress + 0x794D0, &PrintFatalSquirrelErrorHook, reinterpret_cast<LPVOID*>(&PrintFatalSquirrelError));
} \ No newline at end of file