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 "Pico_User.generated.h"
11
13
14DECLARE_LOG_CATEGORY_EXTERN(PicoUser, Log, All);
15
16class UPico_Room;
17
21DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriendsAndRooms, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
22DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserAndRoomArrayPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
23DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriends, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
24DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
25DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoginUser, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
26DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetUserInfo, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
27DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetPermissionResult, bool, bIsError, const FString&, ErrorMessage, UPico_PermissionResult*, PermissionResult);
28DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetAccessTokenResult, bool, bIsError, const FString&, ErrorMessage, const FString&, AccessToken);
29DECLARE_DYNAMIC_DELEGATE_FourParams(FLaunchFriendRequestResult, bool, bIsError, const FString&, ErrorMessage, bool, bDidCancel, bool, bDidSendRequest);
30DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetUserRelationResult, bool, bIsError, const FString&, ErrorMessage, UPico_UserRelationResult*, UserRelationResult);
31DECLARE_DYNAMIC_DELEGATE_FourParams(FEntitlementCheckResult, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_EntitlementCheckResult*, EntitlementCheck);
32DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetIDToken, bool, bIsError, const FString&, ErrorMessage, const FString&, IDToken);
33
45class ONLINESUBSYSTEMPICO_API FPicoUserInterface
46{
47private:
48
49 FOnlineSubsystemPico& PicoSubsystem;
50
51public:
52 FPicoUserInterface(FOnlineSubsystemPico& InSubsystem);
54
55 FGetLoginUser GetLoginUserDelegate;
56 FGetLoggedInUserFriendsAndRooms GetLoggedInUserFriendsAndRoomsDelegate;
57 FGetNextUserAndRoomArrayPage GetNextUserAndRoomArrayPageDelegate;
58 FGetLoggedInUserFriends GetLoggedInUserFriendsDelegate;
59 FGetNextUserPage GetNextUserFriendsPageDelegate;
60 FGetUserInfo GetUserInfoDelegate;
61 FGetPermissionResult GetAuthorizePermissionsDelegate;
62 FGetPermissionResult RequestUserPermissionsDelegate;
63 FLaunchFriendRequestResult LaunchFriendRequestDelegate;
64 FGetAccessTokenResult GetAccesstokenDelegate;
65 FGetUserRelationResult GetUserRelationDelegate;
66 FEntitlementCheckResult EntitlementCheckResultDelegate;
67 FGetIDToken GetIDTokenDelegate;
77 bool GetLoginUser(FGetLoginUser InGetLoginUserDelegate);
78
89 bool GetUserInfo(const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
90
100 bool GetLoggedInUserAndRoom(FGetLoggedInUserFriendsAndRooms OnGetLoggedInuserFriendsAndRoomsCallback);
101
112 bool GetNextUserAndRoomArrayPage(UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage OnGetNextUserAndRoomArrayPageCallback);
113
123 bool GetUserFriends(FGetLoggedInUserFriends OnGetLoggedInUserFriendsCallback);
124
135 bool GetNextUserPage(UPico_UserArray* InUserArray, FGetNextUserPage OnGetNextUserPageCallback);
136
148 bool GetAuthorizePermissions(FGetPermissionResult OnGetPermissionResultCallback);
149
167 bool RequestUserPermissions(TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
168
181 bool LaunchFriendRequestFlow(const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback);
182
194 bool GetAccessToken(FGetAccessTokenResult OnGetAccessTokenResultCallback);
195
211 bool GetRelations(TArray<FString> UserIDs, FGetUserRelationResult OnGetUserRelationResultCallback);
212
227 bool EntitlementCheck(bool bKillApp, FEntitlementCheckResult OnEntitlementCheckResultCallback);
228
229 bool GetIDToken(FGetIDToken OnGetIDTokenResultCallback);
230};
246UCLASS()
247class ONLINESUBSYSTEMPICO_API UOnlinePicoUserFunction : public UBlueprintFunctionLibrary
248{
249 GENERATED_BODY()
250
251
252public:
253
264 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
265 static void PicoGetLoggedInUserAndRoom(UObject* WorldContextObject, FGetLoggedInUserFriendsAndRooms InGetLoggedInuserFriendsAndRoomsCallback);
266
278 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
279 static void PicoGetNextUserAndRoomArrayPage(UObject* WorldContextObject, UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage InGetNextUserAndRoomArrayPageCallback);
280
281
292 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
293 static void PicoGetUserFriends(UObject* WorldContextObject, FGetLoggedInUserFriends InGetLoggedInUserFriendsDelegate);
294
306 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
307 static void PicoGetNextUserPage(UObject* WorldContextObject, UPico_UserArray* InUserArray, FGetNextUserPage InGetNextUserPageDelegate);
308
319 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
320 static bool GetLoginUser(UObject* WorldContextObject, FGetLoginUser InGetLoginUserDelegate);
321
333 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
334 static bool GetPicoUserInfo(UObject* WorldContextObject, const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
335
348 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
349 static bool GetAuthorizePermissions(UObject* WorldContextObject, FGetPermissionResult OnGetPermissionResultCallback);
350
351
370 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
371 static bool RequestUserPermissions(UObject* WorldContextObject, TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
372
386 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
387 static bool LaunchFriendRequestFlow(UObject* WorldContextObject, const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback);
388
401 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
402 static bool GetAccessToken(UObject* WorldContextObject, FGetAccessTokenResult OnGetAccessTokenResultCallback);
403
420 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
421 static bool GetRelations(UObject* WorldContextObject, TArray<FString> UserIDs, FGetUserRelationResult OnGetUserRelationResultCallback);
422
438 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
439 static bool EntitlementCheck(UObject* WorldContextObject, bool bKillApp, FEntitlementCheckResult OnEntitlementCheckResultCallback);
440
441 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
442 static bool GetIDToken(UObject* WorldContextObject, FGetIDToken OnGetIDTokenResultCallback);
443};
444 // end of BP_User // end of BlueprintFunction
447
449UCLASS(BlueprintType)
450class ONLINESUBSYSTEMPICO_API UPico_User : public UObject
451{
452 GENERATED_BODY()
453public:
454 void InitParams(ppfUser* ppfUserHandle);
455
456private:
457 FString DisplayName = FString();
458 FString ImageUrl = FString();
459 FString ID = FString();
460 FString InviteToken = FString();
461 FString SmallImageUrl = FString();
462 FString PresencePackage = FString();
464 EUserGender UserGender = EUserGender::Unknow;
465 FString Presence = FString();
466 FString PresenceDeeplinkMessage = FString();
467 FString PresenceDestinationApiName = FString();
468 FString PresenceLobbySessionId = FString();
469 FString PresenceMatchSessionId = FString();
470 FString PresenceExtra = FString();
471 FString StoreRegion = FString();
472
473public:
474
476 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
477 FString GetDisplayName();
478
480 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
481 FString GetImageURL();
482
484 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
485 FString GetID();
486
488 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
489 FString GetInviteToken();
490
492 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
493 FString GetSmallImageUrl();
494
496 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
497 FString GetPresencePackage();
498
500 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
501 EUserPresenceStatus GetUserPresenceStatus();
502
504 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
505 EUserGender GetGender();
506
508 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
509 FString GetPresence();
510
512 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
513 FString GetPresenceDeeplinkMessage();
514
516 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
517 FString GetPresenceDestinationApiName();
518
520 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
521 FString GetPresenceLobbySessionId();
522
524 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
525 FString GetPresenceMatchSessionId();
526
528 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
529 FString GetPresenceExtra();
530
532 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
533 FString GetStoreRegion();
534};
535
537UCLASS(BlueprintType)
538class ONLINESUBSYSTEMPICO_API UPico_UserArray : public UObject
539{
540
541 GENERATED_BODY()
542
543public:
544 void InitParams(ppfUserArray* InppfUserArrayHandle);
545
546private:
547 UPROPERTY()
548 TArray<UPico_User*> UserArray;
549 FString NextPageParam;
550 int32 Size;
551 bool bHasNextPage;
552
553public:
554
556 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
557 UPico_User* GetElement(int32 Index);
558
559 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
560 FString GetNextPageParam();
561
563 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
564 int32 GetSize();
565
567 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
568 bool HasNextPage();
569
570};
571
573UCLASS(BlueprintType)
574class ONLINESUBSYSTEMPICO_API UPico_UserAndRoom : public UObject
575{
576
577 GENERATED_BODY()
578private:
579 UPROPERTY()
580 UPico_Room* Room = nullptr;
581
582 UPROPERTY()
583 UPico_User* User = nullptr;
584public:
585 void InitParams(ppfUserAndRoom* InppfUserAndRoomHandle);
586
588 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
589 UPico_Room* GetRoom();
590
592 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
593 UPico_User* GetUser();
594};
595
597UCLASS(BlueprintType)
598class ONLINESUBSYSTEMPICO_API UPico_UserAndRoomArray : public UObject
599{
600
601 GENERATED_BODY()
602
603private:
604 UPROPERTY()
605 TArray<UPico_UserAndRoom*> UserAndRoomArray;
606 FString NextPageParam = FString();
607 int32 Size = 0;
608 bool bHasNextPage;
609public:
610 void InitParams(ppfUserAndRoomArray* InppfUserAndRoomArrayHandle);
611
613 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
614 UPico_UserAndRoom* GetElement(int32 Index);
615
616
617 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
618 FString GetNextPageParam();
619
621 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
622 int32 GetSize();
623
625 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
626 bool HasNextPage();
627};
628
630UCLASS(BlueprintType)
631class ONLINESUBSYSTEMPICO_API UPico_PermissionResult : public UObject
632{
633 GENERATED_BODY()
634
635private:
636 UPROPERTY()
637 TArray<FString> AuthorizedPermissions;
638 int32 Size = 0;
639 FString AccessionToken = FString();
640 FString UserID = FString();
641public:
642 void InitParams(ppfPermissionResult* InppfPermissionResultHandle);
643
645 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
646 FString GetAuthorizedPermission(int32 Index);
647
649 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
650 int32 GetSize();
651
653 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
654 FString GetAccessToken();
655
657 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
658 FString GetUserID();
659};
660
662UCLASS(BlueprintType)
663class ONLINESUBSYSTEMPICO_API UPico_UserRelationResult : public UObject
664{
665 GENERATED_BODY()
666
667private:
668
669 // <UserId, Userrelationtype>
670 UPROPERTY()
671 TMap<FString, EUserRelationType> UserRelationMap;
672
673 int32 RelationMapSize;
674
675 TArray<FString> UserIDArray;
676
677public:
678 void InitParams(ppfUserRelationResult* InppfUserRelationResultHandle);
679
681 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
682 int32 Contains(FString Key);
683
685 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
686 FString GetUserID(int32 Index);
687
689 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
690 int32 GetRelationMapSize();
691
693 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
694 EUserRelationType GetRelationTypeValue(FString Key);
695};
696
698UCLASS(BlueprintType)
699class ONLINESUBSYSTEMPICO_API UPico_EntitlementCheckResult : public UObject
700{
701 GENERATED_BODY()
702
703private:
704 bool bHasEntitlement = false;
705
706 int32 StatusCode = -1;
707
708 FString StatusMessage = FString();
709
710public:
711 void InitParams(ppfEntitlementCheckResult* InppfEntitlementCheckResultHandle);
712
714 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|EntitlementCheckResult")
715 bool GetHasEntitlement();
716
718 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|EntitlementCheckResult")
719 int32 GetStatusCode();
720
722 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|EntitlementCheckResult")
723 FString GetStatusMessage();
724};
725
726
727
728//
PicoUserInterface class.
Definition: Pico_User.h:46
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 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.
bool RequestUserPermissions(TArray< FString > Permissions, FGetPermissionResult OnGetPermissionResultCallback)
Requests user permissions. The user will received a pop-up notification window.
bool GetAuthorizePermissions(FGetPermissionResult OnGetPermissionResultCallback)
Gets the authorized permissions.
bool LaunchFriendRequestFlow(const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback)
Launches the flow to apply for friendship with someone.
bool GetRelations(TArray< FString > UserIDs, FGetUserRelationResult OnGetUserRelationResultCallback)
Gets the relationship between a specified user and other user(s).
bool GetUserInfo(const FString &UserId, FGetUserInfo InGetUserInfoDelegate)
Gets the information by user ID.
bool GetNextUserAndRoomArrayPage(UPico_UserAndRoomArray *InUserAndRoomArray, FGetNextUserAndRoomArrayPage OnGetNextUserAndRoomArrayPageCallback)
Gets the friend list of the current user.
bool GetLoginUser(FGetLoginUser InGetLoginUserDelegate)
Gets the information about the current logged-in user.
OnlinePicoUser Blueprint Function class.
Definition: Pico_User.h:248
UPico_EntitlementCheckResult class.
Definition: Pico_User.h:700
UPico_PermissionResult class.
Definition: Pico_User.h:632
UPico_Room class.
Definition: Pico_Room.h:638
UPico_UserAndRoomArray class.
Definition: Pico_User.h:599
UPico_UserAndRoom class.
Definition: Pico_User.h:575
UPico_UserArray class.
Definition: Pico_User.h:539
UPico_User class.
Definition: Pico_User.h:451
UPico_UserRelationResult class.
Definition: Pico_User.h:664
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