From 5f332283abf40a0c3815e07fcaa5cb5202e2bf6d Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sun, 23 Sep 2018 06:57:03 +0500 Subject: [PATCH] xrDebug: use GEnv.isDedicatedServer --- src/xrCore/_math.cpp | 2 +- src/xrCore/xrCore.vcxproj | 3 +++ src/xrCore/xrDebug.cpp | 8 ++++---- src/xrCore/xrDebug.h | 4 ++-- src/xr_3da/entry_point.cpp | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/xrCore/_math.cpp b/src/xrCore/_math.cpp index 238286a4248..94c31b05fd2 100644 --- a/src/xrCore/_math.cpp +++ b/src/xrCore/_math.cpp @@ -425,7 +425,7 @@ void __cdecl thread_entry(void* _params) void thread_spawn(thread_t* entry, const char* name, unsigned stack, void* arglist) { - xrDebug::Initialize(false); + xrDebug::Initialize(); THREAD_STARTUP* startup = new THREAD_STARTUP(); startup->entry = entry; diff --git a/src/xrCore/xrCore.vcxproj b/src/xrCore/xrCore.vcxproj index 103f72bb478..ea5504b17b9 100644 --- a/src/xrCore/xrCore.vcxproj +++ b/src/xrCore/xrCore.vcxproj @@ -436,6 +436,9 @@ {7885cf3c-ee04-4c67-9467-1fbf9a36b037} + + {1daec516-e52c-4a3c-a4da-ae3553e6e0f8} + diff --git a/src/xrCore/xrDebug.cpp b/src/xrCore/xrDebug.cpp index 291ec8d92a4..585db6516c8 100644 --- a/src/xrCore/xrDebug.cpp +++ b/src/xrCore/xrDebug.cpp @@ -613,7 +613,7 @@ void WINAPI xrDebug::PreErrorHandler(INT_PTR) #endif } -void xrDebug::SetupExceptionHandler(const bool& dedicated) +void xrDebug::SetupExceptionHandler() { #if defined(WINDOWS) const auto commandLine = GetCommandLine(); @@ -623,7 +623,7 @@ void xrDebug::SetupExceptionHandler(const bool& dedicated) SetErrorMode(prevMode | SEM_NOGPFAULTERRORBOX); BT_InstallSehFilter(); - if (!dedicated && !strstr(commandLine, "-silent_error_mode")) + if (!GEnv.isDedicatedServer && !strstr(commandLine, "-silent_error_mode")) BT_SetActivityType(BTA_SHOWUI); else BT_SetActivityType(BTA_SAVEREPORT); @@ -821,11 +821,11 @@ void xrDebug::OnThreadSpawn() #endif } -void xrDebug::Initialize(const bool& dedicated) +void xrDebug::Initialize() { *BugReportFile = 0; OnThreadSpawn(); - SetupExceptionHandler(dedicated); + SetupExceptionHandler(); SDL_SetAssertionHandler(SDLAssertionHandler, nullptr); // exception handler to all "unhandled" exceptions #if defined(WINDOWS) diff --git a/src/xrCore/xrDebug.h b/src/xrCore/xrDebug.h index 77404d898e1..e24357258f7 100644 --- a/src/xrCore/xrDebug.h +++ b/src/xrCore/xrDebug.h @@ -57,7 +57,7 @@ class XRCORE_API xrDebug public: xrDebug() = delete; - static void Initialize(const bool& dedicated); + static void Initialize(); static void Destroy(); static void OnThreadSpawn(); @@ -90,7 +90,7 @@ class XRCORE_API xrDebug static bool symEngineInitialized; static Lock dbgHelpLock; static void FormatLastError(char* buffer, const size_t& bufferSize); - static void SetupExceptionHandler(const bool& dedicated); + static void SetupExceptionHandler(); static LONG WINAPI UnhandledFilter(EXCEPTION_POINTERS* exPtrs); static void WINAPI PreErrorHandler(INT_PTR); #if defined(WINDOWS) diff --git a/src/xr_3da/entry_point.cpp b/src/xr_3da/entry_point.cpp index 9ed4b84de49..0fe951f0f30 100644 --- a/src/xr_3da/entry_point.cpp +++ b/src/xr_3da/entry_point.cpp @@ -20,7 +20,7 @@ int entry_point(pcstr commandLine) if (strstr(commandLine, "-dedicated")) GEnv.isDedicatedServer = true; - xrDebug::Initialize(GEnv.isDedicatedServer); + xrDebug::Initialize(); StickyKeyFilter filter; if (!GEnv.isDedicatedServer)