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
startAllocationForGameInstanceUse to integrate with your game server provider in order to allocate a game server for this game instance.

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

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:

configdescription
gameReadyTimeoutMillisTime, in milliseconds, to wait for a game server to send a connect players request before releasing the players attached to the game instance
enableKeepAliveEnables the keep alive interval, which specifies the interval within which a game server needs to send a keep alive request. If the game server does not send a request within this interval, the the game instance will be released from the service.
keepAliveIntervalMillisInterval, in milliseconds, to wait between keep alive requests. This value will be ignored if enableKeepAlive is false.
keepAliveMissesLimitNumber of keep alive request the game server can miss before releasing the game instance from the service. This value will be ignored if enableKeepAlive is false.
reconnectDetermines the player client behavior when recovering from an unexpected disconnect during a game
enableExtraCreateGameInstanceTimersEnables additional timing metrics to diagnose performance issues within the CreateGameInstanceV1 endpoint
enableStaleGameInstanceExpirationEnables the absolute timeout that will release a game from the service after a specific amount of time has elapsed. Defaults to true.
staleGameInstanceExpirationMinutesTime, in minutes, to wait before releasing a game instance. A 0 or negative values means games will never timeout. This value will be ignored if enableStaleGameInstanceExpiration is false.

See the Game Instance Service section in the documentation for more information on game instance operations.

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