gossip v0.6.0 Gossip.Client behaviour View Source
Behaviour for integrating Gossip into your game
Link to this section Summary
Callbacks
Get the channels you want to subscribe to on start
Game status update
A new message was received from Gossip on a channel
A player has signed in
A player has signed out
Get the current names of connected players
Player status update
New tell received
Get the game’s User Agent
Link to this section Callbacks
Get the channels you want to subscribe to on start
Game status update
message_broadcast(Gossip.message()) :: :ok
A new message was received from Gossip on a channel
player_sign_in(Gossip.game_name(), Gossip.player_name()) :: :ok
A player has signed in
player_sign_out(Gossip.game_name(), Gossip.player_name()) :: :ok
A player has signed out
Get the current names of connected players
players_status(Gossip.game_name(), [Gossip.player_name()]) :: :ok
Player status update
You will receive this callback anytime a players/status
event is sent. These are sent
after calling Gossip.request_players_online/0
and periodically updated from the local
player cache, Gossip.Players
.
tell_received( Gossip.game_name(), from_player :: Gossip.player_name(), to_player :: Gossip.player_name(), Gossip.message() ) :: :ok
New tell received
Get the game’s User Agent.
This should return the game name with a version number.