PICO Unreal Platform SDK
Pico_Matchmaking.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
15#pragma once
16
17#include "CoreMinimal.h"
18#include "OnlineSubsystemPico.h"
19#include "UObject/NoExportTypes.h"
20#include "OnlineSubsystemPicoNames.h"
21#include "PPF_Platform.h"
22#include "Pico_Matchmaking.generated.h"
23//
24
25
26DECLARE_LOG_CATEGORY_EXTERN(PicoMatchmaking, Log, All);
27
28class UPico_User;
29class UPico_DataStore;
30class UPico_UserArray;
31class UPico_Room;
32
42
43
47DECLARE_MULTICAST_DELEGATE_FourParams(FMatchmakingMatchFoundNotify, bool, /*bIsError*/ int, /*ErrorCode*/ const FString&, /*ErrorMessage*/ UPico_Room* /*Room*/);
48DECLARE_MULTICAST_DELEGATE_ThreeParams(FMatchmakingCancelNotify, bool, /*bIsError*/ int, /*ErrorCode*/ const FString& /*ErrorMessage*/);
49
50DECLARE_DYNAMIC_DELEGATE_ThreeParams(FMatchmakingReportResultsInsecure, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage);
51DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingGetStats, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingStats*, MatchmakingStats);
52DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingBrowse2, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingBrowseResult*, MatchmakingBrowseResult);
53DECLARE_DYNAMIC_DELEGATE_ThreeParams(FMatchmakingCancel, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage);
54DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingCreateAndEnqueueRoom2, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingEnqueueResultAndRoom*, MatchmakingEnqueueResultAndRoom);
55DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingEnqueue2, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingEnqueueResult*, MatchmakingEnqueueResult);
56DECLARE_DYNAMIC_DELEGATE_FourParams(FMatchmakingGetAdminSnapshot, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage, UPico_MatchmakingAdminSnapshot*, MatchmakingAdminSnapshot);
57DECLARE_DYNAMIC_DELEGATE_ThreeParams(FMatchmakingStartMatch, bool, bIsError, int, ErrorCode, const FString&, ErrorMessage);
58// FRoom_LaunchInvitableUserFlow
59// FRoom_GetNextRoomArrayPage
60
72class ONLINESUBSYSTEMPICO_API FPicoMatchmakingInterface
73{
74private:
75 FOnlineSubsystemPico& PicoSubsystem;
76
77public:
78 FPicoMatchmakingInterface(FOnlineSubsystemPico& InSubsystem);
80
81 FDelegateHandle MatchmakingMatchFoundHandle;
82 void OnMatchmakingMatchFoundNotification(ppfMessageHandle Message, bool bIsError);
83
84 FDelegateHandle MatchmakingCancelHandle;
85 void OnMatchmakingCancelNotification(ppfMessageHandle Message, bool bIsError);
86
87 FMatchmakingMatchFoundNotify MatchmakingMatchFoundNotify;
88 FMatchmakingCancelNotify MatchmakingCancelNotify;
89
90 FMatchmakingReportResultsInsecure ReportResultsInsecureDelegate;
91 FMatchmakingGetStats GetStatsDelegate;
92 FMatchmakingBrowse2 Browse2Delegate;
93 FMatchmakingCancel CancelDelegate;
94 FMatchmakingCreateAndEnqueueRoom2 CreateAndEnqueueRoom2Delegate;
95 FMatchmakingEnqueue2 Enqueue2Delegate;
96 FMatchmakingGetAdminSnapshot GetAdminSnapshotDelegate;
97 FMatchmakingStartMatch StartMatchDelegate;
98
111 bool ReportResultsInsecure(const FString& RoomID, const TMap<FString, int>& Data, FMatchmakingReportResultsInsecure InDelegate);
112
127 bool GetStats(const FString& Pool, uint32 MaxLevel, EMatchmakingStatApproach Approach = EMatchmakingStatApproach::Trailing, FMatchmakingGetStats InDelegate = FMatchmakingGetStats());
128
143 bool Browse2(const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingBrowse2 InDelegate);
144
159 bool Cancel(FMatchmakingCancel InDelegate);
160
174 bool CreateAndEnqueueRoom2(const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingCreateAndEnqueueRoom2 InDelegate);
175
193 bool Enqueue2(const FString& pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingEnqueue2 InDelegate);
194
209 bool GetAdminSnapshot(FMatchmakingGetAdminSnapshot InDelegate);
210
227 bool StartMatch(const FString& RoomId, FMatchmakingStartMatch InDelegate);
228private:
229 ppfMatchmakingOptions* GetppfMatchmakingOptions(FPicoMatchmakingOptions PicoMatchmakingOptions);
230 ppfMatchmakingStatApproach GetppfMatchmakingStatApproach(EMatchmakingStatApproach MatchmakingStatApproach);
231 ppfID GetppfID(const FString& StringID);
232};
233
249UCLASS()
250class ONLINESUBSYSTEMPICO_API UOnlinePicoMatchmakingFunction : public UBlueprintFunctionLibrary
251{
252 GENERATED_BODY()
253
254
255public:
262 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
263 static void ReportResultsInsecure(UObject* WorldContextObject, const FString& RoomID, const TMap<FString, int>& Data, FMatchmakingReportResultsInsecure InDelegate);
264
273 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
274 // static void GetStats(UObject* WorldContextObject, const FString& Pool, int32 MaxLevel, EMatchmakingStatApproach approach = EMatchmakingStatApproach::Trailing, const FMatchmakingGetStats& InDelegate = FMatchmakingGetStats());
275 static void GetStats(UObject* WorldContextObject, const FString& Pool, int32 MaxLevel, EMatchmakingStatApproach approach, FMatchmakingGetStats InDelegate);
276
285 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
286 static void Browse2(UObject* WorldContextObject, const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingBrowse2 InDelegate);
287
297 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
298 static void Cancel(UObject* WorldContextObject, FMatchmakingCancel InDelegate);
299
307 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
308 static void CreateAndEnqueueRoom2(UObject* WorldContextObject, const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingCreateAndEnqueueRoom2 InDelegate);
309
321 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
322 static void Enqueue2(UObject* WorldContextObject, const FString& pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingEnqueue2 InDelegate);
323
333 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
334 static void GetAdminSnapshot(UObject* WorldContextObject, FMatchmakingGetAdminSnapshot InDelegate);
335
346 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
347 static void StartMatch(UObject* WorldContextObject, const FString& RoomId, FMatchmakingStartMatch InDelegate);
348};
349
354UCLASS(BlueprintType)
355class ONLINESUBSYSTEMPICO_API UPico_MatchmakingStats : public UObject
356{
357 GENERATED_BODY()
358private:
359 unsigned int DrawCount;
360 unsigned int LossCount;
361 unsigned int SkillLevel;
362 double SkillMean;
363 double SkillStandardDeviation;
364 unsigned int WinCount;
365
366public:
367 void InitParams(ppfMatchmakingStatsHandle InHandle);
368
370 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
371 int32 GetDrawCount();
372
374 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
375 int32 GetLossCount();
376
378 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
379 int32 GetSkillLevel();
380
382 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
383 float GetSkillMean();
384
386 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
387 float GetSkillStandardDeviation();
388
390 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
391 int32 GetWinCount();
392
393 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
394 FString GetDebugString();
395};
396
398UCLASS(BlueprintType)
399class ONLINESUBSYSTEMPICO_API UPico_MatchmakingBrowseResult : public UObject
400{
401 GENERATED_BODY()
402private:
403 UPROPERTY()
404 UPico_MatchmakingEnqueueResult* EnqueueResult;
405 UPROPERTY()
406
407 UPico_MatchmakingRoomList* MatchmakingRooms;
408public:
409 void InitParams(ppfMatchmakingBrowseResultHandle InHandle);
410
412 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
413 UPico_MatchmakingEnqueueResult* GetMatchmakingEnqueueResult();
414
416 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
417 UPico_MatchmakingRoomList* GetMatchmakingRooms();
418
419 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
420 FString GetDebugString();
421};
422
424UCLASS(BlueprintType)
425class ONLINESUBSYSTEMPICO_API UPico_MatchmakingRoomList : public UObject
426{
427 GENERATED_BODY()
428private:
429 UPROPERTY()
430 TArray<UPico_MatchmakingRoom*> MatchmakingRoomArray;
431 FString NextPageParam = FString();
432 int32 Size = 0;
433 int32 TotalSize = 0;
434 bool bHasNextPage;
435public:
436 void InitParams(ppfMatchmakingRoomArrayHandle InHandle);
437
439 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
440 UPico_MatchmakingRoom* GetElement(int32 Index);
441
442
443 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
444 FString GetNextPageParam();
445
447 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
448 int32 GetSize();
449
450 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
451 int32 GetTotalSize();
452
454 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
455 bool HasNextPage();
456
457 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
458 FString GetDebugString();
459};
460
462UCLASS(BlueprintType)
463class ONLINESUBSYSTEMPICO_API UPico_MatchmakingRoom : public UObject
464{
465 GENERATED_BODY()
466private:
467 UPROPERTY()
468 UPico_Room* Room;
469 unsigned int PingTime;
470 bool HasPingTime;
471
472public:
473 void InitParams(ppfMatchmakingRoomHandle InHandle);
474
476 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
477 UPico_Room* GetRoom();
478
480 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
481 int32 GetPingTime();
482
484 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
485 bool GetHasPingTime();
486
487 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
488 FString GetDebugString();
489};
490
492UCLASS(BlueprintType)
493class ONLINESUBSYSTEMPICO_API UPico_MatchmakingEnqueueResultAndRoom : public UObject
494{
495 GENERATED_BODY()
496
497private:
498 UPROPERTY()
499 UPico_MatchmakingEnqueueResult* MatchmakingEnqueueResult;
500 UPROPERTY()
501 UPico_Room* Room;
502
503public:
504 void InitParams(ppfMatchmakingEnqueueResultAndRoomHandle InHandle);
505
507 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
508 UPico_MatchmakingEnqueueResult* GetMatchmakingEnqueueResult();
509
511 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
512 UPico_Room* GetRoom();
513
514 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
515 FString GetDebugString();
516};
517
519UCLASS(BlueprintType)
520class ONLINESUBSYSTEMPICO_API UPico_MatchmakingEnqueueResult : public UObject
521{
522 GENERATED_BODY()
523
524private:
525 UPROPERTY()
526 UPico_MatchmakingAdminSnapshot* AdminSnapshotOptional;
527 unsigned int AverageWait;
528 unsigned int MatchesInLastHourCount;
529 unsigned int MaxExpectedWait;
530 FString Pool;
531 unsigned int RecentMatchPercentage;
532
533public:
534 void InitParams(ppfMatchmakingEnqueueResultHandle InHandle);
535
537 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
538 UPico_MatchmakingAdminSnapshot* GetAdminSnapshotOptional();
539
541 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
542 int32 GetAverageWait();
543
545 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
546 int32 GetMatchesInLastHourCount();
547
549 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
550 int32 GetMaxExpectedWait();
551
553 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
554 FString GetPool();
555
557 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
558 int32 GetRecentMatchPercentage();
559
560 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
561 FString GetDebugString();
562};
563
565UCLASS(BlueprintType)
566class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshot : public UObject
567{
568 GENERATED_BODY()
569
570private:
571 UPROPERTY()
573 double MyCurrentThreshold;
574
575public:
576 void InitParams(ppfMatchmakingAdminSnapshotHandle InHandle);
577
579 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
581
582 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
583 float GetMyCurrentThreshold();
584
586 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
587 FString GetDebugString();
588};
589
591UCLASS(BlueprintType)
592class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshotCandidateList : public UObject
593{
594 GENERATED_BODY()
595private:
596 UPROPERTY()
597 TArray<UPico_MatchmakingAdminSnapshotCandidate*> MatchmakingAdminSnapshotCandidateArray;
598 FString NextPageParam = FString();
599 size_t Size = 0;
600 int32 TotalSize = 0;
601 bool bHasNextPage;
602public:
603 void InitParams(ppfMatchmakingAdminSnapshotCandidateArrayHandle InHandle);
604
606 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
608
609 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
610 FString GetNextPageParam();
611
613 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
614 int32 GetSize();
615
616 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
617 int32 GetTotalSize();
618
620 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
621 bool HasNextPage();
622
623 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
624 FString GetDebugString();
625};
626
628UCLASS(BlueprintType)
629class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshotCandidate : public UObject
630{
631 GENERATED_BODY()
632
633private:
634 bool CanMatch;
635 double MyTotalScore;
636 double TheirCurrentThreshold;
637
638public:
639 void InitParams(ppfMatchmakingAdminSnapshotCandidateHandle InHandle);
640
642 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
643 bool GetCanMatch();
644
646 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
647 float GetMyTotalScore();
648
650 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
651 float GetTheirCurrentThreshold();
652
653 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
654 FString GetDebugString();
655};
PicoMatchmakingInterface class.
Definition: Pico_Matchmaking.h:73
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 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:251
UPico_DataStore class.
Definition: Pico_DataStore.h:30
UPico_MatchmakingAdminSnapshotCandidate class.
Definition: Pico_Matchmaking.h:630
UPico_MatchmakingAdminSnapshotCandidateList class.
Definition: Pico_Matchmaking.h:593
UPico_MatchmakingAdminSnapshot class.
Definition: Pico_Matchmaking.h:567
UPico_MatchmakingBrowseResult class.
Definition: Pico_Matchmaking.h:400
UPico_MatchmakingEnqueueResultAndRoom class.
Definition: Pico_Matchmaking.h:494
UPico_MatchmakingEnqueueResult class.
Definition: Pico_Matchmaking.h:521
UPico_MatchmakingRoom class.
Definition: Pico_Matchmaking.h:464
UPico_MatchmakingRoomList class.
Definition: Pico_Matchmaking.h:426
UPico_MatchmakingStats class.
Definition: Pico_Matchmaking.h:356
UPico_Room class.
Definition: Pico_Room.h:584
UPico_UserArray class.
Definition: Pico_User.h:510
UPico_User class.
Definition: Pico_User.h:422
EMatchmakingStatApproach
Matchmaking stat approach.
Definition: OnlineSubsystemPicoNames.h:793
Matchmaking options.
Definition: OnlineSubsystemPicoNames.h:777