manager

package
v0.0.0-...-2d539fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

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) Clients

func (m *ClientManager) Clients() map[string]*client.Client

func (*ClientManager) Get

func (m *ClientManager) Get(sessionId string) *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 HandlerFunc func(packet *resource.Packet, client *client.Client) gateway.Error

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) Add

func (r *Room) Add(c *client.Client)

func (*Room) Clients

func (r *Room) Clients() map[*client.Client]bool

func (*Room) Dispatch

func (r *Room) Dispatch(msg *dispatcher.Message)

func (*Room) Mutex

func (r *Room) Mutex() *sync.Mutex

func (*Room) NumClients

func (r *Room) NumClients() int

func (*Room) Remove

func (r *Room) Remove(c *client.Client)

type RoomManager

type RoomManager struct {
	// contains filtered or unexported fields
}

func NewRoomManager

func NewRoomManager(subMgr *dispatcher.SubscriptionManager) *RoomManager

func (*RoomManager) Create

func (m *RoomManager) Create(ctx context.Context, roomId model.RoomId) (*Room, error)

func (*RoomManager) Delete

func (m *RoomManager) Delete(ctx context.Context, roomId model.RoomId) error

func (*RoomManager) Get

func (m *RoomManager) Get(roomId model.RoomId) *Room

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 SessionMap = map[string]*client.Session // map indexed by session id containing session pointers

type UserSessionMap

type UserSessionMap = map[model.UserId]SessionMap // map indexed by user id containing each session for that user

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL