From b467313c6b36f1da07189a127c2ad50d6b085a53 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 15 Jan 2022 14:23:30 +0000 Subject: run server autoexec after engine init from cbuf rather than commandline parm to allow stuffcmds to work --- NorthstarDedicatedTest/dedicated.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NorthstarDedicatedTest/dedicated.cpp b/NorthstarDedicatedTest/dedicated.cpp index 1359a33e..641fb42e 100644 --- a/NorthstarDedicatedTest/dedicated.cpp +++ b/NorthstarDedicatedTest/dedicated.cpp @@ -50,6 +50,11 @@ void RunServer(CDedicatedExports* dedicated) // run initial 2 ticks, 1 to initialise engine and 1 to load initial map g_pEngine->Frame(); + + // run server autoexec + Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec autoexec_ns_server", cmd_source_t::kCommandSrcCode); + Cbuf_Execute(); + g_pEngine->Frame(); // to fix a bug: set current playlist again, otherwise max_players will be set wrong @@ -406,7 +411,7 @@ void InitialiseDedicated(HMODULE engineAddress) CommandLine()->AppendParm("-windowed", 0); CommandLine()->AppendParm("+host_preload_shaders", "0"); CommandLine()->AppendParm("+net_usesocketsforloopback", "1"); - CommandLine()->AppendParm("+exec", "autoexec_ns_server"); + //CommandLine()->AppendParm("+exec", "autoexec_ns_server"); // Disable Quick Edit mode to reduce chance of user unintentionally hanging their server by selecting something. if (!CommandLine()->CheckParm("-bringbackquickedit")) -- cgit v1.2.3