Documentation ¶
Index ¶
- func BattleService(ws *websocket.Conn, gameUser *user.User, req Request)
- func HandleConnections(w http.ResponseWriter, r *http.Request)
- func InitNodeChecker()
- func LobbyService(ws *websocket.Conn, gameUser *user.User, req Request)
- func ReadSocket(id int, w http.ResponseWriter, r *http.Request)
- func Reader(ws *websocket.Conn, gameUser *user.User)
- func SendMessage(message web_socket_response.Response)
- func Sender()
- func SystemService(ws *websocket.Conn, gameUser *user.User, req Request)
- type GameLoopMessages
- type MessagesGroup
- type MessagesStore
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleConnections ¶
func HandleConnections(w http.ResponseWriter, r *http.Request)
func InitNodeChecker ¶
func InitNodeChecker()
func ReadSocket ¶
func ReadSocket(id int, w http.ResponseWriter, r *http.Request)
func SendMessage ¶
func SendMessage(message web_socket_response.Response)
Types ¶
type GameLoopMessages ¶
type GameLoopMessages struct { Messages []web_socket_response.Response // contains filtered or unexported fields }
func (*GameLoopMessages) AddMessage ¶
func (m *GameLoopMessages) AddMessage(msg web_socket_response.Response)
type MessagesGroup ¶
type MessagesGroup struct { Key string `json:"key"` Messages *GameLoopMessages `json:"messages"` Type string `json:"type"` // move - проверяем функцией "moveMessagesToUser", view - "ResponseToBin" Attributes map[string]string `json:"attributes"` }
type MessagesStore ¶
type MessagesStore struct {
// contains filtered or unexported fields
}
func (*MessagesStore) AddMsg ¶
func (ms *MessagesStore) AddMsg(typeMsg, typeCheck string, msg web_socket_response.Response, attributes map[string]string)
func (*MessagesStore) Clear ¶
func (ms *MessagesStore) Clear()
func (*MessagesStore) GetMessageGroups ¶
func (ms *MessagesStore) GetMessageGroups() []*MessagesGroup
type Request ¶
type Request struct { Event string `json:"event,omitempty"` Service string `json:"service,omitempty"` ID int `json:"id,omitempty"` X int `json:"x"` Y int `json:"y"` SelectUnits []int `json:"select_units,omitempty"` W bool `json:"w"` A bool `json:"a"` S bool `json:"s"` D bool `json:"d"` Z bool `json:"z"` Sp bool `json:"sp"` St bool `json:"st"` Fire bool `json:"fire"` }
Click to show internal directories.
Click to hide internal directories.