Documentation
¶
Index ¶
- Constants
- Variables
- func NewClient() uuid.UUID
- type Client
- func (c *Client) AddPlayer(p *Player) error
- func (c *Client) ConnectSocket(ws *websocket.Conn) error
- func (c *Client) DisconnectSocket() error
- func (c *Client) GetPlayer() (*Player, error)
- func (c *Client) GetRoom() (*Room, error)
- func (c *Client) Login(p *Player, r *Room) error
- func (c *Client) SendMessage(m WsMessage) error
- func (c *Client) SetPlayer(p *Player) error
- func (c *Client) SetRoom(r *Room) error
- func (c *Client) UnsetRoom(r *Room) error
- type Player
- type Room
- type WsMessage
Constants ¶
View Source
const ( WssDisconnected = iota WssConnecting WssConnected )
View Source
const ( WsmUpdateRoom = WsMessage("UPDATE_ROOM") WsmUpdateBoard = WsMessage("UPDATE_BOARD") WsmConnectionReady = WsMessage("CONNECTION_READY") )
Variables ¶
View Source
var Connections = make(map[uuid.UUID]*Client, 100)
View Source
var Rooms = make(map[string]*Room, 100)
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func GetClientByUUIDString ¶
func (*Client) DisconnectSocket ¶
func (*Client) SendMessage ¶
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
func GetOrMakeRoom ¶
func (*Room) NotifyClients ¶
func (*Room) PlayerExists ¶
func (*Room) PlayerNames ¶
Click to show internal directories.
Click to hide internal directories.