Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions UnrealPlugin/Source/PlayFabGSDK/Private/GSDKConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

#include "GSDKInternalUtils.h"
#include "PlayFabGSDK.h"
#include "Dom/JsonObject.h"
#include "Logging/LogMacros.h"
#include "Misc/FileHelper.h"
#include "Misc/Paths.h"
#include "Serialization/JsonReader.h"
#include "Serialization/JsonSerializer.h"

FConfigurationBase::FConfigurationBase()
{
Expand Down Expand Up @@ -163,7 +167,7 @@ FJsonFileConfiguration::FJsonFileConfiguration(const FString& FileName)
TSharedPtr<FJsonObject> GameCertsJson = ConfigJson->GetObjectField(TEXT("gameCertificates"));
for (const auto& GameCert: GameCertsJson->Values)
{
GameCerts.Add(GameCert.Key, GameCert.Value->AsString());
GameCerts.Add(FString(GameCert.Key.ToView()), GameCert.Value->AsString());
}
}

Expand All @@ -172,7 +176,7 @@ FJsonFileConfiguration::FJsonFileConfiguration(const FString& FileName)
TSharedPtr<FJsonObject> BuildMetaData = ConfigJson->GetObjectField(TEXT("buildMetadata"));
for (const auto& BuildMetaDataValue: BuildMetaData->Values)
{
Metadata.Add(BuildMetaDataValue.Key, BuildMetaDataValue.Value->AsString());
Metadata.Add(FString(BuildMetaDataValue.Key.ToView()), BuildMetaDataValue.Value->AsString());
}
}

Expand All @@ -181,7 +185,7 @@ FJsonFileConfiguration::FJsonFileConfiguration(const FString& FileName)
TSharedPtr<FJsonObject> GamePortsJson = ConfigJson->GetObjectField(TEXT("gamePorts"));
for (const auto& GamePortCur: GamePortsJson->Values)
{
Ports.Add(GamePortCur.Key, GamePortCur.Value->AsString());
Ports.Add(FString(GamePortCur.Key.ToView()), GamePortCur.Value->AsString());
}
}

Expand Down
20 changes: 13 additions & 7 deletions UnrealPlugin/Source/PlayFabGSDK/Private/GSDKInternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
#include "HttpModule.h"
#include "HttpManager.h"
#include "Async/Async.h"
#include "Json.h"
#include "Dom/JsonObject.h"
#include "PlayFabGSDK.h"
#include "Interfaces/IHttpResponse.h"
#include "Misc/Paths.h"
#include "Logging/LogMacros.h"
#include "HAL/Event.h"
#include "HAL/PlatformFileManager.h"
#include "GSDKInfo.h"
#include "Serialization/JsonReader.h"
#include "Serialization/JsonSerializer.h"
#include "Serialization/JsonWriter.h"

FGSDKInternal::FGSDKInternal()
: SignalHeartbeatEvent(FPlatformProcess::GetSynchEventFromPool(false))
Expand Down Expand Up @@ -352,13 +356,14 @@ void FGSDKInternal::DecodeHeartbeatResponse(const FString& ResponseJson)
FString ValueString;
if (SessionConfigJsonValue.Value->TryGetString(ValueString))
{
if (ConfigSettings.Contains(SessionConfigJsonValue.Key))
const FString ConfigKey(SessionConfigJsonValue.Key.ToView());
if (ConfigSettings.Contains(ConfigKey))
{
ConfigSettings[SessionConfigJsonValue.Key] = ValueString;
ConfigSettings[ConfigKey] = ValueString;
}
else
{
ConfigSettings.Add(SessionConfigJsonValue.Key, ValueString);
ConfigSettings.Add(ConfigKey, ValueString);
}
}
}
Expand All @@ -372,13 +377,14 @@ void FGSDKInternal::DecodeHeartbeatResponse(const FString& ResponseJson)
FString ValueString;
if (MetaDataJson.Value->TryGetString(ValueString))
{
if (ConfigSettings.Contains(MetaDataJson.Key))
const FString ConfigKey(MetaDataJson.Key.ToView());
if (ConfigSettings.Contains(ConfigKey))
{
ConfigSettings[MetaDataJson.Key] = ValueString;
ConfigSettings[ConfigKey] = ValueString;
}
else
{
ConfigSettings.Add(MetaDataJson.Key, ValueString);
ConfigSettings.Add(ConfigKey, ValueString);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions UnrealPlugin/Source/PlayFabGSDK/Private/GSDKUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "GSDKUtils.h"

#include "Engine/EngineBaseTypes.h"
#include "PlayFabGSDK.h"

const FGameServerConnectionInfo UGSDKUtils::GetGameServerConnectionInfo()
Expand Down
2 changes: 1 addition & 1 deletion UnrealPlugin/Source/PlayFabGSDK/Public/ConnectedPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ struct FConnectedPlayer
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite)
UPROPERTY(BlueprintReadWrite, Category = "PlayFab GSDK")
FString PlayerId;
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ struct FGamePort
/// <summary>
/// The friendly name / identifier for the port, specified by the game developer in the Build configuration.
/// </summary>
UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = "PlayFab GSDK")
FString Name;

/// <summary>
/// The port at which the game server should listen on (maps externally to <see cref="m_clientConnectionPort" />).
/// For process based servers, this is determined by Control Plane, based on the ports available on the VM.
/// For containers, this is specified by the game developer in the Build configuration.
/// </summary>
UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = "PlayFab GSDK")
int32 ServerListeningPort = 0;

/// <summary>
/// The public port to which clients should connect (maps internally to <see cref="m_serverListeningPort" />).
/// </summary>
UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = "PlayFab GSDK")
int32 ClientConnectionPort = 0;
};

Expand All @@ -38,9 +38,9 @@ struct FGameServerConnectionInfo
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = "PlayFab GSDK")
FString PublicIpV4Address;

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = "PlayFab GSDK")
TArray<FGamePort> GamePortsConfiguration;
};
4 changes: 2 additions & 2 deletions UnrealPlugin/Source/PlayFabGSDK/Public/MaintenanceSchedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct FMaintenanceEvent
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite)
UPROPERTY(BlueprintReadWrite, Category = "PlayFab GSDK")
FString EventId;
FString EventType;
FString ResourceType;
Expand All @@ -28,7 +28,7 @@ struct FMaintenanceSchedule
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite)
UPROPERTY(BlueprintReadWrite, Category = "PlayFab GSDK")
FString DocumentIncarnation;
TArray<FMaintenanceEvent> Events;
};
2 changes: 1 addition & 1 deletion UnrealPlugin/Source/PlayFabGSDK/Public/PlayFabGSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class

// These two keys are only available after allocation
static constexpr const TCHAR* SESSION_COOKIE_KEY = TEXT("sessionCookie");
static constexpr const TCHAR* SESSION_ID_KEY = TEXT("sessionId";)
static constexpr const TCHAR* SESSION_ID_KEY = TEXT("sessionId");

#if !(WITH_DEV_AUTOMATION_TESTS && WITH_EDITOR)
private:
Expand Down