Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MinecraftPacket ¶
type MinecraftPacket struct { // PacketID is a VarInt identifier of the packet // refer to wiki.vg for all the packet ids PacketID int32 Data *bytes.Buffer }
Basic struct containing the PacketID and many methods for serialization.
Compliant to the PacketOP interface
func (*MinecraftPacket) DeserializeData ¶
func (p *MinecraftPacket) DeserializeData(inter interface{}) error
DeserializeData deserializes the data buffer into the struct fields which have a type struct tag
func (*MinecraftPacket) Serialize ¶
func (p *MinecraftPacket) Serialize(compressionTreshold int32) ([]byte, error)
When compressionTreshold is a value below zero the packet gets serialized with the "Without Compression" format. This happens when a server never sent a set compression packet
func (*MinecraftPacket) SerializeData ¶
func (p *MinecraftPacket) SerializeData(inter interface{}) error
SerializeData serializes all the fields in the struct with a type struct tag into the data buffer
Click to show internal directories.
Click to hide internal directories.