跳到主要内容

Client Matchmaking API Reference

The matchmaking service matches some players into one battle based on a specific ruleset. The key processes include searching for players and battle placement on a dedicated server. It supports solo and multiple players' matchmaking.

API List

APIDescription
GetCurrentMatchmakingsGet current activate matchmaking tickets of the player.
StartMatchmakingStart a matchmaking request. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.
StartMatchmaking_V2Start a matchmaking request. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.
StartP2PMatchmakingStart a P2P matchmaking request. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.
CancelMatchmakingCancel a matchmaking request
DescribeMatchmakingGet detail process info of a matchmaking request
JoinMatchmakingAccept to join a multiplayer matchmaking request when the matchmaking status is "Preparing"
RejectMatchmakingReject a multiplayer matchmaking request when the matchmaking status is "Preparing"
AcceptMatchedBattleAccept the matched battle when matchmaking_status turn to Accepting. This interface should be called within accepting_timeout after matchmaking_status turn to Accepting, otherwise it will be considered a refusal
RejectMatchedBattleReject the matched battle when matchmaking_status turn to Accepting
GetConcurrentMatchmakingPlayerCountReject the matched battle when matchmaking_status turn to Accepting

Event List

EventDescription
OnMatchmakingProcessChangedThe event will be triggered when the matchmaking process changed.

API Details

GetCurrentMatchmakings

Get current activate matchmaking tickets of the player.

