codec

package module
v0.0.0-...-8eaac80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2021 License: MIT Imports: 18 Imported by: 0

README

JungleMC Codec

Go library for encoding/decoding data for Minecraft

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(writer *bufio.Writer, tag reflect.StructTag, v interface{}) (err error)

func MarshalPrimitive

func MarshalPrimitive(writer *bufio.Writer, tag reflect.StructTag, v reflect.Value) (err error, ok bool)

func MarshallTyped

func MarshallTyped(writer *bufio.Writer, val reflect.Value, v interface{}) (err error, ok bool)

func ReadBool

func ReadBool(reader *bufio.Reader) (bool, error)

func ReadByte

func ReadByte(reader *bufio.Reader) (byte, error)

func ReadFloat32

func ReadFloat32(reader *bufio.Reader) (float32, error)

func ReadFloat64

func ReadFloat64(reader *bufio.Reader) (float64, error)

func ReadInt16

func ReadInt16(reader *bufio.Reader) (int16, error)

func ReadInt32

func ReadInt32(reader *bufio.Reader) (int32, error)

func ReadInt64

func ReadInt64(reader *bufio.Reader) (int64, error)

func ReadInt8

func ReadInt8(reader *bufio.Reader) (int8, error)

func ReadString

func ReadString(reader *bufio.Reader) (string, error)

func ReadUInt16

func ReadUInt16(reader *bufio.Reader) (uint16, error)

func ReadUInt32

func ReadUInt32(reader *bufio.Reader) (uint32, error)

func ReadUInt64

func ReadUInt64(reader *bufio.Reader) (uint64, error)

func ReadVarInt32

func ReadVarInt32(reader *bufio.Reader) (int32, error)

func ReadVarInt64

func ReadVarInt64(reader *bufio.Reader) (int64, error)

func Unmarshal

func Unmarshal(reader *bufio.Reader, tag reflect.StructTag, value reflect.Value) (err error)

func UnmarshalPrimitive

func UnmarshalPrimitive(reader *bufio.Reader, tag reflect.StructTag, value reflect.Value) (err error, ok bool)

func UnmarshalTyped

func UnmarshalTyped(reader *bufio.Reader, value reflect.Value) (err error, ok bool)

func WriteBool

func WriteBool(writer *bufio.Writer, v bool) error

func WriteByte

func WriteByte(writer *bufio.Writer, v byte) error

func WriteByteSlice

func WriteByteSlice(writer *bufio.Writer, tag reflect.StructTag, v []byte) error

func WriteFloat32

func WriteFloat32(writer *bufio.Writer, v float32) error

func WriteFloat64

func WriteFloat64(writer *bufio.Writer, v float64) error

func WriteInt16

func WriteInt16(writer *bufio.Writer, v int16) error

func WriteInt32

func WriteInt32(writer *bufio.Writer, v int32) error

func WriteInt64

func WriteInt64(writer *bufio.Writer, v int64) error

func WriteInt8

func WriteInt8(writer *bufio.Writer, v int8) error

func WritePacket

func WritePacket(writer *bufio.Writer, v reflect.Value, proto Protocol, compressed bool, compressionThreshold int32) error

func WriteString

func WriteString(writer *bufio.Writer, v string) error

func WriteUInt16

func WriteUInt16(writer *bufio.Writer, v uint16) error

func WriteUInt32

func WriteUInt32(writer *bufio.Writer, v uint32) error

func WriteUInt64

func WriteUInt64(writer *bufio.Writer, v uint64) error

func WriteVarInt32

func WriteVarInt32(writer *bufio.Writer, v int32) error

func WriteVarInt64

func WriteVarInt64(writer *bufio.Writer, v int64) error

Types

type Packet

type Packet interface{}

func ReadPacket

func ReadPacket(reader *bufio.Reader, proto Protocol, compressed bool, compressionThreshold int32) (Packet, error)

type Protocol

type Protocol int
const (
	ProtocolHandshake Protocol = iota
	ProtocolStatus
	ProtocolLogin
	ProtocolPlay
)

func (Protocol) String

func (p Protocol) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL