session

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor interface {
	// ProcessIncoming determines whether the provided packet, incoming from the server, should be received by the client.
	// It returns true if the packet should be received, otherwise false.
	ProcessIncoming(packet packet.Packet) bool
	// ProcessOutgoing determines whether the provided packet, outgoing from the client, should be sent to the server.
	// It returns true if the packet should be sent, otherwise false.
	ProcessOutgoing(packet packet.Packet) bool
}

Processor is an interface that defines methods for processing incoming and outgoing packets in a session.

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) AddSession

func (r *Registry) AddSession(xuid string, session *Session)

func (*Registry) GetSession

func (r *Registry) GetSession(xuid string) *Session

func (*Registry) GetSessionByUsername

func (r *Registry) GetSessionByUsername(username string) *Session

func (*Registry) GetSessions

func (r *Registry) GetSessions() []*Session

func (*Registry) RemoveSession

func (r *Registry) RemoveSession(xuid string)

type Session

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

func NewSession

func NewSession(clientConn *minecraft.Conn, token string, logger internal.Logger, registry *Registry, discovery server.Discovery, latencyInterval int64) (s *Session, err error)

func (*Session) Animation added in v0.0.4

func (s *Session) Animation() animation.Animation

func (*Session) Close

func (s *Session) Close()

func (*Session) Disconnect

func (s *Session) Disconnect(message string)

func (*Session) Latency

func (s *Session) Latency() int64

func (*Session) Server

func (s *Session) Server() *server.Conn

func (*Session) SetAnimation

func (s *Session) SetAnimation(animation animation.Animation)

func (*Session) SetProcessor

func (s *Session) SetProcessor(processor Processor)

func (*Session) Transfer

func (s *Session) Transfer(addr string) error

type Tracker

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

func NewTracker

func NewTracker() *Tracker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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