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

Get the game’s User Agent

Link to this section Callbacks

Get the channels you want to subscribe to on start

Link to this callback games_status(arg0) View Source
games_status(Gossip.game()) :: :ok

Game status update

Link to this callback message_broadcast(arg0) View Source
message_broadcast(Gossip.message()) :: :ok

A new message was received from Gossip on a channel

Link to this callback player_sign_in(arg0, arg1) View Source
player_sign_in(Gossip.game_name(), Gossip.player_name()) :: :ok

A player has signed in

Link to this callback player_sign_out(arg0, arg1) View Source
player_sign_out(Gossip.game_name(), Gossip.player_name()) :: :ok

A player has signed out

Get the current names of connected players

Link to this callback players_status(arg0, list) View Source
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.

Link to this callback tell_received(arg0, from_player, to_player, arg3) View Source
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.