16#include "CoreMinimal.h"
17#include "UObject/NoExportTypes.h"
18#include "PPF_Platform.h"
19#include "OnlineSubsystemPicoNames.h"
20#include "OnlineSubsystemPico.h"
21#include "Pico_Leaderboards.h"
23#include "Pico_Challenges.generated.h"
35USTRUCT(BlueprintType, meta = (DisplayName =
"ChallengeOptions"))
36struct FPico_ChallengeOptions
38 GENERATED_USTRUCT_BODY()
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options") FString Title;
41 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options") int32 StartDate;
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options") int32 EndDate;
43 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options") FString LeaderboardName;
44 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options")
bool bIncludeActiveChallenges;
45 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options")
bool bIncludeFutureChallenges;
46 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options")
bool bIncludePastChallenges;
47 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options")
EChallengeVisibility Visibility;
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pico Platform|Challenges|Challenge Options")
EChallengeViewerFilter ViewerFilter;
53DECLARE_LOG_CATEGORY_EXTERN(PicoChallenges, Log, All);
58DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeGet,
bool, bIsError, const FString&, ErrorMessage,
UPico_Challenge*,
61DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeGetEntries,
bool, bIsError, const FString&, ErrorMessage,
64DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeGetEntriesAfterRank,
bool, bIsError, const FString&, ErrorMessage,
67DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeGetEntriesByIds,
bool, bIsError, const FString&, ErrorMessage,
70DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeGetList,
bool, bIsError, const FString&, ErrorMessage,
73DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeInvite,
bool, bIsError, const FString&, ErrorMessage,
76DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeLeave,
bool, bIsError, const FString&, ErrorMessage,
UPico_Challenge*,
79DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeJoin,
bool, bIsError, const FString&, ErrorMessage,
UPico_Challenge*,
81DECLARE_DYNAMIC_DELEGATE_ThreeParams(FChallengeLaunchInvitableUserFlow,
bool, bIsError,
int, ErrorCode, const FString&, ErrorMessage);
83DECLARE_MULTICAST_DELEGATE_FourParams(FChallengeInviteAcceptedOrLaunchAppNotify,
bool,
int, const FString&, const FString& );
98 FOnlineSubsystemPico& PicoSubsystem;
104 FChallengeGet GetDelegate;
105 FChallengeGetEntries GetEntriesDelegate;
106 FChallengeGetEntriesAfterRank GetEntriesAfterRankDelegate;
107 FChallengeGetEntriesByIds GetEntriesByIdsDelegate;
108 FChallengeGetList GetListDelegate;
109 FChallengeJoin JoinDelegate;
110 FChallengeLeave LeaveDelegate;
111 FChallengeInvite InviteDelegate;
112 FChallengeLaunchInvitableUserFlow LaunchInvitableUserFlowDelegate;
114 FChallengeInviteAcceptedOrLaunchAppNotify ChallengeInviteAcceptedOrLaunchAppNotify;
116 FDelegateHandle ChallengeInviteAcceptedOrLaunchAppHandle;
117 void OnChallengeInviteAcceptedOrLaunchAppNotification(ppfMessageHandle Message,
bool bIsError);
129 bool Get(
const FString& ChallengeID, FChallengeGet InGetDelegate);
178 FChallengeGetEntriesAfterRank InGetEntriesAfterRankDelegate);
206 const TArray<FString>& UserIDs, FChallengeGetEntriesByIds InGetEntriesByIdsDelegate);
223 bool GetList(FPico_ChallengeOptions ChallengeOptions,
int PageIdx,
int PageSize, FChallengeGetList InGetListDelegate);
235 bool Join(
const FString& ChallengeID, FChallengeJoin InJoinDelegate);
247 bool Leave(
const FString& ChallengeID, FChallengeLeave InLeaveDelegate);
260 bool Invite(
const FString& ChallengeID,
const TArray<FString>& UserIDs, FChallengeInvite Delegate);
306 UFUNCTION(BlueprintCallable, meta = (WorldContext =
"WorldContextObject"), Category =
"OnlinePico|Challenges")
307 static
void Get(UObject* WorldContextObject, const FString& ChallengeID, FChallengeGet InGetDelegate);
333 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Challenges")
334 static
void GetEntries(UObject* WorldContextObject, const FString& ChallengeID,
int PageIdx,
int PageSize,
336 FChallengeGetEntries InGetEntriesDelegate);
347 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Challenges")
348 static
void GetEntriesAfterRank(UObject* WorldContextObject, const FString& ChallengeID,
int PageIdx,
int PageSize,
349 const FString& AfterRank,
350 FChallengeGetEntriesAfterRank InGetEntriesAfterRankDelegate);
372 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Challenges")
373 static
void GetEntriesByIds(UObject* WorldContextObject, const FString& ChallengeID,
int PageIdx,
int PageSize,
375 FChallengeGetEntriesByIds InGetEntriesByIdsDelegate);
386 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Challenges")
387 static
void GetList(UObject* WorldContextObject, FPico_ChallengeOptions ChallengeOptions,
int PageIdx,
int PageSize,
388 FChallengeGetList InGetListDelegate);
395 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Challenges")
396 static
void Join(UObject* WorldContextObject, const FString& ChallengeID, FChallengeJoin InJoinDelegate);
403 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Challenges")
404 static
void Leave(UObject* WorldContextObject, const FString& ChallengeID, FChallengeLeave InLeaveDelegate);
412 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Challenges")
413 static
void Invite(UObject* WorldContextObject, const FString& ChallengeID, const TArray<FString>& UserIDs,
414 FChallengeInvite Delegate);
421 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Challenges")
422 static
void LaunchInvitableUserFlow(UObject* WorldContextObject, const FString& ChallengeID, FChallengeLaunchInvitableUserFlow Delegate);
435 void InitParams(ppfChallenge* ppfChallengeHandle);
438 ppfChallengeCreationType CreationType;
439 unsigned long long EndDate = 0;
440 unsigned long long StartDate = 0;
442 FString Title = FString();
443 ppfChallengeVisibility Visibility;
454 UFUNCTION(BlueprintPure, Category =
"Pico Platform|Challenges|Challenge")
458 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
459 FDateTime GetEndDateTime();
462 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
463 FDateTime GetStartDateTime();
466 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
467 FString GetEndDate();
470 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
471 FString GetStartDate();
474 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
478 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
482 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
486 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
490 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
494 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge")
505 void InitParams(ppfChallengeEntryHandle ppfChallengeEntryHandle);
508 FString DisplayScore = FString();
509 TArray<uint8> ExtraData;
513 unsigned long long Timestamp;
520 UFUNCTION(BlueprintPure, Category =
"Pico Platform|Challenges|Challenge Entry")
521 FString GetDisplayScore();
524 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry")
525 TArray<uint8> GetExtraData();
528 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry")
529 FString GetExtraDataString();
532 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry")
536 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry")
540 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry")
544 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry")
545 FDateTime GetTimestamp();
548 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry")
559 TArray<UPico_ChallengeEntry*> ChallengeEntryArray;
562 bool bHasPreviousPage;
563 int32 TotalCount = 0;
565 void InitParams(ppfChallengeEntryArrayHandle InppfChallengeEntryArrayHandle);
568 UFUNCTION(BlueprintPure, Category =
"Pico Platform|Challenges|Challenge Entry Array")
572 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry Array")
576 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Entry Array")
593 TArray<UPico_Challenge*> ChallengeArray;
596 bool bHasPreviousPage;
597 int32 TotalCount = 0;
600 void InitParams(ppfChallengeArrayHandle InppfChallengeArrayHandle);
603 UFUNCTION(BlueprintPure, Category =
"Pico Platform|Challenges|Challenge Array")
607 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Array")
611 UFUNCTION(BlueprintPure, Category = "Pico Platform|Challenges|Challenge Array")
PicoChallengesInterface class.
Definition: Pico_Challenges.h:96
bool Leave(const FString &ChallengeID, FChallengeLeave InLeaveDelegate)
Lets the current user leave a challenge.
bool Join(const FString &ChallengeID, FChallengeJoin InJoinDelegate)
Lets the current user join a challenge.
bool GetList(FPico_ChallengeOptions ChallengeOptions, int PageIdx, int PageSize, FChallengeGetList InGetListDelegate)
Gets a list of challenges.
bool GetEntriesAfterRank(ppfID ChallengeID, int PageIdx, int PageSize, unsigned long long AfterRank, FChallengeGetEntriesAfterRank InGetEntriesAfterRankDelegate)
Gets the challenge entries after a specified ranking.
bool LaunchInvitableUserFlow(const FString &ChallengeID, FChallengeLaunchInvitableUserFlow Delegate)
Launches the invitation flow to let the current user invite friends to a specified challenge....
bool GetEntriesByIds(const FString &ChallengeID, int PageIdx, int PageSize, ELeaderboardStartAt StartAt, const TArray< FString > &UserIDs, FChallengeGetEntriesByIds InGetEntriesByIdsDelegate)
Gets the challenge entries for specified user(s).
bool Invite(const FString &ChallengeID, const TArray< FString > &UserIDs, FChallengeInvite Delegate)
Invites user(s) to join a challenge.
bool GetEntries(const FString &ChallengeID, int PageIdx, int PageSize, ELeaderboardFilterType Filter, ELeaderboardStartAt StartAt, FChallengeGetEntries InGetEntriesDelegate)
Gets a list of challenge entries.
bool Get(const FString &ChallengeID, FChallengeGet InGetDelegate)
Gets a specified challenge by ID.
OnlinePicoChallenges Blueprint Function class.
Definition: Pico_Challenges.h:295
UPico_ChallengeArray class.
Definition: Pico_Challenges.h:589
int32 GetSize()
Get the size of ChallengeEntryArray .
bool HasNextPage()
Get whether the list has the next page.
UPico_Challenge * GetElement(int32 Index)
Get ChallengeEntryArray element form Index.
UPico_ChallengeEntryArray class.
Definition: Pico_Challenges.h:555
UPico_ChallengeEntry class.
Definition: Pico_Challenges.h:501
UPico_Challenge class.
Definition: Pico_Challenges.h:431
UPico_Leaderboard class.
Definition: Pico_Leaderboards.h:384
UPico_UserArray class.
Definition: Pico_User.h:510
UPico_User class.
Definition: Pico_User.h:422
ELeaderboardStartAt
The type of sorting to use when getting leaderboard or challenge entries.
Definition: OnlineSubsystemPicoNames.h:658
EChallengeViewerFilter
The challenge viewer filter.
Definition: OnlineSubsystemPicoNames.h:647
EChallengeCreationType
The creator of the challenge.
Definition: OnlineSubsystemPicoNames.h:629
EChallengeVisibility
The visibility type of the challenge.
Definition: OnlineSubsystemPicoNames.h:638
ELeaderboardFilterType
The type of filter to use when using leaderboards or challenges.
Definition: OnlineSubsystemPicoNames.h:674