Documentation ¶
Overview ¶
Package lobby handles players connecting to games and communication between games and players
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Debug is a flag that causes the lobby to log the types messages that are read Debug bool // Log is used to log errors and other information Log *log.Logger // MaxGames is the maximum number of games the lobby supports MaxGames int // MaxSockets is the maximum number of sockets the lobby supports MaxSockets int // GameCfg is used to create new games GameCfg controller.Config // SocketCfg is used to create new sockets SocketCfg socket.Config }
Config contiains the properties to create a lobby
type Lobby ¶
type Lobby struct {
// contains filtered or unexported fields
}
Lobby is the place users can create, join, and participate in games
func (*Lobby) AddUser ¶
func (l *Lobby) AddUser(playerName game.PlayerName, w http.ResponseWriter, r *http.Request) error
AddUser adds a user to the lobby, it opens a new websocket (player) for the username
func (*Lobby) RemoveUser ¶
func (l *Lobby) RemoveUser(playerName game.PlayerName)
RemoveUser removes the user from the lobby and a game, if any
Click to show internal directories.
Click to hide internal directories.