session

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSessionManager

func NewSessionManager(engine core.Engine) core.SessionManager

Types

type Session

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

func NewSession

func NewSession(engine core.Engine, id uint32, namespace string, remoteAddr *net.UDPAddr) *Session

func (*Session) Expiry

func (s *Session) Expiry() time.Time

func (*Session) HandlePacket

func (s *Session) HandlePacket(pkt *packet.RTDEXPacket)

func (*Session) ID

func (s *Session) ID() uint32

func (*Session) Namespace

func (s *Session) Namespace() string

func (*Session) RemoteAddr

func (s *Session) RemoteAddr() string

func (*Session) ResetExpiry

func (s *Session) ResetExpiry()

func (*Session) SlotIncrement

func (s *Session) SlotIncrement(slot int)

func (*Session) Start

func (s *Session) Start()

func (*Session) Stop

func (s *Session) Stop()

func (*Session) UpdateRemoteAddr

func (s *Session) UpdateRemoteAddr(remoteAddr *net.UDPAddr)

type SessionManager

type SessionManager struct {
	Sessions sync.Map
	// contains filtered or unexported fields
}

func (*SessionManager) CreateSession

func (m *SessionManager) CreateSession(id uint32, namespace string, remoteAddr *net.UDPAddr) core.Session

func (*SessionManager) GetAllSessions

func (m *SessionManager) GetAllSessions() []core.Session

func (*SessionManager) GetSession

func (m *SessionManager) GetSession(id uint32) core.Session

func (*SessionManager) Housekeeping

func (m *SessionManager) Housekeeping()

func (*SessionManager) RemoveAllSessions

func (m *SessionManager) RemoveAllSessions()

func (*SessionManager) RemoveSession

func (m *SessionManager) RemoveSession(id uint32)

func (*SessionManager) Start

func (m *SessionManager) Start()

func (*SessionManager) WatchSlotSignal

func (m *SessionManager) WatchSlotSignal()

Jump to

Keyboard shortcuts

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