Documentation ¶
Overview ¶
package protocol describes the basic types needed to work with the Minecraft protocol this server is being developed for protocol version 498 (mc version 1.14.4)
Index ¶
Constants ¶
View Source
const ( Handshaking = iota Login Play Status )
View Source
const (
Version_1_14_4 = 498
)
Variables ¶
View Source
var DefaultParseMap = ParseMap{ Handshaking: { 0x00: ParseHandshake, }, Login: { 0x00: ParseLoginStart, 0x01: ParseEncryptionResponse, }, Play: { 0x05: ParseClientSettings, }, }
DefaultParseMap maps the state and packet id to the parser for each serverbound packet
View Source
var (
ErrWrongPacketType = errors.New("received wrong packet type")
)
Functions ¶
This section is empty.
Types ¶
type Packet ¶
type Packet interface { // ID returns the Packet ID. Since some packets can be both serverbound and clientbound with different IDs // it needs a sBound boolean to know which ID to return. If true, returns the serverbound ID. ID(sBound bool) codec.VarInt // Decode fills the packet fields by reading from the reader r Decode(r io.Reader) error // Encode writes packet data to writer w Encode(w io.Writer) error }
Packet describes a Minecraft packet.
func ParseClientSettings ¶
func ParseEncryptionResponse ¶
func ParseHandshake ¶
func ParseLoginStart ¶
type PacketParser ¶
PacketParser is a function that takes in packet data and returns a specific type of packet based on the id, conforming to the Packet interface
Directories ¶
Path | Synopsis |
---|---|
From https://play.golang.org/p/LTbId4b6M2 also many thanks to github.com/Tnze/go-mc
|
From https://play.golang.org/p/LTbId4b6M2 also many thanks to github.com/Tnze/go-mc |
Package codec implements the various minecraft protocol types
|
Package codec implements the various minecraft protocol types |
Package packet implements the various packets of the minecraft protocol Reference: https://wiki.vg/index.php?title=Protocol&oldid=15289
|
Package packet implements the various packets of the minecraft protocol Reference: https://wiki.vg/index.php?title=Protocol&oldid=15289 |
Click to show internal directories.
Click to hide internal directories.