game-common / pragma.gameinstance / GameInstancePlugin / prepareUnknownInstanceForEndGameRequest /
prepareUnknownInstanceForEndGameRequest #
open suspend fun prepareUnknownInstanceForEndGameRequest(gameInstanceSnapshot: GameInstance.GameInstance, playerGameResults: List<PlayerGameResult>, requestExt: ExtEndGameRequest)
Called when processEndGameForUnknownInstance is enabled and no game instance is found in the cache, prior to invoking GameInstancePlugin.handleBackendEndRequest.
If this method is called, the information in the gameInstanceSnapshot has been lost (due to backend restart for example) and this plugin method needs to retrieve or reconstruct the state required to successfully perform end game processing.
Alternatively, all required state can be forwarded through the game server and passed back on the end game request, avoiding the need to implement this plugin method. Note: the DataStore will be empty in this scenario, so any data that is necessary to successfully end the game should be held by the GameServer and passed through in the requestExt
Parameters #
gameInstanceSnapshot | The game instance that is ending. |
playerGameResults | The player game results from the game server. |
requestExt | The data sent along with the request. |