Ext Data Flows #
This section provides in-depth information on how multiplayer ext data moves through the multiplayer services.
Pragma allows developers to accept, transform, and forward custom data at multiple points in the multiplayer workflow. At each point, plugin methods can perform tasks such as data validation, cleaning, aggregation, and more.
In general, data is populated by one service or plugin, passed to another service, transformed and rebuild onto another ext, and again forwarded.
Player selection data #
The following examples describe how a player’s character selection data makes it’s way from the client or backend service to the game instance.
Scenario 1: Player joins a party and enters matchmaking
When players request to join a party, the client populates the
ExtPlayerJoinRequest
payload and passes it to the Party service.The Party service can handle the request via the Party Plugin’s
onAddPlayer()
method and populate theExtPartyPlayer
payload.When the party is ready to enter matchmaking, the party service builds the
ExtMatchmakingPlayer
proto for the Matchmaking service to use in the matchmaking logic.When the Matchmaking service creates a new game instance, it passes individual player data to the Game Instance service on the player’s
ExtBackendAddPlayer
payload (PlayerToAdd.ext
).Finally, the Game Instance service can handle the
ExtBackendAddPlayer
data in the Game Instance Plugin’shandleBackendAddPlayersRequest()
method and store the player data in the Game Instance and Game Player data stores.Note: The
ExtBackendAddPlayerRequest
ext passed to thehandleBackendAddPlayersRequest()
method contains general data about adding a player, not individual player data.
Scenario 2: Player joins an existing game instance directly
- When players request to join a game instance, the client populates the
ExtPlayerJoinGameInstanceRequest
payload and passes it to the Game Instance service. - The Game Instance service can handle the
ExtPlayerJoinGameInstanceRequest
data in the Game Instance Plugin’shandlePlayerJoinRequest()
method and store the player data in the Game Instance and Game Player data stores.
Scenario 3: A plugin method adds a player to an existing game instance
When a backend service requests to add a player to a game instance, it passes individual player data to the Game Instance service on the player’s
ExtBackendAddPlayer
payload (PlayerToAdd.ext
).The Game Instance service can handle the
ExtBackendAddPlayer
data in the Game Instance Plugin’shandleBackendAddPlayersRequest()
method and store the player data in the Game Instance and Game Player data stores.Note: The
ExtBackendAddPlayerRequest
ext passed to thehandleBackendAddPlayersRequest()
method contains general data about adding a player, not individual player data.
Rich presence selections #
The following examples describe how a custom rich presence representing a player’s status is set and updated.
Scenario 1: Player requests to update their status
- When a player requests to update their status, the client populates the
ExtRichPresencePlayerRequest
payload and passes it to the Presence service. - The Presence service handles the request via
updateRichPresenceFromPlayer()
and edits theExtRichPresence
.
Scenario 2: A plugin method requests a player status update
- When a backend service requests an update to a player’s status, it passes presence data to the Presence service on the
ExtRichPresenceBackendRequest
payload. - The Presence service handles the request via
updateRichPresenceFromBackend()
and edits theExtRichPresence
.
Updated game data #
The following examples describe how player clients and backend services can update data about a game instance.
Scenario 1: Player requests to update game player connection details
- When a player requests to update game data, such as their connection details, the client populates the
ExtPlayerUpdateRequest
payload and passes it to the Game Instance service. - The Game Instance service handles the request via
handlePlayerUpdateRequest()
and edits theExtData
.
Scenario 2: A plugin method or the game server requests to update game phase
- When a backend service or game server requests to game data, such as a game phase, the backend or server populates the
ExtBackendUpdateRequest
payload and passes it to the Game Instance service. - The Game Instance service handles the request via
handleBackendUpdateRequest()
and edits theExtData
.
Game results #
The following example describe how game server can send a player their game results when a game instance ends.
- When a game instance ends, the game server populates
ExtPlayerGameResult
, which can include information such as points earned. - The
ExtPlayerGameResult
is passed to the Game Instance service on thePlayerGameResult
object. - The Game Instance service handles the request via the
handleBackendEndRequest()
, which can be used to perform calculations and populate theExtGameEnded
payload. For example, the points earned from theExtPlayerGameResult
can be used to calculate a rewards delta that is placed onExtGameEnded
. - The
ExtGameEnded
payload is sent to the player on theOnGameEnded
notification.