-
Notifications
You must be signed in to change notification settings - Fork 4
/
CloudSaveSubsystem.h
57 lines (45 loc) · 2.81 KB
/
CloudSaveSubsystem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (c) 2023 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
#pragma once
#include "CloudSaveLog.h"
#include "CloudSaveModels.h"
#include "OnlineCloudSaveInterfaceAccelByte.h"
#include "Core/AssetManager/TutorialModules/TutorialModuleSubsystem.h"
#include "CoreMinimal.h"
#include "CloudSaveSubsystem.generated.h"
class UAccelByteWarsGameInstance;
class AAccelByteWarsPlayerPawn;
class AAccelByteWarsPlayerState;
class UPromptSubsystem;
UCLASS()
class ACCELBYTEWARS_API UCloudSaveSubsystem : public UTutorialModuleSubsystem
{
GENERATED_BODY()
public:
void Initialize(FSubsystemCollectionBase& Collection) override;
void Deinitialize() override;
#pragma region Module.5 Function Declarations
public:
void SetPlayerRecord(const APlayerController* PlayerController, const FString& RecordKey, const FJsonObject& RecordData, const FOnSetCloudSaveRecordComplete& OnSetRecordComplete);
void GetPlayerRecord(const APlayerController* PlayerController, const FString& RecordKey, const FOnGetCloudSaveRecordComplete& OnGetRecordComplete);
void DeletePlayerRecord(const APlayerController* PlayerController, const FString& RecordKey, const FOnDeleteCloudSaveRecordComplete& OnDeleteRecordComplete);
private:
void OnSetPlayerRecordComplete(int32 LocalUserNum, const FOnlineError& Result, const FString& Key, const FOnSetCloudSaveRecordComplete OnSetRecordComplete);
void OnGetPlayerRecordComplete(int32 LocalUserNum, const FOnlineError& Result, const FString& Key, const FAccelByteModelsUserRecord& UserRecord, const FOnGetCloudSaveRecordComplete OnGetRecordComplete);
void OnDeletePlayerRecordComplete(int32 LocalUserNum, const FOnlineError& Result, const FString& Key, const FOnDeleteCloudSaveRecordComplete OnDeleteRecordComplete);
#pragma endregion
private:
void BindDelegates();
void UnbindDelegates();
void OnLoadGameSoundOptions(const APlayerController* PlayerController, TDelegate<void()> OnComplete);
void OnSaveGameSoundOptions(const APlayerController* PlayerController, TDelegate<void()> OnComplete);
void OnLoadPlayerShipEquipment(const APlayerController* PlayerController, TDelegate<void()> OnComplete);
void OnLoadPlayerShipEquipment(AAccelByteWarsPlayerPawn* PlayerPawn, const APlayerController* PlayerController, const FLinearColor InColor);
void OnSavePlayerShipEquipment(const APlayerController* PlayerController, TDelegate<void()> OnComplete);
void OnLoadPlayerEquipmentToSpawnComplete(bool bWasSuccessful, FJsonObject& Result, const FUniqueNetIdPtr UserId, const FLinearColor InColor);
FDelegateHandle OnSetPlayerRecordCompletedDelegateHandle;
FDelegateHandle OnGetPlayerRecordCompletedDelegateHandle;
FDelegateHandle OnDeletePlayerRecordCompletedDelegateHandle;
FOnlineCloudSaveAccelBytePtr CloudSaveInterface;
};