Game Server SDK Reference #

This section provides references for Game server methods, classes, and events in the Pragma SDK for Unreal and Unity. For information on Pragma Engine backend classes and plugins, see Game Server Backend Reference.

The Pragma SDK provides methods that developers can use to facilitate game instance processes, such as connecting more players or ending the game. The SDK includes methods for game server use through the MatchApi. The tables below contains a list of all the methods relevant to game server tasks.

Match API SDK methods #

Calldescription
RequestStartGameRequests the game start data for a game instance. Use this method when Pragma does not manage your game server capacity.
ConnectPlayersConnects the initial players for a game instance
ConnectMorePlayersConnects more players for a game instance
VerifyPlayerUses player connection token to verify that connecting players are not misrepresenting their Pragma identity
UpdateGameInstanceRequests game instance data updates
RemovePlayersRemoves players from a game instance and processes player game results. Does not end the game instance.
EndGameRequest that a game instance end. Does note automatically end the game instance.
EnterMatchmakingEnters a game instance into matchmaking to accept additional players
LeaveMatchmakingRemoves a game instance from matchmaking
SetRichPresenceSets a player’s rich presence based on server-side options (such as “in party”)

The SDK calls invoke various plugins through service RPCs.

Unreal classes #

FPragma_GameInstance_GameStart #

propertydescription
GameInstanceIdgame instance ID
PlayersArray of Pragma_GameInstance_GameServerPlayer
ExtFPragma_GameInstance_ExtGameStart

FPragma_GameInstance_GameServerPlayer #

propertydescription
PlayerIdplayer ID
SocialIdplayer’s social ID
DisplayNameplayer’s display name
PartyIdparty ID the party the player is in
TeamNumberplayer’s team number
ClientVersionclient version
ExtFPragma_GameInstance_ExtGameServerPlayer

Events #

There are several game server-related events that player clients and game servers can listen to. The following tables contain bindable events relevant to game server operations, along with associated descriptions of when the event is triggered.

Player client events #

The following events are handled by the player client.

EventTriggerData returned
OnFailedToAllocateGameInstanceGame instance allocation fails due to game server issues after matchmaking succeedsN/A
OnHostConnectionDetailsReceivedThe game server starts a game instance and is available for parties to connectGameInstance
OnRemovedFromGameInstanceThe game server has removed the player from the gamegame instance ID, ExtRemovedFromGame

Game server events #

The following events are handled by the game server.

EventTriggerData returned
OnGameStartA game instance is started. The game server receives game instance data on this event.FPragma_GameInstance_GameStart
OnGameStartFailedAn error occurs while attempting to start a game instance. The game server will not continue reporting capacity or receiving new game instances until StartReportCapacityPolling is called again.Pragma error
OnKeepAliveFailedThe platform fails to process a keep alive requestgame instance ID, Pragma error
OnAddPlayersThe platform sends new players to the game server to add to the game instancegame instance ID, FPragma_GameInstance_GameServerPlayer array
OnGameInstanceEnteredMatchmakingThe given active game instance enters matchmakinggame instance ID
OnGameInstanceLeftMatchmakingThe given active game instance leaves matchmakinggame instance ID
OnPlayerDeclinedReconnectA player declines to reconnect to the game instance they were in. Includes the game instance ID and player ID respectively.game instance ID, player ID