Files
UnrealEngineUWP/Engine/Source/Editor/TurnkeySupport/Private/TurnkeyWrapper.cpp
nuno leiria e108e3c6c6 Log badly formatted platform device IDs.
Fix incoming after we can see the faulty platform and device name.

#jira UE-155363
#rb josh.adams
#preflight none

[CL 20468219 by nuno leiria in ue5-main branch]
2022-06-02 08:50:35 -04:00

57 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "TurnkeySupportModule.h"
#include "TurnkeySupport.h"
#include "Async/Async.h"
#include "Misc/MonitoredProcess.h"
FString ConvertToDDPIPlatform(const FString& Platform)
{
FString New = Platform.Replace(TEXT("Editor"), TEXT("")).Replace(TEXT("Client"), TEXT("")).Replace(TEXT("Server"), TEXT(""));
if (New == TEXT("Win64"))
{
New = TEXT("Windows");
}
return New;
}
FName ConvertToDDPIPlatform(const FName& Platform)
{
return FName(*ConvertToDDPIPlatform(Platform.ToString()));
}
FString ConvertToUATPlatform(const FString& Platform)
{
FString New = ConvertToDDPIPlatform(Platform);
if (New == TEXT("Windows"))
{
New = TEXT("Win64");
}
return New;
}
FString ConvertToUATDeviceId(const FString& DeviceId)
{
TArray<FString> PlatformAndDevice;
int32 NumElems = DeviceId.ParseIntoArray(PlatformAndDevice, TEXT("@"), true);
if(NumElems < 2)
{
UE_LOG(LogTurnkeySupport, Fatal, TEXT("Badly formatted deviceId: %s"), *DeviceId);
}
return FString::Printf(TEXT("%s@%s"), *ConvertToUATPlatform(PlatformAndDevice[0]), *PlatformAndDevice[1]);
}
FString ConvertToDDPIDeviceId(const FString& DeviceId)
{
TArray<FString> PlatformAndDevice;
int32 NumElems = DeviceId.ParseIntoArray(PlatformAndDevice, TEXT("@"), true);
if(NumElems < 2)
{
UE_LOG(LogTurnkeySupport, Fatal, TEXT("Badly formatted deviceId: %s"), *DeviceId);
}
return FString::Printf(TEXT("%s@%s"), *ConvertToDDPIPlatform(PlatformAndDevice[0]), *PlatformAndDevice[1]);
}