Documentation ¶
Index ¶
- Constants
- func NewDecryptReader(r io.Reader, secret []byte) (reader io.Reader, err error)
- func NewEncryptWriter(w io.Writer, secret []byte) (wr io.Writer, err error)
- type Decoder
- type Encoder
- func (e *Encoder) SetCompression(threshold, level int) (err error)
- func (e *Encoder) SetProtocol(protocol proto.Protocol)
- func (e *Encoder) SetState(state *state.Registry)
- func (e *Encoder) SetWriter(w io.Writer)
- func (e *Encoder) Sync(fn func() error) error
- func (e *Encoder) Write(payload []byte) (n int, err error)
- func (e *Encoder) WritePacket(packet proto.Packet) (n int, err error)
Constants ¶
View Source
const ( VanillaMaximumUncompressedSize = 8 * 1024 * 1024 // 8MiB HardMaximumUncompressedSize = 16 * 1024 * 1024 // 16MiB UncompressedCap = VanillaMaximumUncompressedSize )
Variables ¶
This section is empty.
Functions ¶
func NewDecryptReader ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is a synchronized packet decoder for the Minecraft Java edition.
func NewDecoder ¶
func (*Decoder) Decode ¶
func (d *Decoder) Decode() (ctx *proto.PacketContext, err error)
Decode reads the next packet from the underlying reader. It blocks other calls to Decode until return.
func (*Decoder) SetCompressionThreshold ¶
func (*Decoder) SetProtocol ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is a synchronized packet encoder.
func (*Encoder) SetCompression ¶
func (*Encoder) SetProtocol ¶
func (*Encoder) Sync ¶
Sync locks the encoder while running fn, making sure no write calls are run during this call.
Click to show internal directories.
Click to hide internal directories.