mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-06-17 18:00:54 +00:00
console setup errors will no longer deny a server startup
This commit is contained in:
+7
-10
@@ -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
|
||||||
|
|||||||
@@ -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"));
|
||||||
|
|||||||
Reference in New Issue
Block a user