GameServer.Lobbies.SpectatorTracker
(GameServer v1.0.637)
Copy Markdown
Lightweight ETS-based tracker for lobby spectators.
Spectators are users connected to a lobby channel who are not members. This module tracks them in-memory (no persistence) so we can show spectator counts in admin panels and API responses.
Summary
Functions
Returns a specification to start this module under a supervisor.
Count spectators in a lobby.
Count spectators for multiple lobbies at once. Returns %{lobby_id => count}.
List spectator user IDs for a lobby.
Track a spectator joining a lobby.
Remove a spectator from a lobby.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec count(integer()) :: non_neg_integer()
Count spectators in a lobby.
@spec counts([integer()]) :: %{required(integer()) => non_neg_integer()}
Count spectators for multiple lobbies at once. Returns %{lobby_id => count}.
List spectator user IDs for a lobby.
Track a spectator joining a lobby.
Remove a spectator from a lobby.