/**
* Get current activate matchmaking tickets of the player.
*
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetCurrentMatchmakings(
TFunction<void(const FPgosResult& Ret, const FPgosClientCurrentMatchmakingsInfo* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientCurrentMatchmakingsInfo* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

StartMatchmaking

Start a matchmaking request. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.

/**
* Start a matchmaking request.
* Tips: In order to enhance the reliability of the service event reception, after calling this API,
* the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period.
* This ensures that the service continues to function even when the persistent connection is disconnected.
*
* @param ConfigurationName Name of matchmaking configuration
* @param PlayerInfoList Players who start matchmaking together, and they must be set to the same team.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void StartMatchmaking(
const FString& ConfigurationName,
const TArray<FPgosClientMatchmakingPlayerInfo>& PlayerInfoList,
TFunction<void(const FPgosResult& Ret, const FPgosClientStartMatchmakingInfo* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
ConfigurationNameconst FString&Name of matchmaking configuration
PlayerInfoListconst TArray<FPgosClientMatchmakingPlayerInfo>&Players who start matchmaking together, and they must be set to the same team.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientStartMatchmakingInfo* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

StartMatchmaking_V2

Start a matchmaking request. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.

/**
* Start a matchmaking request.
* Tips: In order to enhance the reliability of the service event reception, after calling this API,
* the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period.
* This ensures that the service continues to function even when the persistent connection is disconnected.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void StartMatchmaking_V2(
const FPgosClientStartMatchmakingParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientStartMatchmakingInfo* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosClientStartMatchmakingParams&
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientStartMatchmakingInfo* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

StartP2PMatchmaking

Start a P2P matchmaking request. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.

/**
* Start a P2P matchmaking request.
* Tips: In order to enhance the reliability of the service event reception, after calling this API,
* the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period.
* This ensures that the service continues to function even when the persistent connection is disconnected.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void StartP2PMatchmaking(
const FPgosClientStartMatchmakingParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientStartMatchmakingInfo* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosClientStartMatchmakingParams&
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientStartMatchmakingInfo* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

CancelMatchmaking

Cancel a matchmaking request

/**
* Cancel a matchmaking request
*
* @param TicketId Ticket id for the matchmaking request
* @param Reason The reason for the cancel action, not necessary
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CancelMatchmaking(
const FString& TicketId,
const FString& Reason,
TFunction<void(const FPgosResult& Ret, const FPgosClientCancelMatchmakingInfo* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
TicketIdconst FString&Ticket id for the matchmaking request
Reasonconst FString&The reason for the cancel action, not necessary
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientCancelMatchmakingInfo* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

DescribeMatchmaking

Get detail process info of a matchmaking request

/**
* Get detail process info of a matchmaking request
*
* @param TicketId Ticket id for the matchmaking request
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void DescribeMatchmaking(
const FString& TicketId,
TFunction<void(const FPgosResult& Ret, const FPgosClientMatchmakingProcessInfo* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
TicketIdconst FString&Ticket id for the matchmaking request
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientMatchmakingProcessInfo* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

JoinMatchmaking

Accept to join a multiplayer matchmaking request when the matchmaking status is "Preparing"

/**
* Accept to join a multiplayer matchmaking request when the matchmaking status is "Preparing"
*
* @param TicketId Ticket id for the matchmaking request
* @param PlayerInfo Player's detail info
* @param Reason The reason for the join action, not necessary
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void JoinMatchmaking(
const FString& TicketId,
const FPgosClientMatchmakingPlayerInfo& PlayerInfo,
const FString& Reason,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;

Parameters:

ParamTypeDescription
TicketIdconst FString&Ticket id for the matchmaking request
PlayerInfoconst FPgosClientMatchmakingPlayerInfo&Player's detail info
Reasonconst FString&The reason for the join action, not necessary
ResultCallbackTFunction<void(const FPgosResult& Ret)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

RejectMatchmaking

Reject a multiplayer matchmaking request when the matchmaking status is "Preparing"

/**
* Reject a multiplayer matchmaking request when the matchmaking status is "Preparing"
*
* @param TicketId Ticket id for the matchmaking request
* @param Reason The reason for the reject action, not necessary
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void RejectMatchmaking(
const FString& TicketId,
const FString& Reason,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;

Parameters:

ParamTypeDescription
TicketIdconst FString&Ticket id for the matchmaking request
Reasonconst FString&The reason for the reject action, not necessary
ResultCallbackTFunction<void(const FPgosResult& Ret)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

AcceptMatchedBattle

Accept the matched battle when matchmaking_status turn to Accepting. This interface should be called within accepting_timeout after matchmaking_status turn to Accepting, otherwise it will be considered a refusal

/**
* Accept the matched battle when matchmaking_status turn to Accepting. This interface should be called
* within accepting_timeout after matchmaking_status turn to Accepting, otherwise it will be considered a refusal
*
* @param TicketId Ticket id for the matchmaking request
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void AcceptMatchedBattle(
const FString& TicketId,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;

Parameters:

ParamTypeDescription
TicketIdconst FString&Ticket id for the matchmaking request
ResultCallbackTFunction<void(const FPgosResult& Ret)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

RejectMatchedBattle

Reject the matched battle when matchmaking_status turn to Accepting

/**
* Reject the matched battle when matchmaking_status turn to Accepting
*
* @param TicketId Ticket id for the matchmaking request
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void RejectMatchedBattle(
const FString& TicketId,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;

Parameters:

ParamTypeDescription
TicketIdconst FString&Ticket id for the matchmaking request
ResultCallbackTFunction<void(const FPgosResult& Ret)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

GetConcurrentMatchmakingPlayerCount

Reject the matched battle when matchmaking_status turn to Accepting

/**
* Reject the matched battle when matchmaking_status turn to Accepting
*
* @param Params Matchmaking configuration name
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetConcurrentMatchmakingPlayerCount(
const FPgosClientGetConcurrentMatchmakingPlayerCountParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientGetConcurrentMatchmakingPlayerCountResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosClientGetConcurrentMatchmakingPlayerCountParams&Matchmaking configuration name
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientGetConcurrentMatchmakingPlayerCountResult* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

Event Details

OnMatchmakingProcessChanged

The event will be triggered when the matchmaking process changed.

/**
* OnMatchmakingProcessChanged:
* The event will be triggered when the matchmaking process changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnMatchmakingProcessChanged, const FPgosClientMatchmakingProcessChangedEvt& /*Event*/);
FOnMatchmakingProcessChanged& OnMatchmakingProcessChanged() { return MatchmakingProcessChangedDelegate; }

Type Reference: