gossip v0.4.1 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

A new message was received from Gossip on a channel

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 Types

Link to this type channel_name() View Source
channel_name() :: String.t()
Link to this type game_name() View Source
game_name() :: String.t()
Link to this type player_name() View Source
player_name() :: String.t()
Link to this type user_agent() View Source
user_agent() :: String.t()

Link to this section Callbacks

Get the channels you want to subscribe to on start

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

A new message was received from Gossip on a channel

Link to this callback player_sign_in(game_name, player_name) View Source
player_sign_in(game_name(), player_name()) :: :ok

A player has signed in

Link to this callback player_sign_out(game_name, player_name) View Source
player_sign_out(game_name(), player_name()) :: :ok

A player has signed out

Get the current names of connected players

Link to this callback players_status(game_name, list) View Source
players_status(game_name(), [player_name()]) :: :ok

Player status update

Link to this callback tell_received(game_name, from_player, to_player, message) View Source
tell_received(
  game_name(),
  from_player :: player_name(),
  to_player :: player_name(),
  message()
) :: :ok

New tell received

Link to this callback user_agent() View Source
user_agent() :: user_agent()

Get the game’s User Agent.

This should return the game name with a version number.