Documentation ¶
Index ¶
- Constants
- func ReadBool(buf *bufio.Reader) bool
- func ReadByteSlice(buf *bufio.Reader) []byte
- func ReadFloat32(buf *bufio.Reader) float32
- func ReadFloat64(buf *bufio.Reader) float64
- func ReadInt16(buf *bufio.Reader) int16
- func ReadInt32(buf *bufio.Reader) int32
- func ReadInt64(buf *bufio.Reader) int64
- func ReadInt8(buf *bufio.Reader) int8
- func ReadString(buf *bufio.Reader) string
- func ReadUUID(buf *bufio.Reader) uuid.UUID
- func ReadUint16(buf *bufio.Reader) uint16
- func ReadUint32(buf *bufio.Reader) uint32
- func ReadUint64(buf *bufio.Reader) uint64
- func ReadUint8(buf *bufio.Reader) uint8
- func ReadVarInt32(buf *bufio.Reader) int32
- func ReadVarInt64(buf *bufio.Reader) int64
- func WriteBool(v bool) []byte
- func WriteByteSlice(v []byte) []byte
- func WriteFloat32(v float32) []byte
- func WriteFloat64(v float64) []byte
- func WriteInt16(v int16) []byte
- func WriteInt32(v int32) []byte
- func WriteInt64(v int64) []byte
- func WriteInt8(v int8) []byte
- func WriteString(v string) []byte
- func WriteUUID(v uuid.UUID) []byte
- func WriteUint16(v uint16) []byte
- func WriteUint32(v uint32) []byte
- func WriteUint64(v uint64) []byte
- func WriteUint8(v uint8) []byte
- func WriteVarInt32(v int32) []byte
- func WriteVarInt64(v int64) []byte
- type ConnectionState
- type Direction
- type Disconnect
- type EncryptionRequest
- type EncryptionResponse
- type HandshakePacket
- type LegacyPingPacket
- type LoginPluginRequest
- type LoginPluginResponse
- type LoginStart
- type LoginSuccess
- type Packet
- type SetCompression
- type StatusPing
- type StatusPong
- type StatusRequest
- type StatusResponse
Constants ¶
View Source
const ( ClientToServer = false ServerToClient = true )
View Source
const LegacyPingPayload = 0xFE
View Source
const Version = 756
View Source
const VersionDescription = "1.17.1"
Variables ¶
This section is empty.
Functions ¶
func ReadByteSlice ¶
func ReadFloat32 ¶
func ReadFloat64 ¶
func ReadString ¶
func ReadUint16 ¶
func ReadUint32 ¶
func ReadUint64 ¶
func ReadVarInt32 ¶
func ReadVarInt64 ¶
func WriteByteSlice ¶
func WriteFloat32 ¶
func WriteFloat64 ¶
func WriteInt16 ¶
func WriteInt32 ¶
func WriteInt64 ¶
func WriteString ¶
func WriteUint16 ¶
func WriteUint32 ¶
func WriteUint64 ¶
func WriteUint8 ¶
func WriteVarInt32 ¶
func WriteVarInt64 ¶
Types ¶
type ConnectionState ¶
type ConnectionState int
const ( Handshake ConnectionState = iota Status Login Play )
func (ConnectionState) String ¶
func (p ConnectionState) String() string
type Disconnect ¶
type Disconnect struct {
Reason string // TODO: chat message json
}
func (*Disconnect) Decode ¶
func (p *Disconnect) Decode(buf *bufio.Reader)
func (*Disconnect) Encode ¶
func (p *Disconnect) Encode() []byte
func (*Disconnect) Id ¶
func (p *Disconnect) Id() int32
type EncryptionRequest ¶
func (*EncryptionRequest) Decode ¶
func (p *EncryptionRequest) Decode(buf *bufio.Reader)
func (*EncryptionRequest) Encode ¶
func (p *EncryptionRequest) Encode() []byte
func (*EncryptionRequest) Id ¶
func (p *EncryptionRequest) Id() int32
type EncryptionResponse ¶
type EncryptionResponse struct { VerifyToken []byte }
func (*EncryptionResponse) Decode ¶
func (p *EncryptionResponse) Decode(buf *bufio.Reader)
func (*EncryptionResponse) Encode ¶
func (p *EncryptionResponse) Encode() []byte
func (*EncryptionResponse) Id ¶
func (p *EncryptionResponse) Id() int32
type HandshakePacket ¶
type HandshakePacket struct { ProtocolVersion int32 ServerHost string ServerPort uint16 NextState int32 }
func (*HandshakePacket) Decode ¶
func (p *HandshakePacket) Decode(buf *bufio.Reader)
func (*HandshakePacket) Encode ¶
func (p *HandshakePacket) Encode() []byte
func (*HandshakePacket) Id ¶
func (p *HandshakePacket) Id() int32
type LegacyPingPacket ¶
type LegacyPingPacket struct { Payload byte ProtocolVersion byte PluginMessage byte Hostname string Port int32 }
func (*LegacyPingPacket) Decode ¶
func (p *LegacyPingPacket) Decode(buf *bufio.Reader)
func (*LegacyPingPacket) Encode ¶
func (p *LegacyPingPacket) Encode() []byte
func (*LegacyPingPacket) Id ¶
func (p *LegacyPingPacket) Id() int32
type LoginPluginRequest ¶
func (*LoginPluginRequest) Decode ¶
func (p *LoginPluginRequest) Decode(buf *bufio.Reader)
func (*LoginPluginRequest) Encode ¶
func (p *LoginPluginRequest) Encode() []byte
func (*LoginPluginRequest) Id ¶
func (p *LoginPluginRequest) Id() int32
type LoginPluginResponse ¶
func (*LoginPluginResponse) Decode ¶
func (p *LoginPluginResponse) Decode(buf *bufio.Reader)
func (*LoginPluginResponse) Encode ¶
func (p *LoginPluginResponse) Encode() []byte
func (*LoginPluginResponse) Id ¶
func (p *LoginPluginResponse) Id() int32
type LoginStart ¶
type LoginStart struct {
Username string
}
func (*LoginStart) Decode ¶
func (p *LoginStart) Decode(buf *bufio.Reader)
func (*LoginStart) Encode ¶
func (p *LoginStart) Encode() []byte
func (*LoginStart) Id ¶
func (p *LoginStart) Id() int32
type LoginSuccess ¶
func (*LoginSuccess) Decode ¶
func (p *LoginSuccess) Decode(buf *bufio.Reader)
func (*LoginSuccess) Encode ¶
func (p *LoginSuccess) Encode() []byte
func (*LoginSuccess) Id ¶
func (p *LoginSuccess) Id() int32
type SetCompression ¶
type SetCompression struct {
Threshold int32
}
func (*SetCompression) Decode ¶
func (p *SetCompression) Decode(buf *bufio.Reader)
func (*SetCompression) Encode ¶
func (p *SetCompression) Encode() []byte
func (*SetCompression) Id ¶
func (p *SetCompression) Id() int32
type StatusPing ¶
type StatusPing struct {
Time int64
}
func (*StatusPing) Decode ¶
func (p *StatusPing) Decode(buf *bufio.Reader)
func (*StatusPing) Encode ¶
func (p *StatusPing) Encode() []byte
func (*StatusPing) Id ¶
func (p *StatusPing) Id() int32
type StatusPong ¶
type StatusPong struct {
Time int64
}
func (*StatusPong) Decode ¶
func (p *StatusPong) Decode(buf *bufio.Reader)
func (*StatusPong) Encode ¶
func (p *StatusPong) Encode() []byte
func (*StatusPong) Id ¶
func (p *StatusPong) Id() int32
type StatusRequest ¶
type StatusRequest struct{}
func (*StatusRequest) Decode ¶
func (p *StatusRequest) Decode(_ *bufio.Reader)
func (*StatusRequest) Encode ¶
func (p *StatusRequest) Encode() []byte
func (*StatusRequest) Id ¶
func (p *StatusRequest) Id() int32
type StatusResponse ¶
type StatusResponse struct {
Response string
}
func (*StatusResponse) Decode ¶
func (p *StatusResponse) Decode(buf *bufio.Reader)
func (*StatusResponse) Encode ¶
func (p *StatusResponse) Encode() []byte
func (*StatusResponse) Id ¶
func (p *StatusResponse) Id() int32
Click to show internal directories.
Click to hide internal directories.