Documentation
¶
Index ¶
- type Processor
- type Registry
- type Session
- func (s *Session) Animation() animation.Animation
- func (s *Session) Client() *minecraft.Conn
- func (s *Session) Close()
- func (s *Session) Disconnect(message string)
- func (s *Session) Latency() int64
- func (s *Session) Login() (err error)
- func (s *Session) Opts() util.Opts
- func (s *Session) Processor() Processor
- func (s *Session) Server() *server.Conn
- func (s *Session) SetAnimation(animation animation.Animation)
- func (s *Session) SetOpts(opts util.Opts)
- func (s *Session) SetProcessor(processor Processor)
- func (s *Session) Transfer(addr string) error
- type Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Processor ¶
type Processor interface { // ProcessServer determines whether the provided packet, originating from the server, should be forwarded to the client. // It returns true if the packet should be forwarded, otherwise false. ProcessServer(packet packet.Packet) bool // ProcessClient determines whether the provided packet, originating from the client, should be forwarded to the server. // It returns true if the packet should be forwarded, otherwise false. ProcessClient(packet packet.Packet) bool // ProcessPreTransfer is called before transferring the client to a different server. // It can be used for pre-processing tasks before the client transfer starts. // The 'addr' parameter represents the address of the target server. // It returns true if the transfer process should proceed, otherwise false. ProcessPreTransfer(addr string) bool // ProcessPostTransfer is called after transferring the client to a different server. // It can be used for post-processing tasks after the client transfer completes. // The 'addr' parameter represents the address of the target server. // Although this method returns a boolean value, it is not currently used and exists for the sake of completeness. ProcessPostTransfer(addr string) bool // ProcessDisconnection is called when the client disconnects from the server. // It can be used for post-processing tasks after the disconnection occurs. // Although this method returns a boolean value, it is not currently used and exists for the sake of completeness. ProcessDisconnection() bool }
Processor is an interface defining methods for handling events such as packet sending/receiving, transfers and disconnection.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) AddSession ¶
func (*Registry) GetSession ¶
func (*Registry) GetSessionByUsername ¶
func (*Registry) GetSessions ¶
func (*Registry) RemoveSession ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) Disconnect ¶
func (*Session) SetAnimation ¶
func (*Session) SetProcessor ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
func NewTracker ¶
func NewTracker() *Tracker
Source Files
¶
Click to show internal directories.
Click to hide internal directories.