Versions in this module Expand all Collapse all v0 v0.8.1 Feb 26, 2022 Changes in this version type Ready + DrawingTimeSetting int v0.8.0 Feb 19, 2022 Changes in this version + const DrawingBoardBaseHeight + const DrawingBoardBaseWidth + const GameOver + const MaxBrushSize + const MaxPlayerNameLength + const MinBrushSize + const Ongoing + const Unstarted + var LobbySettingBounds = &SettingBounds + var SupportedLanguages = map[string]string + func CreateLobby(playerName, chosenLanguage string, publicLobby bool, ...) (*Player, *Lobby, error) + func GetRandomWords(wordCount int, lobby *Lobby) []string + func SanitizeName(name string) string + type EditableLobbySettings struct + ClientsPerIPLimit int + CustomWordsChance int + DrawingTime int + EnableVotekick bool + MaxPlayers int + Public bool + Rounds int + type Fill struct + Color RGBColor + X float32 + Y float32 + type FillEvent struct + Data *Fill + Type string + type GameEvent struct + Data interface{} + Type string + type GameOverEvent struct + PreviousWord string + type KickVote struct + PlayerID string + PlayerName string + RequiredVoteCount int + VoteCount int + type Line struct + Color RGBColor + FromX float32 + FromY float32 + LineWidth float32 + ToX float32 + ToY float32 + type LineEvent struct + Data *Line + Type string + type Lobby struct + CurrentWord string + CustomWords []string + DrawingTimeNew int + LastPlayerDisconnectTime *time.Time + LobbyID string + Owner *Player + Round int + RoundEndTime int64 + State gameState + Wordpack string + WriteJSON func(player *Player, object interface{}) error + func (lobby *Lobby) AppendFill(fill *FillEvent) + func (lobby *Lobby) AppendLine(line *LineEvent) + func (lobby *Lobby) CanIPConnect(address string) bool + func (lobby *Lobby) ClearDrawing() + func (lobby *Lobby) GetAvailableWordHints(player *Player) []*WordHint + func (lobby *Lobby) GetConnectedPlayerCount() int + func (lobby *Lobby) GetOccupiedPlayerSlots() int + func (lobby *Lobby) GetPlayer(userSession string) *Player + func (lobby *Lobby) GetPlayers() []*Player + func (lobby *Lobby) HandleEvent(raw []byte, received *GameEvent, player *Player) error + func (lobby *Lobby) HasConnectedPlayers() bool + func (lobby *Lobby) HasFreePlayerSlot() bool + func (lobby *Lobby) IsPublic() bool + func (lobby *Lobby) JoinPlayer(playerName string) *Player + func (lobby *Lobby) OnPlayerConnectUnsynchronized(player *Player) + func (lobby *Lobby) OnPlayerDisconnect(player *Player) + func (lobby *Lobby) Shutdown() + func (lobby *Lobby) Synchronized(logic func()) + func (lobby *Lobby) TriggerUpdateEvent(eventType string, data interface{}) + type Message struct + Author string + AuthorID string + Content string + type NameChangeEvent struct + PlayerID string + PlayerName string + type NextTurn struct + Players []*Player + PreviousWord string + Round int + RoundEndTime int + type OwnerChangeEvent struct + PlayerID string + PlayerName string + type Player struct + Connected bool + ID string + LastScore int + Name string + Rank int + Score int + State PlayerState + func (player *Player) GetLastKnownAddress() string + func (player *Player) GetUserSession() string + func (player *Player) GetWebsocket() *websocket.Conn + func (player *Player) GetWebsocketMutex() *sync.Mutex + func (player *Player) SetLastKnownAddress(address string) + func (player *Player) SetWebsocket(socket *websocket.Conn) + type PlayerState string + const Drawing + const Guessing + const Standby + type RGBColor struct + B uint8 + G uint8 + R uint8 + type Ready struct + AllowDrawing bool + CurrentDrawing []interface{} + GameState gameState + OwnerID string + PlayerID string + PlayerName string + Players []*Player + Round int + RoundEndTime int + Rounds int + VotekickEnabled bool + WordHints []*WordHint + type SettingBounds struct + MaxClientsPerIPLimit int64 + MaxDrawingTime int64 + MaxMaxPlayers int64 + MaxRounds int64 + MinClientsPerIPLimit int64 + MinDrawingTime int64 + MinMaxPlayers int64 + MinRounds int64 + type WordHint struct + Character rune + Underline bool