validation

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDistance

func CalculateDistance(x1, y1, z1, x2, y2, z2 float32) float32

func CalculateDistanceSquared

func CalculateDistanceSquared(x1, y1, z1, x2, y2, z2 float32) float32

func IsMeleeInRange

func IsMeleeInRange(distance float32) bool

func IsValidBlockPosition

func IsValidBlockPosition(x, y, z int) bool

func IsValidBlocks

func IsValidBlocks(blocks uint8) bool

func IsValidGrenades

func IsValidGrenades(grenades uint8) bool

func IsValidHP

func IsValidHP(hp uint8) bool

func IsValidOrientation

func IsValidOrientation(x, y, z float32) bool

func IsValidPlayerPosition

func IsValidPlayerPosition(x, y, z float32) bool

func IsValidTeam

func IsValidTeam(team uint8) bool

func IsValidTool

func IsValidTool(tool protocol.ItemType) bool

func IsValidWeapon

func IsValidWeapon(weapon protocol.WeaponType) bool

func IsWeaponInRange

func IsWeaponInRange(weapon protocol.WeaponType, distance float32) bool

func NormalizeVector

func NormalizeVector(x, y, z float32) (float32, float32, float32)

func ReadPacketID

func ReadPacketID(data []byte) (uint8, error)

func ValidatePacketSize

func ValidatePacketSize(data []byte, expectedSize int) error

Types

type DataStream

type DataStream struct {
	// contains filtered or unexported fields
}

func NewDataStream

func NewDataStream(data []byte) *DataStream

func NewDataStreamWriter

func NewDataStreamWriter() *DataStream

func (*DataStream) Available

func (ds *DataStream) Available() int

func (*DataStream) Bytes

func (ds *DataStream) Bytes() []byte

func (*DataStream) CanRead

func (ds *DataStream) CanRead(n int) bool

func (*DataStream) Len

func (ds *DataStream) Len() int

func (*DataStream) ReadBytes

func (ds *DataStream) ReadBytes(n int) ([]byte, error)

func (*DataStream) ReadFloat32

func (ds *DataStream) ReadFloat32() (float32, error)

func (*DataStream) ReadInt8

func (ds *DataStream) ReadInt8() (int8, error)

func (*DataStream) ReadUint8

func (ds *DataStream) ReadUint8() (uint8, error)

func (*DataStream) ReadUint16

func (ds *DataStream) ReadUint16() (uint16, error)

func (*DataStream) ReadUint32

func (ds *DataStream) ReadUint32() (uint32, error)

func (*DataStream) Reset

func (ds *DataStream) Reset()

func (*DataStream) WriteBytes

func (ds *DataStream) WriteBytes(data []byte) error

func (*DataStream) WriteFloat32

func (ds *DataStream) WriteFloat32(val float32) error

func (*DataStream) WriteInt8

func (ds *DataStream) WriteInt8(val int8) error

func (*DataStream) WriteUint8

func (ds *DataStream) WriteUint8(val uint8) error

func (*DataStream) WriteUint16

func (ds *DataStream) WriteUint16(val uint16) error

func (*DataStream) WriteUint32

func (ds *DataStream) WriteUint32(val uint32) error

Jump to

Keyboard shortcuts

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