Skip to content

Commit

Permalink
xrDebug: use GEnv.isDedicatedServer
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Sep 23, 2018
1 parent b39957d commit 5f33228
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/xrCore/_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/xrCore/xrCore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@
<ProjectReference Include="$(SolutionDir)utils\xrMiscMath\xrMiscMath.vcxproj">
<Project>{7885cf3c-ee04-4c67-9467-1fbf9a36b037}</Project>
</ProjectReference>
<ProjectReference Include="..\Layers\xrAPI\xrAPI.vcxproj">
<Project>{1daec516-e52c-4a3c-a4da-ae3553e6e0f8}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
8 changes: 4 additions & 4 deletions src/xrCore/xrDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/xrCore/xrDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/xr_3da/entry_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5f33228

Please sign in to comment.