aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/dedicated.cpp
diff options
context:
space:
mode:
authorHappyDOGE <28511119+HappyDOGE@users.noreply.github.com>2021-12-28 13:17:55 +0300
committerHappyDOGE <28511119+HappyDOGE@users.noreply.github.com>2021-12-28 13:17:55 +0300
commit8179de9831dd415794269015a40de44baa4c29d1 (patch)
tree01474e6ee563c39deaa930d71227cd5534891e16 /NorthstarDedicatedTest/dedicated.cpp
parentbb93442db8b1e450adf08a8305335020c436d358 (diff)
downloadNorthstarLauncher-8179de9831dd415794269015a40de44baa4c29d1.tar.gz
NorthstarLauncher-8179de9831dd415794269015a40de44baa4c29d1.zip
add parm checks for dedicated input + disable quick edit
Diffstat (limited to 'NorthstarDedicatedTest/dedicated.cpp')
-rw-r--r--NorthstarDedicatedTest/dedicated.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/NorthstarDedicatedTest/dedicated.cpp b/NorthstarDedicatedTest/dedicated.cpp
index 26dcc9ae..91e9cef6 100644
--- a/NorthstarDedicatedTest/dedicated.cpp
+++ b/NorthstarDedicatedTest/dedicated.cpp
@@ -407,8 +407,30 @@ void InitialiseDedicated(HMODULE engineAddress)
CommandLine()->AppendParm("+net_usesocketsforloopback", "1");
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"))
+ {
+ spdlog::info("Quick Edit enabled by user request");
+
+ HANDLE stdIn = GetStdHandle(STD_INPUT_HANDLE);
+ DWORD mode = 0;
+
+ if (GetConsoleMode(stdIn, &mode)) {
+ if (mode & ENABLE_QUICK_EDIT_MODE) {
+ mode &= ~ENABLE_QUICK_EDIT_MODE;
+ mode &= ~ENABLE_MOUSE_INPUT;
+
+ mode |= ENABLE_PROCESSED_INPUT;
+
+ SetConsoleMode(stdIn, mode);
+ }
+ }
+ }
+
// create console input thread
- consoleInputThreadHandle = CreateThread(0, 0, ConsoleInputThread, 0, 0, NULL);
+ if (!CommandLine()->CheckParm("-noconsoleinput"))
+ consoleInputThreadHandle = CreateThread(0, 0, ConsoleInputThread, 0, 0, NULL);
+ else spdlog::info("Console input disabled by user request");
}
typedef void(*Tier0_InitOriginType)();