pub unsafe trait GKTurnBasedEventListener {
// Provided methods
unsafe fn player_didRequestMatchWithOtherPlayers(
&self,
player: &GKPlayer,
players_to_invite: &NSArray<GKPlayer>,
)
where Self: Sized + Message { ... }
unsafe fn player_receivedTurnEventForMatch_didBecomeActive(
&self,
player: &GKPlayer,
match: &GKTurnBasedMatch,
did_become_active: bool,
)
where Self: Sized + Message { ... }
unsafe fn player_matchEnded(
&self,
player: &GKPlayer,
match: &GKTurnBasedMatch,
)
where Self: Sized + Message { ... }
unsafe fn player_receivedExchangeRequest_forMatch(
&self,
player: &GKPlayer,
exchange: &GKTurnBasedExchange,
match: &GKTurnBasedMatch,
)
where Self: Sized + Message { ... }
unsafe fn player_receivedExchangeCancellation_forMatch(
&self,
player: &GKPlayer,
exchange: &GKTurnBasedExchange,
match: &GKTurnBasedMatch,
)
where Self: Sized + Message { ... }
unsafe fn player_receivedExchangeReplies_forCompletedExchange_forMatch(
&self,
player: &GKPlayer,
replies: &NSArray<GKTurnBasedExchangeReply>,
exchange: &GKTurnBasedExchange,
match: &GKTurnBasedMatch,
)
where Self: Sized + Message { ... }
unsafe fn player_wantsToQuitMatch(
&self,
player: &GKPlayer,
match: &GKTurnBasedMatch,
)
where Self: Sized + Message { ... }
unsafe fn player_didRequestMatchWithPlayers(
&self,
player: &GKPlayer,
player_i_ds_to_invite: &NSArray<NSString>,
)
where Self: Sized + Message { ... }
}GKTurnBasedMatch only.Expand description
Provided Methods§
Sourceunsafe fn player_didRequestMatchWithOtherPlayers(
&self,
player: &GKPlayer,
players_to_invite: &NSArray<GKPlayer>,
)
Available on crate features GKBasePlayer and GKPlayer only.
unsafe fn player_didRequestMatchWithOtherPlayers( &self, player: &GKPlayer, players_to_invite: &NSArray<GKPlayer>, )
GKBasePlayer and GKPlayer only.If Game Center initiates a match the developer should create a GKTurnBasedMatch from playersToInvite and present a GKTurnbasedMatchmakerViewController.
Sourceunsafe fn player_receivedTurnEventForMatch_didBecomeActive(
&self,
player: &GKPlayer,
match: &GKTurnBasedMatch,
did_become_active: bool,
)
Available on crate features GKBasePlayer and GKPlayer only.
unsafe fn player_receivedTurnEventForMatch_didBecomeActive( &self, player: &GKPlayer, match: &GKTurnBasedMatch, did_become_active: bool, )
GKBasePlayer and GKPlayer only.called when it becomes this player’s turn. It also gets called under the following conditions: the player’s turn has a timeout and it is about to expire. the player accepts an invite from another player. when the game is running it will additionally recieve turn events for the following: turn was passed to another player another player saved the match data Because of this the app needs to be prepared to handle this even while the player is taking a turn in an existing match. The boolean indicates whether this event launched or brought to forground the app.
Sourceunsafe fn player_matchEnded(&self, player: &GKPlayer, match: &GKTurnBasedMatch)
Available on crate features GKBasePlayer and GKPlayer only.
unsafe fn player_matchEnded(&self, player: &GKPlayer, match: &GKTurnBasedMatch)
GKBasePlayer and GKPlayer only.called when the match has ended.
Sourceunsafe fn player_receivedExchangeRequest_forMatch(
&self,
player: &GKPlayer,
exchange: &GKTurnBasedExchange,
match: &GKTurnBasedMatch,
)
Available on crate features GKBasePlayer and GKPlayer only.
unsafe fn player_receivedExchangeRequest_forMatch( &self, player: &GKPlayer, exchange: &GKTurnBasedExchange, match: &GKTurnBasedMatch, )
GKBasePlayer and GKPlayer only.this is called when a player receives an exchange request from another player.
Sourceunsafe fn player_receivedExchangeCancellation_forMatch(
&self,
player: &GKPlayer,
exchange: &GKTurnBasedExchange,
match: &GKTurnBasedMatch,
)
Available on crate features GKBasePlayer and GKPlayer only.
unsafe fn player_receivedExchangeCancellation_forMatch( &self, player: &GKPlayer, exchange: &GKTurnBasedExchange, match: &GKTurnBasedMatch, )
GKBasePlayer and GKPlayer only.this is called when an exchange is canceled by the sender.
Sourceunsafe fn player_receivedExchangeReplies_forCompletedExchange_forMatch(
&self,
player: &GKPlayer,
replies: &NSArray<GKTurnBasedExchangeReply>,
exchange: &GKTurnBasedExchange,
match: &GKTurnBasedMatch,
)
Available on crate features GKBasePlayer and GKPlayer only.
unsafe fn player_receivedExchangeReplies_forCompletedExchange_forMatch( &self, player: &GKPlayer, replies: &NSArray<GKTurnBasedExchangeReply>, exchange: &GKTurnBasedExchange, match: &GKTurnBasedMatch, )
GKBasePlayer and GKPlayer only.called when all players either respond or timeout responding to this request. This is sent to both the turn holder and the initiator of the exchange
Sourceunsafe fn player_wantsToQuitMatch(
&self,
player: &GKPlayer,
match: &GKTurnBasedMatch,
)
Available on crate features GKBasePlayer and GKPlayer only.
unsafe fn player_wantsToQuitMatch( &self, player: &GKPlayer, match: &GKTurnBasedMatch, )
GKBasePlayer and GKPlayer only.Called when a player chooses to quit a match and that player has the current turn. The developer should call participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:matchData:completionHandler: on the match passing in appropriate values. They can also update matchOutcome for other players as appropriate.