Documentation
¶
Index ¶
- type Conn
- func (c *Conn) Close(err error)
- func (c *Conn) DecodePacket(pk packet.Packet) error
- func (c *Conn) FlushPackets() error
- func (c *Conn) Name() string
- func (c *Conn) Properties() []types.Property
- func (c *Conn) ReadPacket() (packet.Packet, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SendPacket(pk packet.Packet) error
- func (c *Conn) UUID() [16]byte
- func (c *Conn) WritePacket(pk packet.Packet) error
- type Dialer
- type ListenConfig
- type Listener
- type NopPool
- type Pool
- type ProxyConfig
- type ProxyError
- type ProxyListener
- type ServerBoundPool
- type Status
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { Pool Pool // contains filtered or unexported fields }
func (*Conn) FlushPackets ¶
func (*Conn) Properties ¶
func (*Conn) RemoteAddr ¶
func (*Conn) SendPacket ¶
SendPacket writes and immediately sends the packet. Use for critical information. overusing can cause more latency and bandwidth to be used.
func (*Conn) WritePacket ¶
WritePacket writes the packet to a buffer. Use for situations where packets don't need to be sent IMMEDIATELY. Chat messages etc. Can also be used to improve bandwidth and client side latency by sending all the data at once. Just make sure it's done in a timely way
type ListenConfig ¶
type ListenConfig struct { // Status handles the information showed to the client on the server list // which includes description, favicon, online/max players and protocol version and name Status *Status // OnlineMode enables server side encryption. // cracked accounts will not be able to connect when online mode is true. OnlineMode bool // CompressionThreshold compresses packets when they exceed n bytes. //-1 disables compression // 0 compresses everything CompressionThreshold int32 // If Protocol is not nil the returned boolean determines if the server // should proceed with logging in. If the returned value is bool the // string value is used as the disconnect reason. Protocol func(v int32) (bool, string) }
type ProxyConfig ¶
type ProxyConfig struct { // OnReceive called when a packet is received from the client or server. // Returning false will drop the packet. OnReceive func(conn *Conn, pk packet.Packet, fromServer bool, state int) bool //ErrCh receives errors from the client and server ErrCh chan ProxyError }
func (*ProxyConfig) Listen ¶
func (cfg *ProxyConfig) Listen(addr, targetAddr string) (*ProxyListener, error)
type ProxyError ¶
type ProxyError struct { //State is the protocol state the error occurred in State int Addr net.Addr Err error }
func (ProxyError) Error ¶
func (p ProxyError) Error() string
type ProxyListener ¶
type ProxyListener struct {
// contains filtered or unexported fields
}
func (*ProxyListener) Close ¶
func (l *ProxyListener) Close() error
type ServerBoundPool ¶
type ServerBoundPool struct{}
ServerBoundPool implements the Pool interface and returns the server bound packets for the play state.
Click to show internal directories.
Click to hide internal directories.