[−][src]Trait discord_game_sdk::EventHandler
Trait providing callbacks for the SDK.
All methods have a default empty implementation.
Provided methods
fn on_user_achievement_update(
&mut self,
discord: &Discord<Self>,
user_achievement: &UserAchievement
)
&mut self,
discord: &Discord<Self>,
user_achievement: &UserAchievement
)
Fired when an User Achievement is updated
fn on_activity_join(&mut self, discord: &Discord<Self>, secret: &str)
Fired when the current user accepts an invitation to join in chat or receives confirmation from Asking to Join.
fn on_activity_spectate(&mut self, discord: &Discord<Self>, secret: &str)
Fired when the current user accepts an invitation to spectate in chat or clicks the Spectate button on another user's profile.
fn on_activity_join_request(&mut self, discord: &Discord<Self>, user: &User)
Fires when a user asks to join the game of the current user.
fn on_activity_invite(
&mut self,
discord: &Discord<Self>,
kind: Action,
user: &User,
activity: &Activity
)
&mut self,
discord: &Discord<Self>,
kind: Action,
user: &User,
activity: &Activity
)
Fires when the current user receives an invitation to join or spectate.
fn on_lobby_update(&mut self, discord: &Discord<Self>, lobby_id: LobbyID)
Fires when a lobby is updated.
fn on_lobby_delete(
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
reason: u32
)
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
reason: u32
)
Fired when a lobby is deleted.
fn on_member_connect(
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID
)
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID
)
Fires when a member joins the lobby.
fn on_member_update(
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID
)
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID
)
Fires when data for a lobby member is updated.
fn on_member_disconnect(
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID
)
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID
)
Fires when a member leaves the lobby.
fn on_lobby_message(
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID,
data: &[u8]
)
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID,
data: &[u8]
)
Fires when a message is sent to the lobby.
fn on_speaking(
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID,
speaking: bool
)
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID,
speaking: bool
)
Fires when a user connected to voice starts or stops speaking.
fn on_lobby_network_message(
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID,
channel_id: NetworkChannelID,
data: &[u8]
)
&mut self,
discord: &Discord<Self>,
lobby_id: LobbyID,
member_id: UserID,
channel_id: NetworkChannelID,
data: &[u8]
)
Fires when the user receives a message from the lobby's networking layer.
fn on_network_message(
&mut self,
discord: &Discord<Self>,
peer_id: NetworkPeerID,
channel_id: NetworkChannelID,
data: &[u8]
)
&mut self,
discord: &Discord<Self>,
peer_id: NetworkPeerID,
channel_id: NetworkChannelID,
data: &[u8]
)
Fires when you receive data from another user.
This callback will only fire if you already have an open channel with the user sending you data.
fn on_network_route_update(&mut self, discord: &Discord<Self>, route: &str)
Fires when your networking route has changed.
You should broadcast this change to other users.
fn on_overlay_toggle(&mut self, discord: &Discord<Self>, closed: bool)
Fires when the overlay is opened or closed.
fn on_relationships_refresh(&mut self, discord: &Discord<Self>)
Fires at initialization when Discord<'_, Self> has cached a snapshot of all your relationships.
fn on_relationship_update(
&mut self,
discord: &Discord<Self>,
relationship: &Relationship
)
&mut self,
discord: &Discord<Self>,
relationship: &Relationship
)
Fires when a relationship in the filtered list changes, like an updated presence or user attribute.
fn on_entitlement_create(
&mut self,
discord: &Discord<Self>,
entitlement: &Entitlement
)
&mut self,
discord: &Discord<Self>,
entitlement: &Entitlement
)
Fires when the connected user receives a new entitlement, either through purchase or through a developer grant.
fn on_entitlement_delete(
&mut self,
discord: &Discord<Self>,
entitlement: &Entitlement
)
&mut self,
discord: &Discord<Self>,
entitlement: &Entitlement
)
Fires when the connected user loses an entitlement, either by expiration, revocation, or consumption in the case of consumable entitlements.
fn on_current_user_update(&mut self, discord: &Discord<Self>)
Fires when the User struct of the currently connected user changes.
fn on_voice_settings_update(&mut self, discord: &Discord<Self>)
Fires when the current user has updated their voice settings.
Implementations on Foreign Types
impl EventHandler for ()
[src]
Empty implementation