PICO Unreal Platform SDK
Pico_User.h
1// Copyright® 2015-2023 PICO Technology Co., Ltd. All rights reserved.
2#pragma once
3
4#include "CoreMinimal.h"
5#include "UObject/NoExportTypes.h"
6#include "PPF_Platform.h"
7#include "OnlineSubsystemPicoNames.h"
8#include "OnlineSubsystemPico.h"
9#include "Pico_Room.h"
10#include "Kismet/BlueprintFunctionLibrary.h"
11#include "Pico_User.generated.h"
12
14
15DECLARE_LOG_CATEGORY_EXTERN(PicoUser, Log, All);
16
17class UPico_Room;
18
22DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriendsAndRooms, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
23DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserAndRoomArrayPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
24DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriends, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
25DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
26DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoginUser, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
27DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetUserInfo, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
28DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetPermissionResult, bool, bIsError, const FString&, ErrorMessage, UPico_PermissionResult*, PermissionResult);
29DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetAccessTokenResult, bool, bIsError, const FString&, ErrorMessage, const FString&, AccessToken);
30DECLARE_DYNAMIC_DELEGATE_FourParams(FLaunchFriendRequestResult, bool, bIsError, const FString&, ErrorMessage, bool, bDidCancel, bool, bDidSendRequest);
31DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetUserRelationResult, bool, bIsError, const FString&, ErrorMessage, UPico_UserRelationResult*, UserRelationResult);
32DECLARE_DYNAMIC_DELEGATE_FourParams(FEntitlementCheckResult, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_EntitlementCheckResult*, EntitlementCheck);
33DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetIDToken, bool, bIsError, const FString&, ErrorMessage, const FString&, IDToken);
34DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetOrgScopedID, bool, bIsError, const FString&, ErrorMessage, UPico_OrgScopedID*, OrgScopedID);
35
47class ONLINESUBSYSTEMPICO_API FPicoUserInterface
48{
49private:
50
51 FOnlineSubsystemPico& PicoSubsystem;
52
53public:
54 FPicoUserInterface(FOnlineSubsystemPico& InSubsystem);
56
57 FGetLoginUser GetLoginUserDelegate;
58 FGetLoggedInUserFriendsAndRooms GetLoggedInUserFriendsAndRoomsDelegate;
59 FGetNextUserAndRoomArrayPage GetNextUserAndRoomArrayPageDelegate;
60 FGetLoggedInUserFriends GetLoggedInUserFriendsDelegate;
61 FGetNextUserPage GetNextUserFriendsPageDelegate;
62 FGetUserInfo GetUserInfoDelegate;
63 FGetPermissionResult GetAuthorizePermissionsDelegate;
64 FGetPermissionResult RequestUserPermissionsDelegate;
65 FLaunchFriendRequestResult LaunchFriendRequestDelegate;
66 FGetAccessTokenResult GetAccesstokenDelegate;
67 FGetUserRelationResult GetUserRelationDelegate;
68 FEntitlementCheckResult EntitlementCheckResultDelegate;
69 FGetIDToken GetIDTokenDelegate;
70 FGetOrgScopedID GetOrgScopedIDDelegate;
80 bool GetLoginUser(FGetLoginUser InGetLoginUserDelegate);
81
92 bool GetUserInfo(const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
93
103 bool GetLoggedInUserAndRoom(FGetLoggedInUserFriendsAndRooms OnGetLoggedInuserFriendsAndRoomsCallback);
104
115 bool GetNextUserAndRoomArrayPage(UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage OnGetNextUserAndRoomArrayPageCallback);
116
126 bool GetUserFriends(FGetLoggedInUserFriends OnGetLoggedInUserFriendsCallback);
127
138 bool GetNextUserPage(UPico_UserArray* InUserArray, FGetNextUserPage OnGetNextUserPageCallback);
139
151 bool GetAuthorizePermissions(FGetPermissionResult OnGetPermissionResultCallback);
152
170 bool RequestUserPermissions(TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
171
184 bool LaunchFriendRequestFlow(const FString& UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback);
185
198 bool GetAccessToken(FGetAccessTokenResult OnGetAccessTokenResultCallback);
199
215 bool GetRelations(TArray<FString> UserIDs, FGetUserRelationResult OnGetUserRelationResultCallback);
216
231 bool EntitlementCheck(bool bKillApp, FEntitlementCheckResult OnEntitlementCheckResultCallback);
232
247 bool GetIDToken(FGetIDToken OnGetIDTokenResultCallback);
248
262 bool GetOrgScopedID(const FString& UserId, FGetOrgScopedID OnGetOrgScopedIDCallback);
263};
279UCLASS()
280class ONLINESUBSYSTEMPICO_API UOnlinePicoUserFunction : public UBlueprintFunctionLibrary
281{
282 GENERATED_BODY()
283
284
285public:
286
297 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
298 static void PicoGetLoggedInUserAndRoom(UObject* WorldContextObject, FGetLoggedInUserFriendsAndRooms InGetLoggedInuserFriendsAndRoomsCallback);
299
311 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
312 static void PicoGetNextUserAndRoomArrayPage(UObject* WorldContextObject, UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage InGetNextUserAndRoomArrayPageCallback);
313
314
325 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
326 static void PicoGetUserFriends(UObject* WorldContextObject, FGetLoggedInUserFriends InGetLoggedInUserFriendsDelegate);
327
339 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
340 static void PicoGetNextUserPage(UObject* WorldContextObject, UPico_UserArray* InUserArray, FGetNextUserPage InGetNextUserPageDelegate);
341
352 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
353 static bool GetLoginUser(UObject* WorldContextObject, FGetLoginUser InGetLoginUserDelegate);
354
366 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
367 static bool GetPicoUserInfo(UObject* WorldContextObject, const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
368
381 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
382 static bool GetAuthorizePermissions(UObject* WorldContextObject, FGetPermissionResult OnGetPermissionResultCallback);
383
384
403 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
404 static bool RequestUserPermissions(UObject* WorldContextObject, TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
405
419 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
420 static bool LaunchFriendRequestFlow(UObject* WorldContextObject, const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback);
421
435 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
436 static bool GetAccessToken(UObject* WorldContextObject, FGetAccessTokenResult OnGetAccessTokenResultCallback);
437
454 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
455 static bool GetRelations(UObject* WorldContextObject, TArray<FString> UserIDs, FGetUserRelationResult OnGetUserRelationResultCallback);
456
472 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
473 static bool EntitlementCheck(UObject* WorldContextObject, bool bKillApp, FEntitlementCheckResult OnEntitlementCheckResultCallback);
474
489 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
490 static bool GetIDToken(UObject* WorldContextObject, FGetIDToken OnGetIDTokenResultCallback);
491
505 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
506 static bool GetOrgScopedID(UObject* WorldContextObject, const FString& UserId, FGetOrgScopedID OnGetOrgScopedIDCallback);
507};
508 // end of BP_User // end of BlueprintFunction
511
513UCLASS(BlueprintType)
514class ONLINESUBSYSTEMPICO_API UPico_User : public UObject
515{
516 GENERATED_BODY()
517public:
518 void InitParams(ppfUser* ppfUserHandle);
519
520private:
521 FString DisplayName = FString();
522 FString ImageUrl = FString();
523 FString ID = FString();
524 FString InviteToken = FString();
525 FString SmallImageUrl = FString();
526 FString PresencePackage = FString();
528 EUserGender UserGender = EUserGender::Unknow;
529 FString Presence = FString();
530 FString PresenceDeeplinkMessage = FString();
531 FString PresenceDestinationApiName = FString();
532 FString PresenceLobbySessionId = FString();
533 FString PresenceMatchSessionId = FString();
534 FString PresenceExtra = FString();
535 FString StoreRegion = FString();
536 bool PresenceIsJoinable = false;
537
538public:
539
541 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
542 FString GetDisplayName();
543
545 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
546 FString GetImageURL();
547
549 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
550 FString GetID();
551
553 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
554 FString GetInviteToken();
555
557 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
558 FString GetSmallImageUrl();
559
561 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
562 FString GetPresencePackage();
563
565 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
566 EUserPresenceStatus GetUserPresenceStatus();
567
569 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
570 EUserGender GetGender();
571
573 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
574 FString GetPresence();
575
577 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
578 FString GetPresenceDeeplinkMessage();
579
581 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
582 FString GetPresenceDestinationApiName();
583
585 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
586 FString GetPresenceLobbySessionId();
587
589 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
590 FString GetPresenceMatchSessionId();
591
593 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
594 FString GetPresenceExtra();
595
597 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
598 FString GetStoreRegion();
599
601 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
602 bool GetPresenceIsJoinable();
603};
604
606UCLASS(BlueprintType)
607class ONLINESUBSYSTEMPICO_API UPico_UserArray : public UObject
608{
609
610 GENERATED_BODY()
611
612public:
613 void InitParams(ppfUserArray* InppfUserArrayHandle);
614
615private:
616 UPROPERTY()
617 TArray<UPico_User*> UserArray;
618 FString NextPageParam;
619 int32 Size;
620 bool bHasNextPage;
621
622public:
623
625 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
626 UPico_User* GetElement(int32 Index);
627
628 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
629 FString GetNextPageParam();
630
632 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
633 int32 GetSize();
634
636 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
637 bool HasNextPage();
638
639};
640
642UCLASS(BlueprintType)
643class ONLINESUBSYSTEMPICO_API UPico_UserAndRoom : public UObject
644{
645
646 GENERATED_BODY()
647private:
648 UPROPERTY()
649 UPico_Room* Room = nullptr;
650
651 UPROPERTY()
652 UPico_User* User = nullptr;
653public:
654 void InitParams(ppfUserAndRoom* InppfUserAndRoomHandle);
655
657 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
658 UPico_Room* GetRoom();
659
661 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
662 UPico_User* GetUser();
663};
664
666UCLASS(BlueprintType)
667class ONLINESUBSYSTEMPICO_API UPico_UserAndRoomArray : public UObject
668{
669
670 GENERATED_BODY()
671
672private:
673 UPROPERTY()
674 TArray<UPico_UserAndRoom*> UserAndRoomArray;
675 FString NextPageParam = FString();
676 int32 Size = 0;
677 bool bHasNextPage;
678public:
679 void InitParams(ppfUserAndRoomArray* InppfUserAndRoomArrayHandle);
680
682 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
683 UPico_UserAndRoom* GetElement(int32 Index);
684
685
686 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
687 FString GetNextPageParam();
688
690 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
691 int32 GetSize();
692
694 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
695 bool HasNextPage();
696};
697
699UCLASS(BlueprintType)
700class ONLINESUBSYSTEMPICO_API UPico_PermissionResult : public UObject
701{
702 GENERATED_BODY()
703
704private:
705 UPROPERTY()
706 TArray<FString> AuthorizedPermissions;
707 int32 Size = 0;
708 FString AccessionToken = FString();
709 FString UserID = FString();
710public:
711 void InitParams(ppfPermissionResult* InppfPermissionResultHandle);
712
714 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
715 FString GetAuthorizedPermission(int32 Index);
716
718 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
719 int32 GetSize();
720
722 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
723 FString GetAccessToken();
724
726 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
727 FString GetUserID();
728};
729
731UCLASS(BlueprintType)
732class ONLINESUBSYSTEMPICO_API UPico_UserRelationResult : public UObject
733{
734 GENERATED_BODY()
735
736private:
737
738 // <UserId, Userrelationtype>
739 UPROPERTY()
740 TMap<FString, EUserRelationType> UserRelationMap;
741
742 int32 RelationMapSize;
743
744 TArray<FString> UserIDArray;
745
746public:
747 void InitParams(ppfUserRelationResult* InppfUserRelationResultHandle);
748
750 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
751 int32 Contains(FString Key);
752
754 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
755 FString GetUserID(int32 Index);
756
758 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
759 int32 GetRelationMapSize();
760
762 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
763 EUserRelationType GetRelationTypeValue(FString Key);
764};
765
767UCLASS(BlueprintType)
768class ONLINESUBSYSTEMPICO_API UPico_EntitlementCheckResult : public UObject
769{
770 GENERATED_BODY()
771
772private:
773 bool bHasEntitlement = false;
774
775 int32 StatusCode = -1;
776
777 FString StatusMessage = FString();
778
779public:
780 void InitParams(ppfEntitlementCheckResult* InppfEntitlementCheckResultHandle);
781
783 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|EntitlementCheckResult")
784 bool GetHasEntitlement();
785
787 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|EntitlementCheckResult")
788 int32 GetStatusCode();
789
791 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|EntitlementCheckResult")
792 FString GetStatusMessage();
793};
794
796UCLASS(BlueprintType)
797class ONLINESUBSYSTEMPICO_API UPico_OrgScopedID : public UObject
798{
799 GENERATED_BODY()
800
801private:
802 FString ID = FString();
803
804public:
805 void InitParams(ppfOrgScopedID* InppfOrgScopedIDHandle);
806
808 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|OrgScopedID")
809 FString GetID();
810};
811
812//
PicoUserInterface class.
Definition: Pico_User.h:48
bool GetUserFriends(FGetLoggedInUserFriends OnGetLoggedInUserFriendsCallback)
Gets the friend list of the current user. Friends who don't use this app won't appear in this list.
bool LaunchFriendRequestFlow(const FString &UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback)
Launches the flow to apply for friendship with someone.
bool GetNextUserPage(UPico_UserArray *InUserArray, FGetNextUserPage OnGetNextUserPageCallback)
Gets the next page of user list.
bool GetLoggedInUserAndRoom(FGetLoggedInUserFriendsAndRooms OnGetLoggedInuserFriendsAndRoomsCallback)
Gets the friends of the logged-in user and the rooms the friends might be in. If a friend is not in a...
bool EntitlementCheck(bool bKillApp, FEntitlementCheckResult OnEntitlementCheckResultCallback)
Gets whether the player has entitlement to use the app in the current state.
bool GetAccessToken(FGetAccessTokenResult OnGetAccessTokenResultCallback)
Gets current login user's AccessToken. The system caches the access token upon the first request,...
bool RequestUserPermissions(TArray< FString > Permissions, FGetPermissionResult OnGetPermissionResultCallback)
Requests user permissions. The user will received a pop-up notification window.
bool GetIDToken(FGetIDToken OnGetIDTokenResultCallback)
Gets the ID token of the current user. ID token is for OIDC login. China's issuer url is https://plat...
bool GetAuthorizePermissions(FGetPermissionResult OnGetPermissionResultCallback)
Gets the authorized permissions.
bool GetRelations(TArray< FString > UserIDs, FGetUserRelationResult OnGetUserRelationResultCallback)
Gets the relationship between a specified user and other user(s).
bool GetOrgScopedID(const FString &UserId, FGetOrgScopedID OnGetOrgScopedIDCallback)
Gets a user's organization ID. In an organization's apps, each user is assigned a unique organization...
bool GetUserInfo(const FString &UserId, FGetUserInfo InGetUserInfoDelegate)
Gets the information by user ID.
bool GetNextUserAndRoomArrayPage(UPico_UserAndRoomArray *InUserAndRoomArray, FGetNextUserAndRoomArrayPage OnGetNextUserAndRoomArrayPageCallback)
Get the next page of the list of rooms where the friends of the currently logged in user are located.
bool GetLoginUser(FGetLoginUser InGetLoginUserDelegate)
Gets the information about the current logged-in user.
OnlinePicoUser Blueprint Function class.
Definition: Pico_User.h:281
UPico_EntitlementCheckResult class.
Definition: Pico_User.h:769
UPico_OrgScopedID class.
Definition: Pico_User.h:798
UPico_PermissionResult class.
Definition: Pico_User.h:701
UPico_Room class.
Definition: Pico_Room.h:639
UPico_UserAndRoomArray class.
Definition: Pico_User.h:668
UPico_UserAndRoom class.
Definition: Pico_User.h:644
UPico_UserArray class.
Definition: Pico_User.h:608
UPico_User class.
Definition: Pico_User.h:515
UPico_UserRelationResult class.
Definition: Pico_User.h:733
EUserPresenceStatus
User's current online status.
Definition: OnlineSubsystemPicoNames.h:26
EUserGender
User's gender.
Definition: OnlineSubsystemPicoNames.h:36
EUserRelationType
User relation type.
Definition: OnlineSubsystemPicoNames.h:880