PICO Unreal Platform SDK
Pico_Matchmaking.h
1// Copyright® 2015-2023 PICO Technology Co., Ltd. All rights reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "OnlineSubsystemPico.h"
7#include "UObject/NoExportTypes.h"
8#include "OnlineSubsystemPicoNames.h"
9#include "PPF_Platform.h"
10#include "Kismet/BlueprintFunctionLibrary.h"
11#include "Pico_Matchmaking.generated.h"
12//
13
14
15DECLARE_LOG_CATEGORY_EXTERN(PicoMatchmaking, Log, All);
16
17class UPico_User;
18class UPico_DataStore;
19class UPico_UserArray;
20class UPico_Room;
21
31
32
36DECLARE_MULTICAST_DELEGATE_FourParams(FMatchmakingMatchFoundNotify, bool, /*bIsError*/ int, /*ErrorCode*/ const FString&, /*ErrorMessage*/ UPico_Room* /*Room*/);
37DECLARE_MULTICAST_DELEGATE_ThreeParams(FMatchmakingCancelNotify, bool, /*bIsError*/ int, /*ErrorCode*/ const FString& /*ErrorMessage*/);
38
39DECLARE_DYNAMIC_DELEGATE_ThreeParams(FMatchmakingReportResultsInsecure, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage);
40DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingGetStats, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingStats*, MatchmakingStats);
41DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingBrowse2, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingBrowseResult*, MatchmakingBrowseResult);
42DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingBrowse2CustomPage, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingBrowseResult*, MatchmakingBrowseResult);
43DECLARE_DYNAMIC_DELEGATE_ThreeParams(FMatchmakingCancel, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage);
44DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingCreateAndEnqueueRoom2, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingEnqueueResultAndRoom*, MatchmakingEnqueueResultAndRoom);
45DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingEnqueue2, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingEnqueueResult*, MatchmakingEnqueueResult);
46DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingGetAdminSnapshot, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingAdminSnapshot*, MatchmakingAdminSnapshot);
47DECLARE_DYNAMIC_DELEGATE_ThreeParams(FMatchmakingStartMatch, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage);
48// FRoom_LaunchInvitableUserFlow
49// FRoom_GetNextRoomArrayPage
50
62class ONLINESUBSYSTEMPICO_API FPicoMatchmakingInterface
63{
64private:
65 FOnlineSubsystemPico& PicoSubsystem;
66
67public:
68 FPicoMatchmakingInterface(FOnlineSubsystemPico& InSubsystem);
70
71 FDelegateHandle MatchmakingMatchFoundHandle;
72 void OnMatchmakingMatchFoundNotification(ppfMessageHandle Message, bool bIsError);
73
74 FDelegateHandle MatchmakingCancelHandle;
75 void OnMatchmakingCancelNotification(ppfMessageHandle Message, bool bIsError);
76
77 FMatchmakingMatchFoundNotify MatchmakingMatchFoundNotify;
78 FMatchmakingCancelNotify MatchmakingCancelNotify;
79
80 FMatchmakingReportResultsInsecure ReportResultsInsecureDelegate;
81 FMatchmakingGetStats GetStatsDelegate;
82 FMatchmakingBrowse2 Browse2Delegate;
83 FMatchmakingBrowse2CustomPage Browse2CustomPageDelegate;
84 FMatchmakingCancel CancelDelegate;
85 FMatchmakingCreateAndEnqueueRoom2 CreateAndEnqueueRoom2Delegate;
86 FMatchmakingEnqueue2 Enqueue2Delegate;
87 FMatchmakingGetAdminSnapshot GetAdminSnapshotDelegate;
88 FMatchmakingStartMatch StartMatchDelegate;
89
102 bool ReportResultsInsecure(const FString& RoomID, const TMap<FString, int>& Data, FMatchmakingReportResultsInsecure InDelegate);
103
118 bool GetStats(const FString& Pool, uint32 MaxLevel, EMatchmakingStatApproach Approach = EMatchmakingStatApproach::Trailing, FMatchmakingGetStats InDelegate = FMatchmakingGetStats());
119
134 bool Browse2(const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingBrowse2 InDelegate);
135
150 bool Browse2CustomPage(const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, int PageIndex, int PageSize, FMatchmakingBrowse2CustomPage InDelegate);
151
166 bool Cancel(FMatchmakingCancel InDelegate);
167
181 bool CreateAndEnqueueRoom2(const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingCreateAndEnqueueRoom2 InDelegate);
182
200 bool Enqueue2(const FString& pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingEnqueue2 InDelegate);
201
216 bool GetAdminSnapshot(FMatchmakingGetAdminSnapshot InDelegate);
217
234 bool StartMatch(const FString& RoomId, FMatchmakingStartMatch InDelegate);
235private:
236 ppfMatchmakingOptions* GetppfMatchmakingOptions(FPicoMatchmakingOptions PicoMatchmakingOptions);
237 ppfMatchmakingStatApproach GetppfMatchmakingStatApproach(EMatchmakingStatApproach MatchmakingStatApproach);
238 ppfID GetppfID(const FString& StringID);
239};
240
256UCLASS()
257class ONLINESUBSYSTEMPICO_API UOnlinePicoMatchmakingFunction : public UBlueprintFunctionLibrary
258{
259 GENERATED_BODY()
260
261
262public:
270 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
271 static void ReportResultsInsecure(UObject* WorldContextObject, const FString& RoomID, const TMap<FString, int>& Data, FMatchmakingReportResultsInsecure InDelegate);
272
282 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
283 // static void GetStats(UObject* WorldContextObject, const FString& Pool, int32 MaxLevel, EMatchmakingStatApproach approach = EMatchmakingStatApproach::Trailing, const FMatchmakingGetStats& InDelegate = FMatchmakingGetStats());
284 static void GetStats(UObject* WorldContextObject, const FString& Pool, int32 MaxLevel, EMatchmakingStatApproach approach, FMatchmakingGetStats InDelegate);
285
295 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
296 static void Browse2(UObject* WorldContextObject, const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingBrowse2 InDelegate);
297
307 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
308 static void Browse2CustomPage(UObject* WorldContextObject, const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, int PageIndex, int PageSize, FMatchmakingBrowse2CustomPage InDelegate);
309
320 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
321 static void Cancel(UObject* WorldContextObject, FMatchmakingCancel InDelegate);
322
331 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
332 static void CreateAndEnqueueRoom2(UObject* WorldContextObject, const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingCreateAndEnqueueRoom2 InDelegate);
333
346 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
347 static void Enqueue2(UObject* WorldContextObject, const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingEnqueue2 InDelegate);
348
359 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
360 static void GetAdminSnapshot(UObject* WorldContextObject, FMatchmakingGetAdminSnapshot InDelegate);
361
373 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
374 static void StartMatch(UObject* WorldContextObject, const FString& RoomId, FMatchmakingStartMatch InDelegate);
375};
376
381UCLASS(BlueprintType)
382class ONLINESUBSYSTEMPICO_API UPico_MatchmakingStats : public UObject
383{
384 GENERATED_BODY()
385private:
386 unsigned int DrawCount;
387 unsigned int LossCount;
388 unsigned int SkillLevel;
389 double SkillMean;
390 double SkillStandardDeviation;
391 unsigned int WinCount;
392
393public:
394 void InitParams(ppfMatchmakingStatsHandle InHandle);
395
397 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
398 int32 GetDrawCount();
399
401 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
402 int32 GetLossCount();
403
405 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
406 int32 GetSkillLevel();
407
409 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
410 float GetSkillMean();
411
413 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
414 float GetSkillStandardDeviation();
415
417 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
418 int32 GetWinCount();
419
420 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
421 FString GetDebugString();
422};
423
425UCLASS(BlueprintType)
426class ONLINESUBSYSTEMPICO_API UPico_MatchmakingBrowseResult : public UObject
427{
428 GENERATED_BODY()
429private:
430 UPROPERTY()
431 UPico_MatchmakingEnqueueResult* EnqueueResult;
432 UPROPERTY()
433
434 UPico_MatchmakingRoomList* MatchmakingRooms;
435public:
436 void InitParams(ppfMatchmakingBrowseResultHandle InHandle);
437
439 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
440 UPico_MatchmakingEnqueueResult* GetMatchmakingEnqueueResult();
441
443 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
444 UPico_MatchmakingRoomList* GetMatchmakingRooms();
445
446 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
447 FString GetDebugString();
448};
449
451UCLASS(BlueprintType)
452class ONLINESUBSYSTEMPICO_API UPico_MatchmakingRoomList : public UObject
453{
454 GENERATED_BODY()
455private:
456 UPROPERTY()
457 TArray<UPico_MatchmakingRoom*> MatchmakingRoomArray;
458 int32 Size = 0;
459 int32 TotalSize = 0;
460public:
461 void InitParams(ppfMatchmakingRoomArrayHandle InHandle);
462
464 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
465 UPico_MatchmakingRoom* GetElement(int32 Index);
466
467
469 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
470 int32 GetSize();
471
472 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
473 int32 GetTotalSize();
474
475 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
476 FString GetDebugString();
477};
478
480UCLASS(BlueprintType)
481class ONLINESUBSYSTEMPICO_API UPico_MatchmakingRoom : public UObject
482{
483 GENERATED_BODY()
484private:
485 UPROPERTY()
486 UPico_Room* Room;
487 unsigned int PingTime;
488 bool HasPingTime;
489
490public:
491 void InitParams(ppfMatchmakingRoomHandle InHandle);
492
494 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
495 UPico_Room* GetRoom();
496
498 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
499 int32 GetPingTime();
500
502 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
503 bool GetHasPingTime();
504
505 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
506 FString GetDebugString();
507};
508
510UCLASS(BlueprintType)
511class ONLINESUBSYSTEMPICO_API UPico_MatchmakingEnqueueResultAndRoom : public UObject
512{
513 GENERATED_BODY()
514
515private:
516 UPROPERTY()
517 UPico_MatchmakingEnqueueResult* MatchmakingEnqueueResult;
518 UPROPERTY()
519 UPico_Room* Room;
520
521public:
522 void InitParams(ppfMatchmakingEnqueueResultAndRoomHandle InHandle);
523
525 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
526 UPico_MatchmakingEnqueueResult* GetMatchmakingEnqueueResult();
527
529 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
530 UPico_Room* GetRoom();
531
532 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
533 FString GetDebugString();
534};
535
537UCLASS(BlueprintType)
538class ONLINESUBSYSTEMPICO_API UPico_MatchmakingEnqueueResult : public UObject
539{
540 GENERATED_BODY()
541
542private:
543 UPROPERTY()
544 UPico_MatchmakingAdminSnapshot* AdminSnapshotOptional;
545 unsigned int AverageWait;
546 unsigned int MatchesInLastHourCount;
547 unsigned int MaxExpectedWait;
548 FString Pool;
549 unsigned int RecentMatchPercentage;
550
551public:
552 void InitParams(ppfMatchmakingEnqueueResultHandle InHandle);
553
555 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
556 UPico_MatchmakingAdminSnapshot* GetAdminSnapshotOptional();
557
559 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
560 int32 GetAverageWait();
561
563 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
564 int32 GetMatchesInLastHourCount();
565
567 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
568 int32 GetMaxExpectedWait();
569
571 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
572 FString GetPool();
573
575 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
576 int32 GetRecentMatchPercentage();
577
578 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
579 FString GetDebugString();
580};
581
583UCLASS(BlueprintType)
584class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshot : public UObject
585{
586 GENERATED_BODY()
587
588private:
589 UPROPERTY()
591 double MyCurrentThreshold;
592
593public:
594 void InitParams(ppfMatchmakingAdminSnapshotHandle InHandle);
595
597 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
599
600 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
601 float GetMyCurrentThreshold();
602
604 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
605 FString GetDebugString();
606};
607
609UCLASS(BlueprintType)
610class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshotCandidateList : public UObject
611{
612 GENERATED_BODY()
613private:
614 UPROPERTY()
615 TArray<UPico_MatchmakingAdminSnapshotCandidate*> MatchmakingAdminSnapshotCandidateArray;
616 int32 TotalSize = 0;
617 int32 Size = 0;
618public:
619 void InitParams(ppfMatchmakingAdminSnapshotCandidateArrayHandle InHandle);
620
622 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
624
625 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
626 int32 GetTotalSize();
627
629 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
630 int32 GetSize();
631
632 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
633 FString GetDebugString();
634};
635
637UCLASS(BlueprintType)
638class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshotCandidate : public UObject
639{
640 GENERATED_BODY()
641
642private:
643 bool CanMatch;
644 double MyTotalScore;
645 double TheirCurrentThreshold;
646
647public:
648 void InitParams(ppfMatchmakingAdminSnapshotCandidateHandle InHandle);
649
651 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
652 bool GetCanMatch();
653
655 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
656 float GetMyTotalScore();
657
659 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
660 float GetTheirCurrentThreshold();
661
662 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
663 FString GetDebugString();
664};
PicoMatchmakingInterface class.
Definition: Pico_Matchmaking.h:63
bool Cancel(FMatchmakingCancel InDelegate)
Cancels a matchmaking request. Call this function to cancel an enqueue request before a match is made...
bool GetAdminSnapshot(FMatchmakingGetAdminSnapshot InDelegate)
Debugs the state of the current matchmaking pool queue.
bool Browse2(const FString &Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingBrowse2 InDelegate)
Gets rooms by matchmakinging pool name. The user can join the room with RoomService....
bool Browse2CustomPage(const FString &Pool, FPicoMatchmakingOptions MatchmakingOptions, int PageIndex, int PageSize, FMatchmakingBrowse2CustomPage InDelegate)
Gets rooms by matchmakinging pool name and specify the page number and the number of entries to retur...
bool CreateAndEnqueueRoom2(const FString &Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingCreateAndEnqueueRoom2 InDelegate)
Creates a matchmaking room, then enqueues and joins it.
bool ReportResultsInsecure(const FString &RoomID, const TMap< FString, int > &Data, FMatchmakingReportResultsInsecure InDelegate)
Reports the result of a skill-rating match.
bool StartMatch(const FString &RoomId, FMatchmakingStartMatch InDelegate)
Reports that a skill-rating match has started. You can use this method after joining the room.
bool Enqueue2(const FString &pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingEnqueue2 InDelegate)
Enqueues for an available matchmaking room to join. When the server finds a match,...
bool GetStats(const FString &Pool, uint32 MaxLevel, EMatchmakingStatApproach Approach=EMatchmakingStatApproach::Trailing, FMatchmakingGetStats InDelegate=FMatchmakingGetStats())
Gets the matchmaking statistics for the current user.
OnlinePicoMatchmaking Blueprint Function class.
Definition: Pico_Matchmaking.h:258
UPico_DataStore class.
Definition: Pico_DataStore.h:18
UPico_MatchmakingAdminSnapshotCandidate class.
Definition: Pico_Matchmaking.h:639
UPico_MatchmakingAdminSnapshotCandidateList class.
Definition: Pico_Matchmaking.h:611
UPico_MatchmakingAdminSnapshot class.
Definition: Pico_Matchmaking.h:585
UPico_MatchmakingBrowseResult class.
Definition: Pico_Matchmaking.h:427
UPico_MatchmakingEnqueueResultAndRoom class.
Definition: Pico_Matchmaking.h:512
UPico_MatchmakingEnqueueResult class.
Definition: Pico_Matchmaking.h:539
UPico_MatchmakingRoom class.
Definition: Pico_Matchmaking.h:482
UPico_MatchmakingRoomList class.
Definition: Pico_Matchmaking.h:453
UPico_MatchmakingStats class.
Definition: Pico_Matchmaking.h:383
UPico_Room class.
Definition: Pico_Room.h:639
UPico_UserArray class.
Definition: Pico_User.h:608
UPico_User class.
Definition: Pico_User.h:515
EMatchmakingStatApproach
Matchmaking stat approach.
Definition: OnlineSubsystemPicoNames.h:806
Matchmaking options.
Definition: OnlineSubsystemPicoNames.h:790