Game Server Overview #

This section provides an overview of how game servers interact with the Pragma backend. Game servers can be hosted by dedicated game server providers, such as Amazon Game Lift, Hathora, Multiplay, or others.

Pragma Engine and game servers #

The Pragma backend communicates with the game server using the following flow:

Game Server Overview

  1. A game instance is created and requests game server allocation.
  2. The Pragma Game Instance service generates partner tokens to authenticate the game server with the Pragma backend.
  3. The Game Server Provider plugin passes the game instance ID and partner tokens to the game server hosting provider.
  4. The game server hosting provider allocates a game server for the game instance.
  5. The allocated game server establishes a WebSocket connection with Pragma backend.
  6. The game server links to the specific game instance.
  7. Using the Pragma SDK, game servers can communicate with the Pragma backend and perform tasks such as connecting players to the game server, updating custom game data, updating player data, or ending a game.

See the Game Server Tasks page for specifics on allocating and communicating with game servers.

Partner tokens #

For game servers to communicate with the Pragma backend, they need to provide two partner tokens: a Social Token and a Game Token, which authenticate the game server with the Pragma backend. These tokens are generated by the Pragma Game Instance service and passed to the game server when allocation is initiated.

The game server is required to send the partner tokens with every request to the backend. However, once the tokens are provided to the Pragma SDK, the SDK handles including the tokens on every call. See Provide SDK with partner tokens for information on passing tokens to the Pragma SDK.

Each game server should have its own unique set of partner tokens. Sharing tokens may result in unintended behavior.

See Allocating a dedicated game server in the tasks page for more information on generating and providing partner tokens.