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
.
method | description |
---|---|
startAllocationForGameInstance | Use 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.
property | description |
---|---|
gameInstanceId | Unique game instance ID |
playersAndExts | List of GamePlayer and ExtGameServerPlayer |
ext | The 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.
property | description |
---|---|
gameToken | Partner client token to use when authenticating to Pragma game backend |
socialToken | Partner 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:
config | description |
---|---|
gameReadyTimeoutMillis | Time, in milliseconds, to wait for a game server to send a connect players request before releasing the players attached to the game instance |
enableKeepAlive | Enables 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. |
keepAliveIntervalMillis | Interval, in milliseconds, to wait between keep alive requests. This value will be ignored if enableKeepAlive is false . |
keepAliveMissesLimit | Number 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. |
reconnect | Determines the player client behavior when recovering from an unexpected disconnect during a game |
enableExtraCreateGameInstanceTimers | Enables additional timing metrics to diagnose performance issues within the CreateGameInstanceV1 endpoint |
enableStaleGameInstanceExpiration | Enables the absolute timeout that will release a game from the service after a specific amount of time has elapsed. Defaults to true . |
staleGameInstanceExpirationMinutes | Time, 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 #
ext | description | example data |
---|---|---|
ExtAllocateGameServer | Data to assist in game server allocation. Populated by GameServerProviderPlugin.startAllocationForGameInstance() | game mode (3v3, 1v1, etc.) or game version (beta, trial, etc.) |
ExtRemovePlayersRequest | Game 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 |
ExtRemovePlayer | Player 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 |
ExtRemovedFromGame | Player 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 instance | rewards delta |
ExtEndGameRequest | Game instance data sent from the game server to the Game Instance Plugin’s onEndGame() method when a game instance ends | game metrics |
ExtPlayerGameResult | Player data passed from the game server to the Game Instance Plugin’s onEndGame() method via the PlayerGameResult list when a game instance ends | completed missions, points gained |
ExtGameEnded | Player 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 |
ExtGameStart | Game instance data sent to the linked game server before the game starts | selected game mode or map |
ExtGameServerPlayer | Player data sent to the game server linked to the player’s game instance | Steam ID |
ExtPlayerConnectionDetails | Connection 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 |
ExtBackendUpdateRequest | Payload sent via the game server’s UpdateGameInstance() SDK method defining what updates to make to a game instance | advance the current game phase |
ExtRichPresenceBackendRequest | Custom presence values set/updated by the game server | current score |
Errors #
The following errors are related to game server operations.
- GameInstanceService_GameServerAlreadyAllocated
- GameInstanceService_CapacityRequestFailed
- GameInstanceService_UnknownGameInstanceId
- GameInstanceService_PlayerNotInGameInstance
- GameInstanceService_MissingPlayerConnectionDetails