Game Server Backend Reference #

This section provides game server references for plugins, classes, exts, and configuration values defined in the Pragma Engine backend. For specifics on the using the Pragma SDK for game server tasks, see Game Server SDK Reference.

Game Server Provider Plugin #

The Game Server Provider Plugin can be used to link a game instance with a host game server. This plugin accepts an ExtAllocateGameServer.

methoddescription
startAllocationForGameInstance()Use to integrate with your game server provider in order to allocate a game server for this game instance.
onGameServerAllocationFailed()Use to handle situations where allocation for a game server fails.

Pragma provides the following GameServerProviderPlugin implementations:

  • DefaultGameServerProviderPlugin: placeholder implementation for environments that are not yet allocating gamer servers. Replace this implementation as soon as you are ready to allocate actual game servers.
  • LocalProcessGameServerProviderPlugin: aids in developing a game server on a local machine. Using this plugin can make your local development more similar to your non-local environments. LocalProcessGameServerProviderPlugin is configured in the local-dev.yml file as the default game server provider plugin.

See also: Game Instance Backend Reference.

Data classes #

GameStart #

GameStart represents data sent to the game server when a game server is allocated for a game instance.

propertydescription
gameInstanceIdUnique game instance ID
playersAndExtsList of GamePlayer and ExtGameServerPlayer
extThe ExtGameStart used to store custom data to send to the game server
isInMatchmakingWhether or not the game instance is in matchmaking

PartnerClientTokens #

The PartnerClientTokens class contains data for partner client tokens that the game server should use when authenticating to Pragma.

propertydescription
gameTokenPartner client token to use when authenticating to Pragma game backend
socialTokenPartner client token to use when authenticating to Pragma social backend

Configuration #

The GameInstanceServiceConfig configuration block provides a place to define default values for game instance and game server operations. See the Game Instance Reference configuration section in the documentation for more information on configurable values.

Extension data #

extdescriptionexample data
ExtAllocateGameServerData to assist in game server allocation. Populated by GameServerProviderPlugin.startAllocationForGameInstance()game mode (3v3, 1v1, etc.) or game version (beta, trial, etc.)
ExtRemovePlayersRequestGame instance data sent from the game server to the Game Instance Plugin’s onRemovePlayers() method when a group of players are removed from a game instance.game time elapsed at removal time
ExtRemovePlayerPlayer data passed from the game server to the Game Instance Plugin’s onRemovePlayers() method via the playerToRemove list when a player is removed from a game instance.player’s progress on current mission
ExtRemovedFromGamePlayer data populated by the Game Instance Plugin’s onRemovePlayers() method and sent to the removed player client in the OnRemovedFromGame notification when the player is removed from a game instancerewards delta
ExtEndGameRequestGame instance data sent from the game server to the Game Instance Plugin’s onEndGame() method when a game instance endsgame metrics
ExtPlayerGameResultPlayer data passed from the game server to the Game Instance Plugin’s onEndGame() method via the PlayerGameResult list when a game instance endscompleted missions, points gained
ExtGameEndedPlayer data populated by the Game Instance Plugin’s onEndGame() method and sent to the player in the OnGameEnded notification when a game instance ends. Players previously removed from the game instance can still receive this information.rewards delta
ExtGameStartGame instance data sent to the linked game server before the game startsselected game mode or map
ExtGameServerPlayerPlayer data sent to the game server linked to the player’s game instanceSteam ID
ExtPlayerConnectionDetailsConnection details populated by the game server and used when a game instance is ready for players to join. Players receive the connect details in the OnHostConnectionDetailsReceived notification.game server zone/region
ExtBackendUpdateRequestPayload sent via the game server’s UpdateGameInstance() SDK method defining what updates to make to a game instanceadvance the current game phase
ExtRichPresenceBackendRequestCustom presence values set/updated by the game servercurrent score

Errors #

The following errors are related to game server operations.

  • GameInstanceService_GameServerAlreadyAllocated
  • GameInstanceService_CapacityRequestFailed
  • GameInstanceService_UnknownGameInstanceId
  • GameInstanceService_PlayerNotInGameInstance
  • GameInstanceService_MissingPlayerConnectionDetails