chunk7

package
v0.0.0-...-bee29bd Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Header ChunkHeader
	Data   []byte
}

func UnpackChunks

func UnpackChunks(data []byte) []Chunk

data has to be the uncompressed payload of a teeworlds packet without the packet header

It will return all the chunks (messages) in that packet

type ChunkFlags

type ChunkFlags struct {
	Vital  bool
	Resend bool
}

func (*ChunkFlags) ToInt

func (flags *ChunkFlags) ToInt() int

type ChunkHeader

type ChunkHeader struct {
	Flags ChunkFlags
	Size  int
	// sequence number
	// will be acknowledged in the packet header ack
	Seq int
}

func (*ChunkHeader) Pack

func (header *ChunkHeader) Pack() []byte

func (*ChunkHeader) Unpack

func (header *ChunkHeader) Unpack(u *packer.Unpacker) error

func (*ChunkHeader) UnpackRaw

func (header *ChunkHeader) UnpackRaw(data []byte) error

TODO: give this a better name

but it would be nice to have two unpack methods for all structs

Unpack(u *packer.Unpacker)
UnpackTodoFindAGoodName(data []byte)

See https://github.com/teeworlds-go/protocol/issues/5

Jump to

Keyboard shortcuts

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