Documentation ¶
Index ¶
- Constants
- type ClientManager
- func (m *ClientManager) Add(c *client.Client)
- func (m *ClientManager) Clients() map[string]*client.Client
- func (m *ClientManager) Get(sessionId string) *client.Client
- func (m *ClientManager) Mutex() *sync.Mutex
- func (m *ClientManager) Remove(c *client.Client)
- func (m *ClientManager) StartTicker()
- func (m *ClientManager) StopTicker()
- func (m *ClientManager) UpdateSession(c *client.Client, session *client.Session)
- type HandlerFunc
- type HandlerList
- type HandlerManager
- type HandlerMap
- type Room
- type RoomManager
- type ServerHandlerFunc
- type ServerHandlerList
- type ServerHandlerMap
- type SessionManager
- type SessionMap
- type UserSessionMap
Constants ¶
View Source
const (
KeepAliveTimeout = keepAliveTime + time.Second*3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientManager ¶
type ClientManager struct {
// contains filtered or unexported fields
}
func NewClientManager ¶
func NewClientManager() *ClientManager
func (*ClientManager) Add ¶
func (m *ClientManager) Add(c *client.Client)
func (*ClientManager) Mutex ¶
func (m *ClientManager) Mutex() *sync.Mutex
func (*ClientManager) Remove ¶
func (m *ClientManager) Remove(c *client.Client)
func (*ClientManager) StartTicker ¶
func (m *ClientManager) StartTicker()
func (*ClientManager) StopTicker ¶
func (m *ClientManager) StopTicker()
func (*ClientManager) UpdateSession ¶
func (m *ClientManager) UpdateSession(c *client.Client, session *client.Session)
type HandlerFunc ¶
type HandlerList ¶
type HandlerList []HandlerFunc
type HandlerManager ¶
type HandlerManager struct {
// contains filtered or unexported fields
}
func NewHandlerManager ¶
func NewHandlerManager() *HandlerManager
func (*HandlerManager) Handle ¶
func (h *HandlerManager) Handle(packet *resource.Packet, client *client.Client)
func (*HandlerManager) HandleServer ¶
func (h *HandlerManager) HandleServer(msg *dispatcher.Message)
func (*HandlerManager) Register ¶
func (h *HandlerManager) Register(op opcode.Opcode, fn HandlerFunc)
func (*HandlerManager) RegisterServer ¶
func (h *HandlerManager) RegisterServer(op opcode.Opcode, fn ServerHandlerFunc)
type HandlerMap ¶
type HandlerMap map[opcode.Opcode]HandlerList
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
func (*Room) Dispatch ¶
func (r *Room) Dispatch(msg *dispatcher.Message)
func (*Room) NumClients ¶
type RoomManager ¶
type RoomManager struct {
// contains filtered or unexported fields
}
func NewRoomManager ¶
func NewRoomManager(subMgr *dispatcher.SubscriptionManager) *RoomManager
type ServerHandlerFunc ¶
type ServerHandlerFunc func(packet *dispatcher.Message)
type ServerHandlerList ¶
type ServerHandlerList []ServerHandlerFunc
type ServerHandlerMap ¶
type ServerHandlerMap map[opcode.Opcode]ServerHandlerList
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func NewSessionManager ¶
func NewSessionManager() *SessionManager
func (*SessionManager) Add ¶
func (s *SessionManager) Add(session *client.Session)
func (*SessionManager) GetByUserId ¶
func (s *SessionManager) GetByUserId(userId model.UserId) SessionMap
func (*SessionManager) Remove ¶
func (s *SessionManager) Remove(session *client.Session)
type SessionMap ¶
type UserSessionMap ¶
type UserSessionMap = map[model.UserId]SessionMap // map indexed by user id containing each session for that user
Click to show internal directories.
Click to hide internal directories.