GKMatchDelegate

Trait GKMatchDelegate 

Source
pub unsafe trait GKMatchDelegate: NSObjectProtocol {
    // Provided methods
    unsafe fn match_didReceiveData_fromRemotePlayer(
        &self,
        match: &GKMatch,
        data: &NSData,
        player: &GKPlayer,
    )
       where Self: Sized + Message { ... }
    unsafe fn match_didReceiveData_forRecipient_fromRemotePlayer(
        &self,
        match: &GKMatch,
        data: &NSData,
        recipient: &GKPlayer,
        player: &GKPlayer,
    )
       where Self: Sized + Message { ... }
    unsafe fn match_player_didChangeConnectionState(
        &self,
        match: &GKMatch,
        player: &GKPlayer,
        state: GKPlayerConnectionState,
    )
       where Self: Sized + Message { ... }
    unsafe fn match_didFailWithError(
        &self,
        match: &GKMatch,
        error: Option<&NSError>,
    )
       where Self: Sized + Message { ... }
    unsafe fn match_shouldReinviteDisconnectedPlayer(
        &self,
        match: &GKMatch,
        player: &GKPlayer,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn match_didReceiveData_fromPlayer(
        &self,
        match: &GKMatch,
        data: &NSData,
        player_id: &NSString,
    )
       where Self: Sized + Message { ... }
    unsafe fn match_player_didChangeState(
        &self,
        match: &GKMatch,
        player_id: &NSString,
        state: GKPlayerConnectionState,
    )
       where Self: Sized + Message { ... }
    unsafe fn match_shouldReinvitePlayer(
        &self,
        match: &GKMatch,
        player_id: &NSString,
    ) -> bool
       where Self: Sized + Message { ... }
}
Available on crate feature GKMatch only.
Expand description

Provided Methods§

Source

unsafe fn match_didReceiveData_fromRemotePlayer( &self, match: &GKMatch, data: &NSData, player: &GKPlayer, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

The match received data sent from the player.

Source

unsafe fn match_didReceiveData_forRecipient_fromRemotePlayer( &self, match: &GKMatch, data: &NSData, recipient: &GKPlayer, player: &GKPlayer, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.
Source

unsafe fn match_player_didChangeConnectionState( &self, match: &GKMatch, player: &GKPlayer, state: GKPlayerConnectionState, )
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

The player state changed (eg. connected or disconnected)

Source

unsafe fn match_didFailWithError( &self, match: &GKMatch, error: Option<&NSError>, )
where Self: Sized + Message,

The match was unable to be established with any players due to an error.

Source

unsafe fn match_shouldReinviteDisconnectedPlayer( &self, match: &GKMatch, player: &GKPlayer, ) -> bool
where Self: Sized + Message,

Available on crate features GKBasePlayer and GKPlayer only.

This method is called when the match is interrupted; if it returns YES, a new invite will be sent to attempt reconnection. This is supported only for 1v1 games

Source

unsafe fn match_didReceiveData_fromPlayer( &self, match: &GKMatch, data: &NSData, player_id: &NSString, )
where Self: Sized + Message,

👎Deprecated
  • These protocol methods are obsoleted. They will never be invoked and their implementation does nothing**
Source

unsafe fn match_player_didChangeState( &self, match: &GKMatch, player_id: &NSString, state: GKPlayerConnectionState, )
where Self: Sized + Message,

👎Deprecated
Source

unsafe fn match_shouldReinvitePlayer( &self, match: &GKMatch, player_id: &NSString, ) -> bool
where Self: Sized + Message,

👎Deprecated

Trait Implementations§

Source§

impl ProtocolType for dyn GKMatchDelegate

Source§

const NAME: &'static str = "GKMatchDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn GKMatchDelegate

Implementations on Foreign Types§

Source§

impl<T> GKMatchDelegate for ProtocolObject<T>
where T: ?Sized + GKMatchDelegate,

Implementors§