Skip to content
Snippets Groups Projects
Commit 3b6c380d authored by mbellgardt's avatar mbellgardt
Browse files

Make nDisplay only a dependency under Windows or Linux

parent 4c927e34
No related branches found
No related tags found
2 merge requests!16Develop,!10Make nDisplay only a dependency under Windows or Linux
......@@ -3,8 +3,10 @@
#include "LogStream.h"
#include "GameFramework/PlayerController.h"
#include "GameFramework/HUD.h"
#if PLATFORM_WINDOWS || PLATFORM_LINUX
#include "IDisplayCluster.h"
#include "Cluster/IDisplayClusterClusterManager.h"
#endif
#include "Misc/CommandLine.h"
void UniversalLoggingImpl::StartupModule()
......@@ -154,6 +156,7 @@ void UniversalLoggingImpl::ResetSessionId(FString Prefix)
bool UniversalLoggingImpl::IsClusterMaster()
{
#if PLATFORM_WINDOWS || PLATFORM_LINUX
if (!IDisplayCluster::IsAvailable())
{
return true;
......@@ -164,14 +167,21 @@ bool UniversalLoggingImpl::IsClusterMaster()
return true; // if we are not in cluster mode, we are always the master
}
return Manager->IsMaster() || !Manager->IsSlave();
#else
return true;
#endif
}
FString UniversalLoggingImpl::GetNodeName()
{
#if PLATFORM_WINDOWS || PLATFORM_LINUX
if (IDisplayCluster::Get().GetOperationMode() == EDisplayClusterOperationMode::Cluster)
return IDisplayCluster::Get().GetClusterMgr()->GetNodeId();
else
return FString(TEXT("Localhost"));
#else
return FString(TEXT("Localhost"));
#endif
}
IMPLEMENT_MODULE(UniversalLoggingImpl, UniversalLogging)
#pragma once
#if PLATFORM_WINDOWS || PLATFORM_LINUX
#include "IDisplayCluster.h"
#endif
#include "Modules/ModuleManager.h"
#include "ILogStream.h"
......
......@@ -12,6 +12,11 @@ public class UniversalLogging : ModuleRules
PrivateIncludePaths.AddRange(new string[] { });
PublicIncludePaths.AddRange(new string[] { });
PublicDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "Core", "DisplayCluster" });
PublicDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "Core" });
if (Target.Platform == UnrealTargetPlatform.Linux || Target.Platform == UnrealTargetPlatform.Win64)
{
PublicDependencyModuleNames.AddRange(new string[] { "DisplayCluster" });
}
}
}
\ No newline at end of file
......@@ -20,7 +20,11 @@
"Plugins": [
{
"Name": "nDisplay",
"Enabled": true
"Enabled": true,
"WhitelistPlatforms": [
"Win64",
"Linux"
]
}
]
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment