game / pragma.gameinstance / GameInstanceService /
GameInstanceService #
internal class GameInstanceService(pragmaNode: PragmaNode, instanceId: <ERROR CLASS>, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, gameInstancesInProcess: GameInstancesInProcess = GameInstancesInProcess(), sessionClient: SessionClient = SessionClient(), notificationClient: GameInstanceNotificationClient = GameInstanceNotificationClient(), matchmakingClient: MatchmakingClient = MatchmakingClient(), fleetClient: FleetClient = FleetClient(), partyClient: PartyClient = PartyClient(), multiplayerClient: MultiplayerClient = MultiplayerClient()) : DistributedService, ConfigHandler<GameInstanceServiceConfig>
GameInstanceService is a game flow service responsible for creating game instances, sending connection details to players, and handling any game end processing.
Constructors #
GameInstanceService | fun GameInstanceService(pragmaNode: PragmaNode, instanceId: <ERROR CLASS>, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, gameInstancesInProcess: GameInstancesInProcess = GameInstancesInProcess(), sessionClient: SessionClient = SessionClient(), notificationClient: GameInstanceNotificationClient = GameInstanceNotificationClient(), matchmakingClient: MatchmakingClient = MatchmakingClient(), fleetClient: FleetClient = FleetClient(), partyClient: PartyClient = PartyClient(), multiplayerClient: MultiplayerClient = MultiplayerClient()) |
Functions #
Name | Summary |
---|---|
Called by a game server with connection details and ext data for previously found players, and connects them to the game instance. Each player receives a GameInstanceRpc.HostConnectionDetailsV1Notification containing all host connection details. | |
Signals a game is ready to be joined by players. Invoked by the game server. | |
Create a new game instance and find a game server for it run on. | |
Prevent the player from reconnecting to the game instance. Game instance reconnect must be configured to OPTIONAL. A notification with the game instance id and player id will be sent to the game server running the game instance. | |
Signals a game has completed. Invoked by the game server. | |
Reenters a game instance into matchmaking to find more players. This endpoint will call the Matchmaking Service to add the game instance to the requested queue. | |
Called by the MatchmakingService when matchmaking has found additional players for the game instance. | |
Signals a game server has failed to start for a game instance. Invoked by the FleetService. | |
Invoked by the game server to indicate that a game instance is still operating normally. | |
Called by the game server when allocated a game to get the game start data. | |
Provides the current game instance details for a player. | |
Request made by the game server to remove a game instance from matchmaking. The MatchmakingService may complete any pending changes to the game instance before it is removed. | |
Notification handler for player disconnect. Marks player as REMOVED from a game instance. | |
Notification handler for player reconnect. Attempt to reconnect them to their game, if they were in one. | |
Update the status of a game instance to reflect that it is no longer in matchmaking. | |
Remove players from a game instance. Invoked by the game server. | |
Retrieves the latest cached game instance info for a specific player. | |
Called by the game server to update a running game instance with new data. | |
Updates a given game instance with a player’s new party id. | |
Called by the game server to verify that connecting players are not misrepresenting their pragma identity. |