aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/dedicated.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-09-26 01:24:13 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-09-26 01:24:13 +0100
commite98fc31a93dfc9a14db7bb5510d25df0226d6fd3 (patch)
tree0a14184023e46394ee7bc83846c4466f7e3f14c9 /NorthstarDedicatedTest/dedicated.cpp
parentf083706eb05a22ec166d8e29b565f93785ad3cb0 (diff)
downloadNorthstarLauncher-e98fc31a93dfc9a14db7bb5510d25df0226d6fd3.tar.gz
NorthstarLauncher-e98fc31a93dfc9a14db7bb5510d25df0226d6fd3.zip
add CommandLine() and Cbuf_Execute
Diffstat (limited to 'NorthstarDedicatedTest/dedicated.cpp')
-rw-r--r--NorthstarDedicatedTest/dedicated.cpp34
1 files changed, 12 insertions, 22 deletions
diff --git a/NorthstarDedicatedTest/dedicated.cpp b/NorthstarDedicatedTest/dedicated.cpp
index 089ca467..01917f50 100644
--- a/NorthstarDedicatedTest/dedicated.cpp
+++ b/NorthstarDedicatedTest/dedicated.cpp
@@ -1,14 +1,14 @@
#include "pch.h"
#include "dedicated.h"
#include "hookutils.h"
+#include "tier0.h"
+#include "gameutils.h"
#include <iostream>
bool IsDedicated()
{
- // temp: should get this from commandline
- //return true;
- return false;
+ return CommandLine()->HasParm("-dedicated");
}
enum EngineState_t
@@ -47,26 +47,11 @@ enum HostState_t
HS_RESTART,
};
-struct CHostState
-{
- HostState_t m_currentState;
- HostState_t m_nextState;
-
- float m_vecLocationX;
- float m_vecLocationY;
- float m_vecLocationZ;
-
- float m_angLocationX;
- float m_angLocationY;
- float m_angLocationZ;
-
- char m_levelName[32];
-
- // there's more stuff here, just this is all i use atm
-};
-
void InitialiseDedicated(HMODULE engineAddress)
{
+ if (!IsDedicated())
+ return;
+
spdlog::info("InitialiseDedicated");
//while (!IsDebuggerPresent())
@@ -231,6 +216,11 @@ void InitialiseDedicated(HMODULE engineAddress)
// also look into launcher.dll+d381, seems to cause renderthread to get made
// this crashes HARD if no window which makes sense tbh
// also look into materialsystem + 5B344 since it seems to be the base of all the renderthread stuff
+
+ // add cmdline args that are good for dedi
+ CommandLine()->AppendParm("-nomenuvid", 0);
+ CommandLine()->AppendParm("+host_preload_shaders", 0);
+ CommandLine()->AppendParm("-nosound", 0);
}
void Sys_Printf(CDedicatedExports* dedicated, char* msg)
@@ -261,7 +251,7 @@ void RunServer(CDedicatedExports* dedicated)
// set up engine and host states to allow us to enter CHostState::FrameUpdate, with the state HS_NEW_GAME
cEnginePtr->m_nNextDllState = EngineState_t::DLL_ACTIVE;
- cHostStatePtr->m_nextState = HostState_t::HS_NEW_GAME;
+ cHostStatePtr->m_iNextState = HostState_t::HS_NEW_GAME;
strcpy(cHostStatePtr->m_levelName, "mp_lobby"); // set map to load into
while (true)