mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 10:55:36 +00:00
console setup errors will no longer deny a server startup
This commit is contained in:
parent
667a22b0f8
commit
04de729d7c
@ -99,25 +99,22 @@ char _getch(void) {
|
||||
#endif // WIN32
|
||||
|
||||
void SetupConsole() {
|
||||
#if defined(WIN32) && !defined(DEBUG)
|
||||
#if defined(WIN32)
|
||||
DWORD outMode = 0;
|
||||
HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (stdoutHandle == INVALID_HANDLE_VALUE) {
|
||||
error("Invalid handle");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
_Exit(GetLastError());
|
||||
error("Invalid console handle! Inputs will not work properly");
|
||||
return;
|
||||
}
|
||||
if (!GetConsoleMode(stdoutHandle, &outMode)) {
|
||||
error("Invalid console mode");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
_Exit(GetLastError());
|
||||
error("Invalid console mode! Inputs will not work properly");
|
||||
return;
|
||||
}
|
||||
// Enable ANSI escape codes
|
||||
outMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
||||
if (!SetConsoleMode(stdoutHandle, outMode)) {
|
||||
error("failed to set console mode");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
_Exit(GetLastError());
|
||||
error("failed to set console mode! Inputs will not work properly");
|
||||
return;
|
||||
}
|
||||
#else
|
||||
#endif // WIN32
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
std::string CustomIP;
|
||||
std::string GetSVer() {
|
||||
return std::string(Sec("1.11"));
|
||||
return std::string(Sec("1.12"));
|
||||
}
|
||||
std::string GetCVer() {
|
||||
return std::string(Sec("1.70"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user