PICO Unreal Platform SDK
Pico_User.h
1/*******************************************************************************
2Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
3
4NOTICE:All information contained herein is, and remains the property of
5PICO Technology Co., Ltd. The intellectual and technical concepts
6contained herein are proprietary to PICO Technology Co., Ltd. and may be
7covered by patents, patents in process, and are protected by trade secret or
8copyright law. Dissemination of this information or reproduction of this
9material is strictly forbidden unless prior written permission is obtained from
10PICO Technology Co., Ltd.
11*******************************************************************************/
12// This plugin incorporates portions of the Unreal® Engine. Unreal® is a trademark or registered trademark of Epic Games, Inc.In the United States of America and elsewhere.
13// Unreal® Engine, Copyright 1998 – 2022, Epic Games, Inc.All rights reserved.
14#pragma once
15
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_Room.h"
22#include "Pico_User.generated.h"
23
25
26DECLARE_LOG_CATEGORY_EXTERN(PicoUser, Log, All);
27
28class UPico_Room;
29
33DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriendsAndRooms, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
34DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserAndRoomArrayPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
35DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriends, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
36DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
37DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoginUser, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
38DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetUserInfo, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
39DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetPermissionResult, bool, bIsError, const FString&, ErrorMessage, UPico_PermissionResult*, PermissionResult);
40DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetAccessTokenResult, bool, bIsError, const FString&, ErrorMessage, const FString&, AccessToken);
41DECLARE_DYNAMIC_DELEGATE_FourParams(FLaunchFriendRequestResult, bool, bIsError, const FString&, ErrorMessage, bool, bDidCancel, bool, bDidSendRequest);
42DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetUserRelationResult, bool, bIsError, const FString&, ErrorMessage, UPico_UserRelationResult*, UserRelationResult);
43
55class ONLINESUBSYSTEMPICO_API FPicoUserInterface
56{
57private:
58
59 FOnlineSubsystemPico& PicoSubsystem;
60
61public:
62 FPicoUserInterface(FOnlineSubsystemPico& InSubsystem);
64
65 FGetLoginUser GetLoginUserDelegate;
66 FGetLoggedInUserFriendsAndRooms GetLoggedInUserFriendsAndRoomsDelegate;
67 FGetNextUserAndRoomArrayPage GetNextUserAndRoomArrayPageDelegate;
68 FGetLoggedInUserFriends GetLoggedInUserFriendsDelegate;
69 FGetNextUserPage GetNextUserFriendsPageDelegate;
70 FGetUserInfo GetUserInfoDelegate;
71 FGetPermissionResult GetAuthorizePermissionsDelegate;
72 FGetPermissionResult RequestUserPermissionsDelegate;
73 FLaunchFriendRequestResult LaunchFriendRequestDelegate;
74 FGetAccessTokenResult GetAccesstokenDelegate;
75 FGetUserRelationResult GetUserRelationDelegate;
76
86 bool GetLoginUser(FGetLoginUser InGetLoginUserDelegate);
87
98 bool GetUserInfo(const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
99
109 bool GetLoggedInUserAndRoom(FGetLoggedInUserFriendsAndRooms OnGetLoggedInuserFriendsAndRoomsCallback);
110
121 bool GetNextUserAndRoomArrayPage(UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage OnGetNextUserAndRoomArrayPageCallback);
122
132 bool GetUserFriends(FGetLoggedInUserFriends OnGetLoggedInUserFriendsCallback);
133
144 bool GetNextUserPage(UPico_UserArray* InUserArray, FGetNextUserPage OnGetNextUserPageCallback);
145
157 bool GetAuthorizePermissions(FGetPermissionResult OnGetPermissionResultCallback);
158
176 bool RequestUserPermissions(TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
177
190 bool LaunchFriendRequestFlow(const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback);
191
203 bool GetAccessToken(FGetAccessTokenResult OnGetAccessTokenResultCallback);
204
208
221 bool GetRelations(TArray<FString> UserIDs, FGetUserRelationResult OnGetUserRelationResultCallback);
222};
238UCLASS()
239class ONLINESUBSYSTEMPICO_API UOnlinePicoUserFunction : public UBlueprintFunctionLibrary
240{
241 GENERATED_BODY()
242
243
244public:
245
256 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
257 static void PicoGetLoggedInUserAndRoom(UObject* WorldContextObject, FGetLoggedInUserFriendsAndRooms InGetLoggedInuserFriendsAndRoomsCallback);
258
270 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
271 static void PicoGetNextUserAndRoomArrayPage(UObject* WorldContextObject, UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage InGetNextUserAndRoomArrayPageCallback);
272
273
284 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
285 static void PicoGetUserFriends(UObject* WorldContextObject, FGetLoggedInUserFriends InGetLoggedInUserFriendsDelegate);
286
298 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
299 static void PicoGetNextUserPage(UObject* WorldContextObject, UPico_UserArray* InUserArray, FGetNextUserPage InGetNextUserPageDelegate);
300
311 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
312 static bool GetLoginUser(UObject* WorldContextObject, FGetLoginUser InGetLoginUserDelegate);
313
325 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
326 static bool GetPicoUserInfo(UObject* WorldContextObject, const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
327
340 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
341 static bool GetAuthorizePermissions(UObject* WorldContextObject, FGetPermissionResult OnGetPermissionResultCallback);
342
343
362 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
363 static bool RequestUserPermissions(UObject* WorldContextObject, TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
364
378 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
379 static bool LaunchFriendRequestFlow(UObject* WorldContextObject, const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback);
380
393 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
394 static bool GetAccessToken(UObject* WorldContextObject, FGetAccessTokenResult OnGetAccessTokenResultCallback);
395
412 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
413 static bool GetRelations(UObject* WorldContextObject, TArray<FString> UserIDs, FGetUserRelationResult OnGetUserRelationResultCallback);
414};
415 // end of BP_User // end of BlueprintFunction
418
420UCLASS(BlueprintType)
421class ONLINESUBSYSTEMPICO_API UPico_User : public UObject
422{
423 GENERATED_BODY()
424public:
425 void InitParams(ppfUser* ppfUserHandle);
426
427private:
428 FString DisplayName = FString();
429 FString ImageUrl = FString();
430 FString ID = FString();
431 FString InviteToken = FString();
432 FString SmallImageUrl = FString();
433 FString PresencePackage = FString();
435 EUserGender UserGender = EUserGender::Unknow;
436 FString Presence = FString();
437 FString PresenceDeeplinkMessage = FString();
438 FString PresenceDestinationApiName = FString();
439 FString PresenceLobbySessionId = FString();
440 FString PresenceMatchSessionId = FString();
441 FString PresenceExtra = FString();
442 FString StoreRegion = FString();
443
444public:
445
447 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
448 FString GetDisplayName();
449
451 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
452 FString GetImageURL();
453
455 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
456 FString GetID();
457
459 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
460 FString GetInviteToken();
461
463 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
464 FString GetSmallImageUrl();
465
467 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
468 FString GetPresencePackage();
469
471 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
472 EUserPresenceStatus GetUserPresenceStatus();
473
475 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
476 EUserGender GetGender();
477
479 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
480 FString GetPresence();
481
483 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
484 FString GetPresenceDeeplinkMessage();
485
487 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
488 FString GetPresenceDestinationApiName();
489
491 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
492 FString GetPresenceLobbySessionId();
493
495 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
496 FString GetPresenceMatchSessionId();
497
499 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
500 FString GetPresenceExtra();
501
503 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
504 FString GetStoreRegion();
505};
506
508UCLASS(BlueprintType)
509class ONLINESUBSYSTEMPICO_API UPico_UserArray : public UObject
510{
511
512 GENERATED_BODY()
513
514public:
515 void InitParams(ppfUserArray* InppfUserArrayHandle);
516
517private:
518 UPROPERTY()
519 TArray<UPico_User*> UserArray;
520 FString NextPageParam;
521 int32 Size;
522 bool bHasNextPage;
523
524public:
525
527 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
528 UPico_User* GetElement(int32 Index);
529
530 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
531 FString GetNextPageParam();
532
534 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
535 int32 GetSize();
536
538 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
539 bool HasNextPage();
540
541};
542
544UCLASS(BlueprintType)
545class ONLINESUBSYSTEMPICO_API UPico_UserAndRoom : public UObject
546{
547
548 GENERATED_BODY()
549private:
550 UPROPERTY()
551 UPico_Room* Room = nullptr;
552
553 UPROPERTY()
554 UPico_User* User = nullptr;
555public:
556 void InitParams(ppfUserAndRoom* InppfUserAndRoomHandle);
557
559 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
560 UPico_Room* GetRoom();
561
563 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
564 UPico_User* GetUser();
565};
566
568UCLASS(BlueprintType)
569class ONLINESUBSYSTEMPICO_API UPico_UserAndRoomArray : public UObject
570{
571
572 GENERATED_BODY()
573
574private:
575 UPROPERTY()
576 TArray<UPico_UserAndRoom*> UserAndRoomArray;
577 FString NextPageParam = FString();
578 int32 Size = 0;
579 bool bHasNextPage;
580public:
581 void InitParams(ppfUserAndRoomArray* InppfUserAndRoomArrayHandle);
582
584 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
585 UPico_UserAndRoom* GetElement(int32 Index);
586
587
588 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
589 FString GetNextPageParam();
590
592 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
593 int32 GetSize();
594
596 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
597 bool HasNextPage();
598};
599
601UCLASS(BlueprintType)
602class ONLINESUBSYSTEMPICO_API UPico_PermissionResult : public UObject
603{
604 GENERATED_BODY()
605
606private:
607 UPROPERTY()
608 TArray<FString> AuthorizedPermissions;
609 int32 Size = 0;
610 FString AccessionToken = FString();
611 FString UserID = FString();
612public:
613 void InitParams(ppfPermissionResult* InppfPermissionResultHandle);
614
616 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
617 FString GetAuthorizedPermission(int32 Index);
618
620 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
621 int32 GetSize();
622
624 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
625 FString GetAccessToken();
626
628 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
629 FString GetUserID();
630};
631
633UCLASS(BlueprintType)
634class ONLINESUBSYSTEMPICO_API UPico_UserRelationResult : public UObject
635{
636 GENERATED_BODY()
637
638private:
639
640 // <UserId, Userrelationtype>
641 UPROPERTY()
642 TMap<FString, EUserRelationType> UserRelationMap;
643
644 int32 RelationMapSize;
645
646 TArray<FString> UserIDArray;
647
648public:
649 void InitParams(ppfUserRelationResult* InppfUserRelationResultHandle);
650
652 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
653 int32 Contains(FString Key);
654
656 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
657 FString GetUserID(int32 Index);
658
660 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
661 int32 GetRelationMapSize();
662
664 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|UserRelationResult")
665 EUserRelationType GetRelationTypeValue(FString Key);
666};
667
668
669
670//
PicoUserInterface class.
Definition: Pico_User.h:56
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 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:240
UPico_PermissionResult class.
Definition: Pico_User.h:603
UPico_Room class.
Definition: Pico_Room.h:584
UPico_UserAndRoomArray class.
Definition: Pico_User.h:570
UPico_UserAndRoom class.
Definition: Pico_User.h:546
UPico_UserArray class.
Definition: Pico_User.h:510
UPico_User class.
Definition: Pico_User.h:422
UPico_UserRelationResult class.
Definition: Pico_User.h:635
EUserPresenceStatus
User's current online status.
Definition: OnlineSubsystemPicoNames.h:38
EUserGender
User's gender.
Definition: OnlineSubsystemPicoNames.h:48
EUserRelationType
User relation type.
Definition: OnlineSubsystemPicoNames.h:867