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:
- A game instance is created and requests game server allocation.
- The Pragma Game Instance service generates partner tokens to authenticate the game server with the Pragma backend.
- The Game Server Provider plugin passes the game instance ID and partner tokens to the game server hosting provider.
- The game server hosting provider allocates a game server for the game instance.
- The allocated game server establishes a WebSocket connection with Pragma backend.
- The game server links to the specific game instance.
- 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.