Skip to main content

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.

/// <summary>Get current activate matchmaking tickets of the player.</summary>
public void GetCurrentMatchmakings(MatchmakingDelegate0 callback);

Parameters:

ParamTypeDescription
callbackMatchmakingDelegate0

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.

/// <summary>
/// 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.
/// </summary>
/// <param name="configuration_name">Name of matchmaking configuration</param>
/// <param name="player_info_list">Players who start matchmaking together, and they must be set to the same team.</param>
public void StartMatchmaking(string configuration_name, List<MatchmakingPlayerInfo> player_info_list, MatchmakingDelegate1 callback);

Parameters:

ParamTypeDescription
configuration_namestringName of matchmaking configuration
player_info_listList<MatchmakingPlayerInfo>Players who start matchmaking together, and they must be set to the same team.
callbackMatchmakingDelegate1

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.

/// <summary>
/// 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.
/// </summary>
/// <param name="pgos_params">
/// </param>
public void StartMatchmaking_V2(StartMatchmakingParams pgos_params, MatchmakingDelegate1 callback);

Parameters:

ParamTypeDescription
pgos_paramsStartMatchmakingParams
callbackMatchmakingDelegate1

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.

/// <summary>
/// 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.
/// </summary>
/// <param name="pgos_params">
/// </param>
public void StartP2PMatchmaking(StartMatchmakingParams pgos_params, MatchmakingDelegate1 callback);

Parameters:

ParamTypeDescription
pgos_paramsStartMatchmakingParams
callbackMatchmakingDelegate1

Return: void

CancelMatchmaking

Cancel a matchmaking request

/// <summary>Cancel a matchmaking request</summary>
/// <param name="ticket_id">Ticket id for the matchmaking request</param>
/// <param name="reason">The reason for the cancel action, not necessary</param>
public void CancelMatchmaking(string ticket_id, string reason, MatchmakingDelegate2 callback);

Parameters:

ParamTypeDescription
ticket_idstringTicket id for the matchmaking request
reasonstringThe reason for the cancel action, not necessary
callbackMatchmakingDelegate2

Return: void

DescribeMatchmaking

Get detail process info of a matchmaking request

/// <summary>Get detail process info of a matchmaking request</summary>
/// <param name="ticket_id">Ticket id for the matchmaking request</param>
public void DescribeMatchmaking(string ticket_id, MatchmakingDelegate3 callback);

Parameters:

ParamTypeDescription
ticket_idstringTicket id for the matchmaking request
callbackMatchmakingDelegate3

Return: void

JoinMatchmaking

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

/// <summary>Accept to join a multiplayer matchmaking request when the matchmaking status is "Preparing"</summary>
/// <param name="ticket_id">Ticket id for the matchmaking request</param>
/// <param name="player_info">Player's detail info</param>
/// <param name="reason">The reason for the join action, not necessary</param>
public void JoinMatchmaking(string ticket_id, MatchmakingPlayerInfo player_info, string reason, MatchmakingDelegate4 callback);

Parameters:

ParamTypeDescription
ticket_idstringTicket id for the matchmaking request
player_infoMatchmakingPlayerInfoPlayer's detail info
reasonstringThe reason for the join action, not necessary
callbackMatchmakingDelegate4

Return: void

RejectMatchmaking

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

/// <summary>Reject a multiplayer matchmaking request when the matchmaking status is "Preparing"</summary>
/// <param name="ticket_id">Ticket id for the matchmaking request</param>
/// <param name="reason">The reason for the reject action, not necessary</param>
public void RejectMatchmaking(string ticket_id, string reason, MatchmakingDelegate4 callback);

Parameters:

ParamTypeDescription
ticket_idstringTicket id for the matchmaking request
reasonstringThe reason for the reject action, not necessary
callbackMatchmakingDelegate4

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

/// <summary>
/// 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
/// </summary>
/// <param name="ticket_id">Ticket id for the matchmaking request</param>
public void AcceptMatchedBattle(string ticket_id, MatchmakingDelegate4 callback);

Parameters:

ParamTypeDescription
ticket_idstringTicket id for the matchmaking request
callbackMatchmakingDelegate4

Return: void

RejectMatchedBattle

Reject the matched battle when matchmaking_status turn to Accepting

/// <summary>Reject the matched battle when matchmaking_status turn to Accepting</summary>
/// <param name="ticket_id">Ticket id for the matchmaking request</param>
public void RejectMatchedBattle(string ticket_id, MatchmakingDelegate4 callback);

Parameters:

ParamTypeDescription
ticket_idstringTicket id for the matchmaking request
callbackMatchmakingDelegate4

Return: void

GetConcurrentMatchmakingPlayerCount

Reject the matched battle when matchmaking_status turn to Accepting

/// <summary>Reject the matched battle when matchmaking_status turn to Accepting</summary>
/// <param name="pgos_params">Matchmaking configuration name</param>
public void GetConcurrentMatchmakingPlayerCount(GetConcurrentMatchmakingPlayerCountParams pgos_params, MatchmakingDelegate5 callback);

Parameters:

ParamTypeDescription
pgos_paramsGetConcurrentMatchmakingPlayerCountParamsMatchmaking configuration name
callbackMatchmakingDelegate5

Return: void

Event Details

OnMatchmakingProcessChanged

The event will be triggered when the matchmaking process changed.

/// <summary>The event will be triggered when the matchmaking process changed.</summary>
public event MatchmakingDelegate6 OnMatchmakingProcessChanged;

Type Reference:

All Delegates

public delegate void MatchmakingDelegate0(PgosResult a0, CurrentMatchmakingsInfo a1);
public delegate void MatchmakingDelegate1(PgosResult a0, StartMatchmakingInfo a1);
public delegate void MatchmakingDelegate2(PgosResult a0, CancelMatchmakingInfo a1);
public delegate void MatchmakingDelegate3(PgosResult a0, MatchmakingProcessInfo a1);
public delegate void MatchmakingDelegate4(PgosResult a0);
public delegate void MatchmakingDelegate5(PgosResult a0, GetConcurrentMatchmakingPlayerCountResult a1);
public delegate void MatchmakingDelegate6(MatchmakingProcessChangedEvt a0);

Type Reference: