proto_base

package
v0.0.0-...-82b4563 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadTypeError = errors.New("bad type")
View Source
var ToDoError = errors.New("to do")

Functions

func DecodeString

func DecodeString(r io.Reader) (ret string, err error)

func DecodeVarInt

func DecodeVarInt(r io.Reader) (ret int32, err error)

func DecodeVarLong

func DecodeVarLong(r io.Reader) (ret int64, err error)

func EncodeString

func EncodeString(w io.Writer, s string) (err error)

func EncodeVarInt

func EncodeVarInt(w io.Writer, v int32) (err error)

func EncodeVarLong

func EncodeVarLong(w io.Writer, v int64) (err error)

func ErroringIndex

func ErroringIndex[K comparable, V any, M map[K]V](m M, i K) (v V, err error)

Types

type Actor

type Actor int
const (
	Servee Actor = iota // Servee is the one being served
	Client
)

func (Actor) ReceiveDirection

func (a Actor) ReceiveDirection() Direction

func (Actor) SendDirection

func (a Actor) SendDirection() Direction

type Direction

type Direction int
const (
	ToServer Direction = iota
	ToClient
)

func (Direction) Opposite

func (d Direction) Opposite() Direction

func (Direction) String

func (d Direction) String() string

type EncodeDecodeAble

type EncodeDecodeAble interface {
	Encode(w io.Writer) (err error)
	Decode(r io.Reader) (err error)
}

type PacketInfo

type PacketInfo struct {
	Type            EncodeDecodeAble
	Name            string
	Direction       Direction
	State           State
	PacketId        int32
	ProtocolVersion int32
}

type RestBuffer

type RestBuffer []byte

func (*RestBuffer) Decode

func (b *RestBuffer) Decode(r io.Reader) (err error)

func (*RestBuffer) Encode

func (b *RestBuffer) Encode(w io.Writer) (err error)

type State

type State int32
const (
	Handshaking State = iota
	Status
	Login
	Configuration
	Play
)

type ToDo

type ToDo struct{}

func (ToDo) Decode

func (t ToDo) Decode(_ io.Reader) (ret ToDo, err error)

func (ToDo) Encode

func (t ToDo) Encode(_ io.Writer) (err error)

Jump to

Keyboard shortcuts

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