Instance Method

setHostedPlayer(_:connected:)

Updates a player’s status on the view to show that the player has connected or disconnected from your server.

Declaration

func setHostedPlayer(_ playerID: String, connected: Bool)

Parameters

playerID

The identifier string for a player that connected to the external server.

connected

A Boolean value that states whether the player is connected to the hosted match.

Discussion

When setting up a hosted match, each device should instantiate a matchmaker view controller and display it to the player. Then, when a new player connects to your server, your server should notify all participating devices already connected to your server. Each participating device should then call this method to update that player’s status in the matchmaking interface. Similarly, if a player disconnects from the server, your server should inform each device so that the devices can update their user interface.

See Also

Deprecated Methods and Properties

var defaultInvitationMessage: String?

The default invitation message used to initialize an invitation.

Deprecated