aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-05 23:34:37 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-05 23:34:37 +0000
commit3cf310cc9f8b400a100abd1067505c89c99259ab (patch)
tree749565aef5db5b8d9c93e4aace3498c72129913b /NorthstarDedicatedTest
parent9e8232e97db1cfe9f0f9a69bdfde5048a6290df1 (diff)
downloadNorthstarLauncher-3cf310cc9f8b400a100abd1067505c89c99259ab.tar.gz
NorthstarLauncher-3cf310cc9f8b400a100abd1067505c89c99259ab.zip
fix a bug with dedi not setting playlist max_players right
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r--NorthstarDedicatedTest/dedicated.cpp9
-rw-r--r--NorthstarDedicatedTest/memalloc.cpp2
2 files changed, 9 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/dedicated.cpp b/NorthstarDedicatedTest/dedicated.cpp
index 5269c5cb..a2f174ff 100644
--- a/NorthstarDedicatedTest/dedicated.cpp
+++ b/NorthstarDedicatedTest/dedicated.cpp
@@ -52,6 +52,13 @@ void RunServer(CDedicatedExports* dedicated)
spdlog::info(CommandLine()->GetCmdLine());
+ // run initial 2 ticks, 1 to initialise engine and 1 to load initial map
+ g_pEngine->Frame();
+ g_pEngine->Frame();
+
+ // to fix a bug: set current playlist again, otherwise max_players will be set wrong
+ SetCurrentPlaylist(GetCurrentPlaylistName());
+
while (g_pEngine->m_nQuitting == EngineQuitState::QUIT_NOTQUITTING)
{
g_pEngine->Frame();
@@ -483,7 +490,7 @@ PrintFatalSquirrelErrorType PrintFatalSquirrelError;
void PrintFatalSquirrelErrorHook(void* sqvm)
{
PrintFatalSquirrelError(sqvm);
- //abort();
+ g_pEngine->m_nQuitting = EngineQuitState::QUIT_TODESKTOP;
}
void InitialiseDedicatedServerGameDLL(HMODULE baseAddress)
diff --git a/NorthstarDedicatedTest/memalloc.cpp b/NorthstarDedicatedTest/memalloc.cpp
index c7cfbb6a..113f56b9 100644
--- a/NorthstarDedicatedTest/memalloc.cpp
+++ b/NorthstarDedicatedTest/memalloc.cpp
@@ -12,7 +12,7 @@
// then just use the game's allocator after that
// yes, this means we leak 100k of memory, idk how else to do this without breaking stuff
-const int STATIC_ALLOC_SIZE = 100000;
+const int STATIC_ALLOC_SIZE = 100000; // alot more than we need, could reduce to 50k or even 25k later potentially
size_t g_iStaticAllocated = 0;
char pStaticAllocBuf[STATIC_ALLOC_SIZE];