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. |
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.
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 |
isInMatchmaking | Whether 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.
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. See the Game Instance Reference configuration section in the documentation for more information on configurable values.
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