Independent Match

Last updated: 2021-04-20 16:24:07

    This document describes how to use GPM service alone.

    Prerequisites

    You have created a match without selecting Request GSE Resources.

    Process Architecture

    The GPM service can be independently used as follows:

    Matchmaking Status

    The MatchTicket statuses will be as follows when you use the GPM service alone.

    Note:

    For more information about MatchTicket, please see MatchTicket Parameters.

    Directions

    Step 1: initiate a matchmaking request on the client

    You need a server to process matchmaking requests from your players, and call the StartMatching API to initiate matchmaking requests to GPM. A successful call of the StartMatching API generates a unique MatchTicket. You need to track the MatchTicket status to complete your matchmaking process.

    You can call the CancelMatching API to cancel the matching MatchTicket.

    Step 2: track the matchmaking status through event notifications

    After a matchmaking request is initiated, you can configure a notification address to receive GPM event notifications. Meanwhile, you can set a timer to periodically process event notifications. For more information about event notification, see Event Notifications.

    Step 3: process completed MatchTicket

    • After the potential battle ticket is found, you need to parse MatchTicket based on the protocol and obtain the player IDs matched to the same battle.
    • For eligible battle tickets, you need a server to process matchmaking requests from players and connect these players to the same battle. Then, you need to process the player connection and battle logic in GPM.
    • For cancelled/timeout/failed ticket, you can notify players according to the actual business logic, or initiate a matchmaking request again for players.

    (Optional) Step 4: use the DescribeMatchingProgress API to complement event notifications

    If you failed to configure a notification address or receive event notifications, you can call the DescribeMatchingProgress API to track the MatchTicket status. For more information about the statuses, see MatchTicket Status.