Pico Unreal Platform SDK
Pico_User.h
1// Copyright 2022 Pico Technology Co., Ltd.All rights reserved.
2// 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.
3// Unreal® Engine, Copyright 1998 – 2022, Epic Games, Inc.All rights reserved.
4#pragma once
5
6#include "CoreMinimal.h"
7#include "UObject/NoExportTypes.h"
8#include "PPF_Platform.h"
9#include "OnlineSubsystemPicoNames.h"
10#include "OnlineSubsystemPico.h"
11#include "Pico_Room.h"
12#include "Pico_User.generated.h"
13
15
16DECLARE_LOG_CATEGORY_EXTERN(PicoUser, Log, All);
17
18class UPico_Room;
19
23DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriendsAndRooms, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
24DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserAndRoomArrayPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
25DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriends, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
26DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
27DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoginUser, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
28DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetUserInfo, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
29DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetPermissionResult, bool, bIsError, const FString&, ErrorMessage, UPico_PermissionResult*, PermissionResult);
30
42class ONLINESUBSYSTEMPICO_API FPicoUserInterface
43{
44private:
45
46 FOnlineSubsystemPico& PicoSubsystem;
47
48public:
51
52 FGetLoginUser GetLoginUserDelegate;
53 FGetLoggedInUserFriendsAndRooms GetLoggedInUserFriendsAndRoomsDelegate;
54 FGetNextUserAndRoomArrayPage GetNextUserAndRoomArrayPageDelegate;
55 FGetLoggedInUserFriends GetLoggedInUserFriendsDelegate;
56 FGetNextUserPage GetNextUserFriendsPageDelegate;
57 FGetUserInfo GetUserInfoDelegate;
58 FGetPermissionResult GetAuthorizePermissionsDelegate;;
59 FGetPermissionResult RequestUserPermissionsDelegate;
60
69 bool GetLoginUser(FGetLoginUser InGetLoginUserDelegate);
70
80 bool GetUserInfo(const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
81
90 bool GetLoggedInUserAndRoom(FGetLoggedInUserFriendsAndRooms OnGetLoggedInuserFriendsAndRoomsCallback);
91
101 bool GetNextUserAndRoomArrayPage(UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage OnGetNextUserAndRoomArrayPageCallback);
102
111 bool GetUserFriends(FGetLoggedInUserFriends OnGetLoggedInUserFriendsCallback);
112
122 bool GetNextUserPage(UPico_UserArray* InUserArray, FGetNextUserPage OnGetNextUserPageCallback);
123
134 bool GetAuthorizePermissions(FGetPermissionResult OnGetPermissionResultCallback);
135
151 bool RequestUserPermissions(TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
152};
168UCLASS()
169class ONLINESUBSYSTEMPICO_API UOnlinePicoUserFunction : public UBlueprintFunctionLibrary
170{
171 GENERATED_BODY()
172
173
174public:
175
185 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
186 static void PicoGetLoggedInUserAndRoom(UObject* WorldContextObject, FGetLoggedInUserFriendsAndRooms InGetLoggedInuserFriendsAndRoomsCallback);
187
198 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
199 static void PicoGetNextUserAndRoomArrayPage(UObject* WorldContextObject, UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage InGetNextUserAndRoomArrayPageCallback);
200
201
211 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
212 static void PicoGetUserFriends(UObject* WorldContextObject, FGetLoggedInUserFriends InGetLoggedInUserFriendsDelegate);
213
224 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
225 static void PicoGetNextUserPage(UObject* WorldContextObject, UPico_UserArray* InUserArray, FGetNextUserPage InGetNextUserPageDelegate);
226
236 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
237 static bool GetLoginUser(UObject* WorldContextObject, FGetLoginUser InGetLoginUserDelegate);
238
249 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
250 static bool GetPicoUserInfo(UObject* WorldContextObject, const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
251
263 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
264 static bool GetAuthorizePermissions(UObject* WorldContextObject, FGetPermissionResult OnGetPermissionResultCallback);
265
266
283 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
284 static bool RequestUserPermissions(UObject* WorldContextObject, TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
285
286};
287 // end of BP_User // end of BlueprintFunction
290
291UCLASS(BlueprintType)
292class ONLINESUBSYSTEMPICO_API UPico_User : public UObject
293{
294 GENERATED_BODY()
295public:
296 void InitParams(ppfUser* ppfUserHandle);
297
298private:
299 FString DisplayName = FString();
300 FString ImageUrl = FString();
301 FString ID = FString();
302 FString InviteToken = FString();
303 FString SmallImageUrl = FString();
304 FString PresencePackage = FString();
305 EUserPresenceStatus UserPresenceStatus = EUserPresenceStatus::Unknow;
306 EUserGender UserGender = EUserGender::Unknow;
307 FString Presence = FString();
308 FString PresenceDeeplinkMessage = FString();
309 FString PresenceDestinationApiName = FString();
310 FString PresenceLobbySessionId = FString();
311 FString PresenceMatchSessionId = FString();
312 FString PresenceExtra = FString();
313 FString StoreRegion = FString();
314
315public:
316
317 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
318 FString GetDisplayName();
319
320 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
321 FString GetImageURL();
322
323 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
324 FString GetID();
325
326 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
327 FString GetInviteToken();
328
329 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
330 FString GetSmallImageUrl();
331
332 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
333 FString GetPresencePackage();
334
335 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
336 EUserPresenceStatus GetUserPresenceStatus();
337
338 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
339 EUserGender GetGender();
340
341 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
342 FString GetPresence();
343
344 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
345 FString GetPresenceDeeplinkMessage();
346
347 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
348 FString GetPresenceDestinationApiName();
349
350 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
351 FString GetPresenceLobbySessionId();
352
353 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
354 FString GetPresenceMatchSessionId();
355
356 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
357 FString GetPresenceExtra();
358
359 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
360 FString GetStoreRegion();
361};
362
363UCLASS(BlueprintType)
364class ONLINESUBSYSTEMPICO_API UPico_UserArray : public UObject
365{
366
367 GENERATED_BODY()
368
369public:
370 void InitParams(ppfUserArray* InppfUserArrayHandle);
371
372private:
373 UPROPERTY()
374 TArray<UPico_User*> UserArray;
375 FString NextPageParam;
376 int32 Size;
377 bool bHasNextPage;
378
379public:
380
381
382 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
383 UPico_User* GetElement(int32 Index);
384
385 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
386 FString GetNextPageParam();
387
388 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
389 int32 GetSize();
390
391 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
392 bool HasNextPage();
393
394};
395
396UCLASS(BlueprintType)
397class ONLINESUBSYSTEMPICO_API UPico_UserAndRoom : public UObject
398{
399
400 GENERATED_BODY()
401private:
402 UPROPERTY()
403 UPico_Room* Room = nullptr;
404
405 UPROPERTY()
406 UPico_User* User = nullptr;
407public:
408 void InitParams(ppfUserAndRoom* InppfUserAndRoomHandle);
409
410 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
411 UPico_Room* GetRoom();
412
413 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
414 UPico_User* GetUser();
415};
416
417UCLASS(BlueprintType)
418class ONLINESUBSYSTEMPICO_API UPico_UserAndRoomArray : public UObject
419{
420
421 GENERATED_BODY()
422
423private:
424 UPROPERTY()
425 TArray<UPico_UserAndRoom*> UserAndRoomArray;
426 FString NextPageParam = FString();
427 int32 Size = 0;
428 bool bHasNextPage;
429public:
430 void InitParams(ppfUserAndRoomArray* InppfUserAndRoomArrayHandle);
431
432 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
433 UPico_UserAndRoom* GetElement(int32 Index);
434
435 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
436 FString GetNextPageParam();
437
438 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
439 int32 GetSize();
440
441 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
442 bool HasNextPage();
443};
444
445UCLASS(BlueprintType)
446class ONLINESUBSYSTEMPICO_API UPico_PermissionResult : public UObject
447{
448 GENERATED_BODY()
449
450private:
451 UPROPERTY()
452 TArray<FString> AuthorizedPermissions;
453 int32 Size = 0;
454 FString AccessionToken = FString();
455 FString UserID = FString();
456public:
457 void InitParams(ppfPermissionResult* InppfPermissionResultHandle);
458
459 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
460 FString GetAuthorizedPermission(int32 Index);
461
462 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
463 int32 GetSize();
464
465 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
466 FString GetAccessToken();
467
468 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
469 FString GetUserID();
470};
471
472//
OnlineSubsystemPico class inherited from FOnlineSubsystemImpl(Unreal Engine)
Definition: OnlineSubsystemPico.h:44
PicoUserInterface class.
Definition: Pico_User.h:43
OnlinePicoUser Blueprint Function class.
Definition: Pico_User.h:170