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.
/// <summary>Get current activate matchmaking tickets of the player.</summary>
public void GetCurrentMatchmakings(MatchmakingDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| callback | MatchmakingDelegate0 |
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:
| Param | Type | Description |
|---|---|---|
| configuration_name | string | Name of matchmaking configuration |
| player_info_list | List<MatchmakingPlayerInfo> | Players who start matchmaking together, and they must be set to the same team. |
| callback | MatchmakingDelegate1 |
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:
| Param | Type | Description |
|---|---|---|
| pgos_params | StartMatchmakingParams | |
| callback | MatchmakingDelegate1 |
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:
| Param | Type | Description |
|---|---|---|
| pgos_params | StartMatchmakingParams | |
| callback | MatchmakingDelegate1 |
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:
| Param | Type | Description |
|---|---|---|
| ticket_id | string | Ticket id for the matchmaking request |
| reason | string | The reason for the cancel action, not necessary |
| callback | MatchmakingDelegate2 |
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:
| Param | Type | Description |
|---|---|---|
| ticket_id | string | Ticket id for the matchmaking request |
| callback | MatchmakingDelegate3 |
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:
| Param | Type | Description |
|---|---|---|
| ticket_id | string | Ticket id for the matchmaking request |
| player_info | MatchmakingPlayerInfo | Player's detail info |
| reason | string | The reason for the join action, not necessary |
| callback | MatchmakingDelegate4 |
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:
| Param | Type | Description |
|---|---|---|
| ticket_id | string | Ticket id for the matchmaking request |
| reason | string | The reason for the reject action, not necessary |
| callback | MatchmakingDelegate4 |
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:
| Param | Type | Description |
|---|---|---|
| ticket_id | string | Ticket id for the matchmaking request |
| callback | MatchmakingDelegate4 |
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:
| Param | Type | Description |
|---|---|---|
| ticket_id | string | Ticket id for the matchmaking request |
| callback | MatchmakingDelegate4 |
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:
| Param | Type | Description |
|---|---|---|
| pgos_params | GetConcurrentMatchmakingPlayerCountParams | Matchmaking configuration name |
| callback | MatchmakingDelegate5 |
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: