game / pragma.gameinstance / GameInstanceService /
GameInstanceService #
internal class GameInstanceService(pragmaNode: PragmaNode, instanceId: <ERROR CLASS>, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, gameInstanceProxy: GameInstanceProxy = GameInstanceProxy(), gameInstanceManager: GameInstanceManager = GameInstanceManager(), notificationClient: GameInstanceNotificationClient = GameInstanceNotificationClient(), matchmakingClient: MatchmakingClient = MatchmakingClient(), partyClient: PartyClient = PartyClient(), multiplayerClient: MultiplayerClient = MultiplayerClient(), timeProxy: TimeProxy = TimeProxy.defaultInstance, foundMorePlayersManager: FoundMorePlayersManager = FoundMorePlayersManager()) : 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, gameInstanceProxy: GameInstanceProxy = GameInstanceProxy(), gameInstanceManager: GameInstanceManager = GameInstanceManager(), notificationClient: GameInstanceNotificationClient = GameInstanceNotificationClient(), matchmakingClient: MatchmakingClient = MatchmakingClient(), partyClient: PartyClient = PartyClient(), multiplayerClient: MultiplayerClient = MultiplayerClient(), timeProxy: TimeProxy = TimeProxy.defaultInstance, foundMorePlayersManager: FoundMorePlayersManager = FoundMorePlayersManager()) |
Functions #
Name | Summary |
---|---|
Called by other backend services to add players to an existing GameInstance. | |
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.GameInstanceDetailsV1Notification 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. | |
Create a new game instance. | |
Create a game. Invokes the GameInstancePlugin.handlePlayerCreateRequest function to customize the newly created game instance. | |
DEPRECATED in 0.4.0, removal by 0.5.0. Use leaveV1 which offers the same functionality with an additional request ext for customization. | |
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. | |
Invoked by the game server to indicate that a game instance is still operating normally. | |
Queries cached game instance data by game instance id. | |
Queries cached game instance data by game instance id. | |
Called by the game server when allocated a game to get the game start data. | |
Join a game. Invokes the GameInstancePlugin.handlePlayerJoinRequest function to customize game relevant data for the 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. | |
Leave a game. Invokes the GameInstancePlugin.handlePlayerLeaveRequest function to validate whether to allow the player to leave. | |
Notification handler for player disconnect. Marks player as REMOVED from a game instance. | |
Update the status of a game instance to reflect that it is no longer in matchmaking. | |
Remove players from a game instance. Invoked by other backend services or plugins via the GameInstanceApi. | |
Deprecated as of 0.4.0, removal by 0.5.0. Please use removePlayersV2 instead. | |
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. | |
Called by other backend services to update a running game instance with new data. | |
Called by a player 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. |