Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Get OS name from FPlatformProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Audykowicz committed Aug 2, 2023
1 parent 2f32bc5 commit 90c6de6
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions DolbyIO/Source/Private/Subsystem/DolbyIOInitialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "Engine/GameInstance.h"
#include "Engine/World.h"
#include "GenericPlatform/GenericPlatformProperties.h"
#include "Interfaces/IPluginManager.h"
#include "Misc/EngineVersion.h"
#include "Misc/Paths.h"
Expand Down Expand Up @@ -83,24 +84,6 @@ void UDolbyIOSubsystem::SetToken(const FString& Token)
}
}

namespace
{
FString GetComponentVersion()
{
return *IPluginManager::Get().FindPlugin("DolbyIO")->GetDescriptor().VersionName + FString{"_ue"} +
FEngineVersion::Current().ToString(EVersionComponent::Minor) + "_" +
#if PLATFORM_WINDOWS
"windows";
#elif PLATFORM_MAC
"macos";
#elif PLATFORM_LINUX
"linux";
#elif PLATFORM_ANDROID
"android";
#endif
}
}

void UDolbyIOSubsystem::Initialize(const FString& Token)
{
try
Expand All @@ -126,7 +109,9 @@ void UDolbyIOSubsystem::Initialize(const FString& Token)
[this](event_handler_id) { return Sdk->Service().add_event_handler([this](const Event& Event) { Handle(Event); }); }

const FString ComponentName = "unreal-sdk";
const FString ComponentVersion = GetComponentVersion();
const FString ComponentVersion = *IPluginManager::Get().FindPlugin("DolbyIO")->GetDescriptor().VersionName +
FString{"_UE"} + FEngineVersion::Current().ToString(EVersionComponent::Minor) +
"_" + FPlatformProperties::IniPlatformName();
DLB_UE_LOG("Registering component %s %s", *ComponentName, *ComponentVersion);
Sdk->register_component_version(ToStdString(ComponentName), ToStdString(ComponentVersion))
.then(
Expand Down

0 comments on commit 90c6de6

Please sign in to comment.