Documentation
¶
Index ¶
- func CalculateDistance(x1, y1, z1, x2, y2, z2 float32) float32
- func CalculateDistanceSquared(x1, y1, z1, x2, y2, z2 float32) float32
- func IsMeleeInRange(distance float32) bool
- func IsValidBlockPosition(x, y, z int) bool
- func IsValidBlocks(blocks uint8) bool
- func IsValidGrenades(grenades uint8) bool
- func IsValidHP(hp uint8) bool
- func IsValidOrientation(x, y, z float32) bool
- func IsValidPlayerPosition(x, y, z float32) bool
- func IsValidTeam(team uint8) bool
- func IsValidTool(tool protocol.ItemType) bool
- func IsValidWeapon(weapon protocol.WeaponType) bool
- func IsWeaponInRange(weapon protocol.WeaponType, distance float32) bool
- func NormalizeVector(x, y, z float32) (float32, float32, float32)
- func ReadPacketID(data []byte) (uint8, error)
- func ValidatePacketSize(data []byte, expectedSize int) error
- type DataStream
- func (ds *DataStream) Available() int
- func (ds *DataStream) Bytes() []byte
- func (ds *DataStream) CanRead(n int) bool
- func (ds *DataStream) Len() int
- func (ds *DataStream) ReadBytes(n int) ([]byte, error)
- func (ds *DataStream) ReadFloat32() (float32, error)
- func (ds *DataStream) ReadInt8() (int8, error)
- func (ds *DataStream) ReadUint8() (uint8, error)
- func (ds *DataStream) ReadUint16() (uint16, error)
- func (ds *DataStream) ReadUint32() (uint32, error)
- func (ds *DataStream) Reset()
- func (ds *DataStream) WriteBytes(data []byte) error
- func (ds *DataStream) WriteFloat32(val float32) error
- func (ds *DataStream) WriteInt8(val int8) error
- func (ds *DataStream) WriteUint8(val uint8) error
- func (ds *DataStream) WriteUint16(val uint16) error
- func (ds *DataStream) WriteUint32(val uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateDistance ¶
func IsMeleeInRange ¶
func IsValidBlockPosition ¶
func IsValidBlocks ¶
func IsValidGrenades ¶
func IsValidOrientation ¶
func IsValidPlayerPosition ¶
func IsValidTeam ¶
func IsValidTool ¶
func IsValidWeapon ¶
func IsValidWeapon(weapon protocol.WeaponType) bool
func IsWeaponInRange ¶
func IsWeaponInRange(weapon protocol.WeaponType, distance float32) bool
func ReadPacketID ¶
func ValidatePacketSize ¶
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) 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
Click to show internal directories.
Click to hide internal directories.