console setup errors will no longer deny a server startup

This commit is contained in:
Anonymous275
2020-11-17 08:28:02 +02:00
parent 667a22b0f8
commit 04de729d7c
2 changed files with 8 additions and 11 deletions
+7 -10
View File
@@ -99,25 +99,22 @@ char _getch(void) {
#endif // WIN32 #endif // WIN32
void SetupConsole() { void SetupConsole() {
#if defined(WIN32) && !defined(DEBUG) #if defined(WIN32)
DWORD outMode = 0; DWORD outMode = 0;
HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);
if (stdoutHandle == INVALID_HANDLE_VALUE) { if (stdoutHandle == INVALID_HANDLE_VALUE) {
error("Invalid handle"); error("Invalid console handle! Inputs will not work properly");
std::this_thread::sleep_for(std::chrono::seconds(3)); return;
_Exit(GetLastError());
} }
if (!GetConsoleMode(stdoutHandle, &outMode)) { if (!GetConsoleMode(stdoutHandle, &outMode)) {
error("Invalid console mode"); error("Invalid console mode! Inputs will not work properly");
std::this_thread::sleep_for(std::chrono::seconds(3)); return;
_Exit(GetLastError());
} }
// Enable ANSI escape codes // Enable ANSI escape codes
outMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; outMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
if (!SetConsoleMode(stdoutHandle, outMode)) { if (!SetConsoleMode(stdoutHandle, outMode)) {
error("failed to set console mode"); error("failed to set console mode! Inputs will not work properly");
std::this_thread::sleep_for(std::chrono::seconds(3)); return;
_Exit(GetLastError());
} }
#else #else
#endif // WIN32 #endif // WIN32
+1 -1
View File
@@ -9,7 +9,7 @@
std::string CustomIP; std::string CustomIP;
std::string GetSVer() { std::string GetSVer() {
return std::string(Sec("1.11")); return std::string(Sec("1.12"));
} }
std::string GetCVer() { std::string GetCVer() {
return std::string(Sec("1.70")); return std::string(Sec("1.70"));