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
| API | Description |
|---|---|
| GetCurrentMatchmakings | Get current activate matchmaking tickets of the player. |
| 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. |
| 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. |
| 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. |
| CancelMatchmaking | Cancel a matchmaking request |
| DescribeMatchmaking | Get detail process info of a matchmaking request |
| JoinMatchmaking | Accept to join a multiplayer matchmaking request when the matchmaking status is "Preparing" |
| RejectMatchmaking | Reject a multiplayer matchmaking request when the matchmaking status is "Preparing" |
| 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 |
| RejectMatchedBattle | Reject the matched battle when matchmaking_status turn to Accepting |
| GetConcurrentMatchmakingPlayerCount | Reject the matched battle when matchmaking_status turn to Accepting |
Event List
| Event | Description |
|---|---|
| OnMatchmakingProcessChanged | The 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:
| Param | Type | Description |
|---|---|---|
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| ConfigurationName | const FString& | Name of matchmaking configuration |
| PlayerInfoList | const TArray<FPgosClientMatchmakingPlayerInfo>& | Players who start matchmaking together, and they must be set to the same team. |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientStartMatchmakingParams& | |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientStartMatchmakingParams& | |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| TicketId | const FString& | Ticket id for the matchmaking request |
| Reason | const FString& | The reason for the cancel action, not necessary |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| TicketId | const FString& | Ticket id for the matchmaking request |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| TicketId | const FString& | Ticket id for the matchmaking request |
| PlayerInfo | const FPgosClientMatchmakingPlayerInfo& | Player's detail info |
| Reason | const FString& | The reason for the join action, not necessary |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| TicketId | const FString& | Ticket id for the matchmaking request |
| Reason | const FString& | The reason for the reject action, not necessary |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| TicketId | const FString& | Ticket id for the matchmaking request |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| TicketId | const FString& | Ticket id for the matchmaking request |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientGetConcurrentMatchmakingPlayerCountParams& | Matchmaking configuration name |
| ResultCallback | TFunction<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: