Game Server Management #

Match Lifecycle and Match Capacity services manage assigning matches, managing the player session, and processing match end results.

Match Lifecycle #

The Match Lifecycle service accepts match requests from Matchmaking. It updates the player session to support several key features, This includes reconnecting to a match in the event of a crash or disconnect, and gatekeeper functionality such as preventing players from starting new parties or matches until their current one is complete.

This service is also responsible for processing match end events. This includes making parallel requests to all services that need to process match results, aggregating the respective results, and finally sending the match results notification to players.

Match Reconnect #

Pragma Engine provides a way to reconnect players who disconnected while in a match within the game loop. Once the player logs back, the engine sends a notification to the player’s client with the match details so they can reconnect if the match is still active. The client can use these connection details to reconnect to the match. This feature can be disabled via the SessionConfig.enableMatchReconnect config value.

Match Reconnect only works in the Party service game flows. It does not work in the old Lobby-based game flows.

Match Capacity #

Match Capacity is responsible for processing match requests and coordinating with a game server management provider to allocate game servers.

This includes configuration to support maintaining a headroom of available capacity to keep servers ready ahead of time, configuring capacity limits, etc.

Pragma Engine supports several game server hosting solutions, providing first party support and integration across cloud providers and independent options.

sequenceDiagram participant p as Player participant ml as MatchLifecycle participant mc as MatchCapacity participant gsh as Game Server Hosting participant gs as Game Server mc->>gsh:allocate() gsh->>gs:start() gs->>mc:reportCapacity(1) mc->>gs:start(match) gs->>mc:matchReady(creds) mc->>p:matchStarted(details) p->>gs:connect()

Quick Guides #

Managing a match reconnect scenario #

Pragma Engine provides MatchReconnectV1 endpoint access within the Party service. This can be used to trigger resending the connection details to an active match.

Below are the steps for a sample scenario, along with the relevant calls for each stage in both Unity and Unreal.

  1. The Matchmaking service forms a match once a party enters matchmaking.

  2. A MatchReady notification with connection details is sent to every player within the match.

  3. Account.Login: A player loses their connection during the match and needs to reconnect.

  4. A notification with match connection details is sent to the player’s client on login. The reconnect endpoint causes the OnMatchReconnect event, allowing the player to connect back to their game using the rebroadcasted match connection information.

The SDK offers rich support to determine whether a player can call MatchReconnectV1.
  1. If the player’s client needs to request details again, it can manually invoke the MatchReconnectV1 endpoint. (optional)