GamendWeb.LobbyChannel (gamend_web v1.0.1215)

Copy Markdown View Source

Channel for lobby realtime events.

Topic: "lobby:<lobby_id>"

Users may join this channel either as a member (their lobby_id matches) or as a spectator (the lobby is public: not hidden, not locked).

Spectators receive all events (membership changes, updates, chat) but cannot perform any write operations. A user who is already in a lobby can only join their own lobby's channel.

Events pushed to clients

  • "user_joined" - A user joined the lobby. Payload: %{user_id: integer}
  • "user_left" - A user left the lobby. Payload: %{user_id: integer}
  • "user_kicked" - A user was kicked from the lobby. Payload: %{user_id: integer}
  • "user_online" - A lobby user came online. Payload: user brief object
  • "user_offline" - A lobby user went offline. Payload: user brief object
  • "user_updated" - A lobby user was updated. Payload: user brief object
  • "updated" - The lobby settings were updated. Payload: lobby object
  • "host_changed" - The host changed. Payload: %{new_host_id: integer}
  • "chat_message_created" - A new chat message. Payload: chat message object
  • "chat_message_updated" - A chat message was updated. Payload: chat message object
  • "chat_message_deleted" - A chat message was deleted. Payload: %{id: integer}

Summary

Functions

child_spec(init_arg)

start_link(triplet)