game-common / pragma.matchmaking / NewGameInstance /

NewGameInstance #

class NewGameInstance(var ext: ExtGameInstance = ExtGameInstance.getDefaultInstance(), var requestExt: ExtBackendCreateRequest = ExtBackendCreateRequest.getDefaultInstance(), var gameServerZone: <ERROR CLASS>)

Represents a successful matchmaking result that will be used to allocate a new game when returned from MatchmakingPlugin.initialize or MatchmakingPlugin.matchParties.

Constructors #

NewGameInstance

fun NewGameInstance(ext: ExtGameInstance = ExtGameInstance.getDefaultInstance(), requestExt: ExtBackendCreateRequest = ExtBackendCreateRequest.getDefaultInstance(), gameServerZone: <ERROR CLASS>)

Functions #

NameSummary

addParties

fun addParties(parties: List<Matchmaking.Party>, teamNumber: Int = 0)

Add multiple parties to the NewGameInstance. Always sets the team number of all players within all parties, defaulted to 0.

continueMatchmaking

fun continueMatchmaking(key: MatchmakingRpc.MatchmakingQueueKey)

Indicate that after this NewGameInstance is created, it should be added back into matchmaking.

setExtForPlayer

fun setExtForPlayer(player: Matchmaking.Player, ext: ExtBackendAddPlayer)

Set the ext for a player to be sent to the game instance.

setExtGamePlayer

fun setExtGamePlayer(player: Matchmaking.Player, ext: ExtGamePlayer)

Set the ExtGamePlayer payload for a given player in the new game instance. This data will be set on the GameInstance for the specified player and will override any previously set ExtGamePlayer for this player, therefore we recommend setting this once when the NewGameInstance will be returned from the matchmaking plugin.

setTeamByPlayers

fun setTeamByPlayers(players: List<Matchmaking.Player>, teamNumber: Int)

Update multiple players’ team number.

Properties #

NameSummary

ext

var ext: ExtGameInstance

A customer-defined payload of extra game information that will be used to create the game instance.

gameServerZone

var gameServerZone: <ERROR CLASS>

A string id that indicates which game server zone that game will be created within.

markedToContinueMatchmaking

val markedToContinueMatchmaking: Boolean

Calculated as true if NewGameInstance.continueMatchmaking has been called.

matchmakingQueueKey

val matchmakingQueueKey: MatchmakingRpc.MatchmakingQueueKey

The key for the matchmaking queue that the game will be added to only if markedToContinueMatchmaking is true. Not set if NewGameInstance.continueMatchmaking has not yet been called.

players

val players: List<Matchmaking.Player>

The list of players in the NewGameInstance. List is copied when retrieved.

requestExt

var requestExt: ExtBackendCreateRequest

A customer-defined payload of extra game information that will be used to create the game instance.