48 UPROPERTY(BlueprintAssignable, Category =
"EOS")
49 FOnServersFound OnServersFoundChanged;
50 UPROPERTY(BlueprintAssignable, Category = "EOS")
51 FOnFileDataFound OnFileDataFound;
52 UPROPERTY(BlueprintAssignable, Category = "EOS")
53 FOnFindReplaysComplete OnFindReplaysComplete;
58 virtual
void Init() override;
59 virtual
void Shutdown() override;
62 UFUNCTION(BlueprintCallable, Category="Difficulty")
65 UFUNCTION(BlueprintCallable, Category="EOS")
66 virtual
void SetDifficultyLevel(const
EDifficultyLevel NewDifficultyLevel) override;
69 virtual FString GetAuthToken() const override;
72 virtual
void LoginToPlayFab() override;
73 virtual FString GetPlayFabID() const override;
74 virtual
bool GetIsLoggedInToPlayFab() const override;
75 virtual
float GetPlayFabCurrency() const override;
76 virtual TArray<UPlayFabJsonObject*> GetPlayFabInventory() const override;
80 virtual
void LoginToEpicOnline(FString ID = "", FString Token = "", FString LoginType = "accountportal") override;
81 virtual
void Logout() const override;
82 virtual
void CreateEOSSession(FString SessionName,
bool bIsDedicatedServer,
bool bIsLAN,
bool bIsPresence, int32 MaxNumPlayers) override;
83 virtual
void FindSessionAndJoin() override;
84 virtual
void DestroySession() override;
86 virtual FString GetPlayerUserName() const override;
87 virtual
bool GetIsPlayerLoggedIn() const override;
88 virtual FString GetCurrentSessionName() const override;
90 virtual
void LaunchInGameMenu(APlayerController* Player, const
bool bOpen = true) override;
91 virtual
void LaunchOptionsMenu(APlayerController* Player, UUserWidget* CurrentWidget =
nullptr, const
bool bOpen = true) override;
93 virtual
void StartSession() override;
95 virtual TSubclassOf<UUserWidget> GetModalWidgetClass()
override {
return ModalWidgetClass;};
100 virtual void SearchServers()
override;
103 virtual void StartCampaign(
const bool bNewGame)
const override;
104 virtual void RestartLevel()
const;
106 virtual void StartHorde()
const override;
117 virtual bool GetIsOnlineGame()
const override;
118 virtual bool GetIsPublicMatch()
const override;
126 virtual void Host(FOnlineSessionSettings HostSessionSettings)
override;
127 virtual void SinglePlayer()
override;
129 virtual void Options()
override;
130 virtual void Join(uint32 Index)
override;
131 virtual void JoinManualAddress(
const FString& IpAddress)
override;
132 virtual void Quit(APlayerController* Player)
override;
136 UFUNCTION(BlueprintCallable, Category=
"EOS")
137 virtual
void UpdateStats(FString StatName, int32 Amount);
139 UFUNCTION(BlueprintCallable, Category="EOS")
140 virtual
void GetStats(TArray<FString> StatName);
142 UFUNCTION(BlueprintCallable, Category="EOS")
143 virtual
void LoadMenu() override;
145 UFUNCTION(BlueprintCallable, Category="EOS")
146 TArray<uint8> ConvertSaveFileTouint(class USaveGame* SavedGame);
147 UFUNCTION(BlueprintCallable, Category="EOS")
148 class USaveGame* ConvertunitToSaveFile(TArray<uint8> SavedGameArray);
149 UFUNCTION(BlueprintCallable, Category="EOS")
150 void UpdatePlayerData(const FString& FileName, TArray<uint8> SavedGameArray);
151 UFUNCTION(BlueprintCallable, Category="EOS")
152 void GetPlayerData(const FString& FileName);
154 UFUNCTION(Category="EOS")
155 void ReadPlayerData(const FString& FileName) const;
157 virtual int32 GetMinNumberOfPlayersToStart()
const override {
return MinNumberOfPlayersToStart;};
162 class IOnlineSubsystem* OnlineSubsystem =
nullptr;
165 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"EOS")
166 FString LobbyLevelText;
167 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="EOS")
168 FString StartupLevelText;
169 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="EOS")
170 FString DemoLevelText;
189 virtual UDataTable* GetLevelDataTable()
override{
return LevelDataTable;};
202 UFUNCTION(BlueprintCallable, Category=
"Player Profile")
203 virtual
bool SaveOfflinePlayerProfile() override;
204 UFUNCTION(BlueprintCallable, Category="Player Profile")
205 virtual
bool LoadOfflinePlayerProfile(
FUserProfile& OfflineProfile) override;
209 virtual
void ReturnToMainMenu() override;
213 UPROPERTY(EditAnywhere, Category="Game Instance|Widgets")
214 TSubclassOf<class UUserWidget> InGameMenuClass =
nullptr;
217 UPROPERTY(EditAnywhere, Category="Game Instance|Widgets")
218 TSubclassOf<class UUserWidget> OptionsMenuClass =
nullptr;
220 TSubclassOf<class UUserWidget> ModalWidgetClass =
nullptr;
224 UPROPERTY(EditAnywhere, Category="Game Instance|Widgets")
225 TSubclassOf<class UUserWidget> MenuClass =
nullptr;
227 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Replay")
229 UPROPERTY(EditAnywhere, Category="Game Instance|Widgets")
233 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Menu System")
234 bool bDebuggingMode = true;
235 bool bInGameMenuOpen = false;
236 bool bOptionsMenuOpen = false;
239 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Menu System")
240 class UDataTable* ProfilePicturesDT =
nullptr;
241 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Menu System")
242 class UDataTable* LevelDataTable =
nullptr;
247 UFUNCTION(BlueprintCallable, Category = "Replays")
248 virtual
bool OpenReplayMenu(APlayerController* Player, const
bool bOpen = true) override;
250 UFUNCTION(BlueprintCallable, Category = "Replays")
251 virtual
void StartRecordingReplayFromBP(const FString& InName, const FString& FriendlyName) override;
254 UFUNCTION(BlueprintCallable, Category = "Replays")
255 virtual
void CreateReplayEvent(const int32 TimeInMS, const FString& Group, const FString& Meta, const TArray<uint8>& Data) override;
258 UFUNCTION(BlueprintCallable, Category = "Replays")
259 virtual
void StopRecordingReplayFromBP() override;
261 UFUNCTION(BlueprintCallable, Category = "Replays")
262 virtual
void PlayReplayFromBP(FString ReplayName) override;
264 UFUNCTION(BlueprintCallable, Category = "Replays")
265 virtual
void FindReplays() override;
267 UFUNCTION(BlueprintCallable, Category = "Replays")
268 virtual
void RenameReplay(const FString &ReplayName, const FString &NewFriendlyReplayName) override;
270 UFUNCTION(BlueprintCallable, Category = "Replays")
271 virtual
void DeleteReplay(const FString &ReplayName) override;
274 void OnLoginEOSCompleted(int32 LocalUserNum,
bool bSuccess, const FUniqueNetId& UserID, const FString&
Error) const;
275 void OnLogoutComplete(const int32 ResultCode, const
bool bSuccess) const;
276 void OnCreateSessionCompleted(FName SessionName,
bool bSuccess) const;
277 void OnDestroySessionCompleted(FName SessionName,
bool bSuccess) const;
278 void OnFindSessionCompleted(
bool bSuccess);
279 void OnFindSessionListCompleted(
bool bSuccess) const;
280 void OnJoinSessionCompleted(FName SessionName, EOnJoinSessionCompleteResult::Type Result) const;
283 void OnUpdateStatsComplete(const FOnlineError& Result) const;
284 void OnGetStatsComplete(const FOnlineError& Result, const TArray<TSharedRef<const FOnlineStatsUserStats>>& UserStats);
285 void OnWriteUserFileComplete(
bool bSuccess, const FUniqueNetId& UserID, const FString& FileName) const;
286 void OnGetUserFileComplete(
bool bSuccess, const FUniqueNetId& UserID, const FString& FileName) const;
294 bool bAutoLoginToPlayFab = true;
296 FString CurrencyCode = "PC";
297 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="
Menu System|Levels")
299 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="
Menu System|Levels")
301 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="
Menu System|Levels")
303 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="
Menu System|Levels")
309 IOnlineIdentityPtr GetOnlineIdentity() const;
313 int32 MinNumberOfPlayersToStart = 2;
314 FString CurrentSessionName = "Default_Server_Name";
319 void SetPlayerProfileName();
324 int32 CurrentSaveSlot = 1;
325 TArray<int32> AllSaveSlots;
331 virtual
void OnNetworkFailure(UWorld* World, UNetDriver* NewDriver, ENetworkFailure::Type FailureType, const FString& ErrorString);
334 TSharedPtr<INetworkReplayStreamer> EnumerateStreamsPtr;
335 FEnumerateStreamsCallback OnEnumerateStreamsCompleteDelegate;
336 FDeleteFinishedStreamCallback OnDeleteFinishedStreamCompleteDelegate;
338 FRenameReplayCallback OnRenameReplayCompleteDelegate;
341 void OnEnumerateStreamsComplete(const FEnumerateStreamsResult& Result) const;
342 void OnDeleteFinishedStreamComplete(const FDeleteFinishedStreamResult& Result);
343 void OnReplayRenameFinishedComplete(const FRenameReplayResult& Result);
347 PlayFabClientPtr ClientAPI =
nullptr;
348 PlayFabAdminPtr AdminAPI =
nullptr;
349 FString PlayFabID = "";
350 float PlayFabCurrency = 0.0f;
351 TArray<
PlayFab::ClientModels::FItemInstance> PlayFabInventory;
352 void SetPlayFabDisplayName();
353 void OnPlayFabLoginSuccess(const
PlayFab::ClientModels::FLoginResult& Result);
354 void OnPlayFabError(const
PlayFab::FPlayFabCppError& ErrorResult);
355 void OnPlayFabDisplayChangedSuccess(const
PlayFab::AdminModels::FUpdateUserTitleDisplayNameResult& Result);
356 void OnPlayFabLGetInventorySuccess(const
PlayFab::ClientModels::FGetUserInventoryResult& Result);