Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comm ¶
type Comm interface { // Id returns the session id of socket. Id() string // Rooms returns the rooms name joined now. Rooms() []string // On registers the function f to handle an event. On(event string, f interface{}) error // Emit emits an event with given args. Emit(event string, args ...interface{}) error // Join joins the room. Join(room string) error // Leave leaves the room. Leave(room string) error // BroadcastTo broadcasts an event to the room with given args. BroadcastTo(room, event string, args ...interface{}) error }
Comm provides an interface to communicate with the Player
type Game ¶
type Game struct { FileName string `toml:"-"` Lobby *Lobby MinPlayers int `toml:"minPlayers"` MaxPlayers int `toml:"maxPlayers"` Title string `toml:"displayTitle"` UUID string `toml:"uniqueKey"` }
Game contains all of our registered game information
type Lobby ¶
Lobby is basically a FIFO queue that is threadsafe through the usage of mutex it uses a slice as the data store and a string to bool map to keep of track of items in the queue
func (*Lobby) AddToQueue ¶
AddToQueue adds a player to the queue
func (*Lobby) PopFromQueue ¶
PopFromQueue returns a player from the queue: FIFO
Click to show internal directories.
Click to hide internal directories.