// Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 #pragma once // GameKit #include "AwsGameKitSessionManagerModels.h" #include "Common/AwsGameKitBlueprintCommon.h" // Unreal #include "CoreMinimal.h" #include "Engine/LatentActionManager.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "AwsGameKitSessionManagerFunctionLibrary.generated.h" /** * @brief This class provides APIs for loading and querying the `awsGameKitClientConfig.yml` file. * * The `awsGameKitClientConfig.yml` file is generated by GameKit each time a feature is deployed or re-deployed, * and has settings for each GameKit feature you've deployed. The file is loaded by calling ReloadConfig(). */ UCLASS() class AWSGAMEKITRUNTIME_API UAwsGameKitSessionManagerFunctionLibrary : public UBlueprintFunctionLibrary { GENERATED_UCLASS_BODY() public: /** * Replace any loaded client settings with new settings from the `awsGameKitClientConfig.yml` file. * * The `awsGameKitClientConfig.yml` file is recursively searched for in these root locations: * - In editor mode: one level above FPaths::GameSourceDir(). * - In non-editor mode: FPaths::LaunchDir(). * * The `awsGameKitClientConfig.yml` file is generated by GameKit each time a feature is deployed or re-deployed, * and has settings for each GameKit feature you've deployed. The file is loaded by calling ReloadConfig(). * * This method always succeeds. You can ignore the "On Failure" execution pin and the "Error" output value. * * @param Error Ignore this value. This method always succeeds. */ UFUNCTION(BlueprintCallable, Category = "AWS GameKit | SessionManager", meta = (WorldContext = "WorldContextObject", Latent, LatentInfo = "LatentInfo", ExpandEnumAsExecs = "SuccessOrFailure")) static void ReloadConfig( UObject* WorldContextObject, FLatentActionInfo LatentInfo, EAwsGameKitSuccessOrFailureExecutionPin& SuccessOrFailure, FAwsGameKitOperationResult& Error); /** * Return true if settings are loaded for the feature, false if they are not loaded. * * The `awsGameKitClientConfig.yml` file is generated by GameKit each time a feature is deployed or re-deployed, * and has settings for each GameKit feature you've deployed. The file is loaded by calling ReloadConfig(). * * @param featureType The feature to check. * @return True if the feature's settings are loaded, false otherwise. */ UFUNCTION(BlueprintCallable, Category = "AWS GameKit | SessionManager") static bool AreSettingsLoaded(const FeatureType_E featureType); UFUNCTION(BlueprintCallable, Category = "AWS GameKit | SessionManager", meta = (WorldContext = "WorldContextObject", Latent, LatentInfo = "LatentInfo", ExpandEnumAsExecs = "SuccessOrFailure")) static void SetToken( UObject* WorldContextObject, FLatentActionInfo LatentInfo, const FSetTokenRequest& Request, EAwsGameKitSuccessOrFailureExecutionPin& SuccessOrFailure, FAwsGameKitOperationResult& Error); };