protocol

package
v0.0.0-...-727d1a2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Version = 260

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

type Packet []byte

Packet represents a Sauerbraten UDP packet.

func (*Packet) GetByte

func (p *Packet) GetByte() (byte, bool)

func (*Packet) GetInt

func (p *Packet) GetInt() (int32, bool)

GetInt returns the integer value encoded in the next byte(s) of the packet.

func (*Packet) GetString

func (p *Packet) GetString() (s string, ok bool)

GetString returns a string of the next bytes up to 0x00.

func (*Packet) GetUint

func (p *Packet) GetUint() (v uint32, ok bool)

func (*Packet) GetVector

func (p *Packet) GetVector() (*geom.Vector, bool)

func (*Packet) PutInt

func (p *Packet) PutInt(v int32)

PutInt writes an int32 to the packet buffer.

func (*Packet) PutString

func (p *Packet) PutString(s string)

PutInt writes a string to the packet buffer, encoding it with Sauer's conversion table at the same time.

func (*Packet) PutUint

func (p *Packet) PutUint(v uint32)

PutUint writes a uint32 to the packet buffer. It only keeps the 28 lowest bits!

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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