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
33class UPico_MatchmakingStats;
34class UPico_MatchmakingRoomList;
35class UPico_MatchmakingRoom;
36class UPico_MatchmakingBrowseResult;
37class UPico_MatchmakingEnqueueResultAndRoom;
38class UPico_MatchmakingEnqueueResult;
39class UPico_MatchmakingAdminSnapshot;
40class UPico_MatchmakingAdminSnapshotCandidateList;
41class UPico_MatchmakingAdminSnapshotCandidate;
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
109 bool ReportResultsInsecure(const FString& RoomID, const TMap<FString, int>& Data, FMatchmakingReportResultsInsecure InDelegate);
110
123 bool GetStats(const FString& Pool, uint32 MaxLevel, EMatchmakingStatApproach Approach = EMatchmakingStatApproach::Trailing, FMatchmakingGetStats InDelegate = FMatchmakingGetStats());
124
137 bool Browse2(const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingBrowse2 InDelegate);
138
152 bool Cancel(FMatchmakingCancel InDelegate);
153
165 bool CreateAndEnqueueRoom2(const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingCreateAndEnqueueRoom2 InDelegate);
166
182 bool Enqueue2(const FString& pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingEnqueue2 InDelegate);
183
197 bool GetAdminSnapshot(FMatchmakingGetAdminSnapshot InDelegate);
198
213 bool StartMatch(const FString& RoomId, FMatchmakingStartMatch InDelegate);
214private:
215 ppfMatchmakingOptions* GetppfMatchmakingOptions(FPicoMatchmakingOptions PicoMatchmakingOptions);
216 ppfMatchmakingStatApproach GetppfMatchmakingStatApproach(EMatchmakingStatApproach MatchmakingStatApproach);
217 ppfID GetppfID(const FString& StringID);
218};
219
235UCLASS()
236class ONLINESUBSYSTEMPICO_API UOnlinePicoMatchmakingFunction : public UBlueprintFunctionLibrary
237{
238 GENERATED_BODY()
239
240
241public:
247 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
248 static void ReportResultsInsecure(UObject* WorldContextObject, const FString& RoomID, const TMap<FString, int>& Data, FMatchmakingReportResultsInsecure InDelegate);
249
257 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
258 // static void GetStats(UObject* WorldContextObject, const FString& Pool, int32 MaxLevel, EMatchmakingStatApproach approach = EMatchmakingStatApproach::Trailing, const FMatchmakingGetStats& InDelegate = FMatchmakingGetStats());
259 static void GetStats(UObject* WorldContextObject, const FString& Pool, int32 MaxLevel, EMatchmakingStatApproach approach, FMatchmakingGetStats InDelegate);
260
268 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
269 static void Browse2(UObject* WorldContextObject, const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingBrowse2 InDelegate);
270
279 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
280 static void Cancel(UObject* WorldContextObject, FMatchmakingCancel InDelegate);
281
288 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
289 static void CreateAndEnqueueRoom2(UObject* WorldContextObject, const FString& Pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingCreateAndEnqueueRoom2 InDelegate);
290
301 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
302 static void Enqueue2(UObject* WorldContextObject, const FString& pool, FPicoMatchmakingOptions MatchmakingOptions, FMatchmakingEnqueue2 InDelegate);
303
312 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
313 static void GetAdminSnapshot(UObject* WorldContextObject, FMatchmakingGetAdminSnapshot InDelegate);
314
324 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Matchmaking")
325 static void StartMatch(UObject* WorldContextObject, const FString& RoomId, FMatchmakingStartMatch InDelegate);
326};
331UCLASS(BlueprintType)
332class ONLINESUBSYSTEMPICO_API UPico_MatchmakingStats : public UObject
333{
334 GENERATED_BODY()
335private:
336 unsigned int DrawCount;
337 unsigned int LossCount;
338 unsigned int SkillLevel;
339 double SkillMean;
340 double SkillStandardDeviation;
341 unsigned int WinCount;
342
343public:
344 void InitParams(ppfMatchmakingStatsHandle InHandle);
345
346 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
347 int32 GetDrawCount();
348
349 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
350 int32 GetLossCount();
351
352 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
353 int32 GetSkillLevel();
354
355 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
356 float GetSkillMean();
357
358 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
359 float GetSkillStandardDeviation();
360
361 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
362 int32 GetWinCount();
363
364 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Stats")
365 FString GetDebugString();
366};
367
368
369UCLASS(BlueprintType)
370class ONLINESUBSYSTEMPICO_API UPico_MatchmakingBrowseResult : public UObject
371{
372 GENERATED_BODY()
373private:
374 UPROPERTY()
375 UPico_MatchmakingEnqueueResult* EnqueueResult;
376 UPROPERTY()
377 UPico_MatchmakingRoomList* MatchmakingRooms;
378public:
379 void InitParams(ppfMatchmakingBrowseResultHandle InHandle);
380
381 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
382 UPico_MatchmakingEnqueueResult* GetMatchmakingEnqueueResult();
383
384 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
385 UPico_MatchmakingRoomList* GetMatchmakingRooms();
386
387 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Browse Result")
388 FString GetDebugString();
389};
390
391
392UCLASS(BlueprintType)
393class ONLINESUBSYSTEMPICO_API UPico_MatchmakingRoomList : public UObject
394{
395 GENERATED_BODY()
396private:
397 UPROPERTY()
398 TArray<UPico_MatchmakingRoom*> MatchmakingRoomArray;
399 FString NextPageParam = FString();
400 int32 Size = 0;
401 int32 TotalSize = 0;
402 bool bHasNextPage;
403public:
404 void InitParams(ppfMatchmakingRoomArrayHandle InHandle);
405
406 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
407 UPico_MatchmakingRoom* GetElement(int32 Index);
408
409 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
410 FString GetNextPageParam();
411
412 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
413 int32 GetSize();
414
415 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
416 int32 GetTotalSize();
417
418 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
419 bool HasNextPage();
420
421 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room Array")
422 FString GetDebugString();
423};
424
425
426UCLASS(BlueprintType)
427class ONLINESUBSYSTEMPICO_API UPico_MatchmakingRoom : public UObject
428{
429 GENERATED_BODY()
430private:
431 UPROPERTY()
432 UPico_Room* Room;
433 unsigned int PingTime;
434 bool HasPingTime;
435
436public:
437 void InitParams(ppfMatchmakingRoomHandle InHandle);
438
439 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
440 UPico_Room* GetRoom();
441
442 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
443 int32 GetPingTime();
444
445 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
446 bool GetHasPingTime();
447
448 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Room")
449 FString GetDebugString();
450};
451
452
453UCLASS(BlueprintType)
454class ONLINESUBSYSTEMPICO_API UPico_MatchmakingEnqueueResultAndRoom : public UObject
455{
456 GENERATED_BODY()
457
458private:
459 UPROPERTY()
460 UPico_MatchmakingEnqueueResult* MatchmakingEnqueueResult;
461 UPROPERTY()
462 UPico_Room* Room;
463
464public:
465 void InitParams(ppfMatchmakingEnqueueResultAndRoomHandle InHandle);
466
467 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
468 UPico_MatchmakingEnqueueResult* GetMatchmakingEnqueueResult();
469
470 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
471 UPico_Room* GetRoom();
472
473 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result And Room")
474 FString GetDebugString();
475};
476
477
478UCLASS(BlueprintType)
479class ONLINESUBSYSTEMPICO_API UPico_MatchmakingEnqueueResult : public UObject
480{
481 GENERATED_BODY()
482
483private:
484 UPROPERTY()
485 UPico_MatchmakingAdminSnapshot* AdminSnapshotOptional;
486 unsigned int AverageWait;
487 unsigned int MatchesInLastHourCount;
488 unsigned int MaxExpectedWait;
489 FString Pool;
490 unsigned int RecentMatchPercentage;
491
492public:
493 void InitParams(ppfMatchmakingEnqueueResultHandle InHandle);
494
495 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
496 UPico_MatchmakingAdminSnapshot* GetAdminSnapshotOptional();
497
498 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
499 int32 GetAverageWait();
500
501 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
502 int32 GetMatchesInLastHourCount();
503
504 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
505 int32 GetMaxExpectedWait();
506
507 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
508 FString GetPool();
509
510 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
511 int32 GetRecentMatchPercentage();
512
513 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Enqueue Result")
514 FString GetDebugString();
515};
516
517
518UCLASS(BlueprintType)
519class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshot : public UObject
520{
521 GENERATED_BODY()
522
523private:
524 UPROPERTY()
525 UPico_MatchmakingAdminSnapshotCandidateList* CandidateList;
526 double MyCurrentThreshold;
527
528public:
529 void InitParams(ppfMatchmakingAdminSnapshotHandle InHandle);
530
531 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
532 UPico_MatchmakingAdminSnapshotCandidateList* GetCandidateList();
533
534 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
535 float GetMyCurrentThreshold();
536
537 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot")
538 FString GetDebugString();
539};
540
541
542UCLASS(BlueprintType)
543class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshotCandidateList : public UObject
544{
545 GENERATED_BODY()
546private:
547 UPROPERTY()
548 TArray<UPico_MatchmakingAdminSnapshotCandidate*> MatchmakingAdminSnapshotCandidateArray;
549 FString NextPageParam = FString();
550 size_t Size = 0;
551 int32 TotalSize = 0;
552 bool bHasNextPage;
553public:
554 void InitParams(ppfMatchmakingAdminSnapshotCandidateArrayHandle InHandle);
555
556 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
557 UPico_MatchmakingAdminSnapshotCandidate* GetElement(int32 Index);
558
559 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
560 FString GetNextPageParam();
561
562 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
563 int32 GetSize();
564
565 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
566 int32 GetTotalSize();
567
568 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
569 bool HasNextPage();
570
571 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking AdminSnapshot Candidate Array")
572 FString GetDebugString();
573};
574
575
576UCLASS(BlueprintType)
577class ONLINESUBSYSTEMPICO_API UPico_MatchmakingAdminSnapshotCandidate : public UObject
578{
579 GENERATED_BODY()
580
581private:
582 bool CanMatch;
583 double MyTotalScore;
584 double TheirCurrentThreshold;
585
586public:
587 void InitParams(ppfMatchmakingAdminSnapshotCandidateHandle InHandle);
588
589 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
590 bool GetCanMatch();
591
592 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
593 float GetMyTotalScore();
594
595 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
596 float GetTheirCurrentThreshold();
597
598 UFUNCTION(BlueprintPure, Category = "Pico Platform|Matchmaking|Matchmaking Admin Snapshot Candidate")
599 FString GetDebugString();
600};
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:237
EMatchmakingStatApproach
Matchmaking stat approach.
Definition: OnlineSubsystemPicoNames.h:793
Matchmaking options.
Definition: OnlineSubsystemPicoNames.h:777