object7

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	ItemId int

	Tick            int
	X               int
	Y               int
	VelX            int
	VelY            int
	Angle           int
	Direction       int
	Jumped          int
	HookedPlayer    int
	HookState       int
	HookTick        int
	HookX           int
	HookY           int
	HookDx          int
	HookDy          int
	Health          int
	Armor           int
	AmmoCount       int
	Weapon          network7.Weapon
	Emote           network7.EyeEmote
	AttackTick      int
	TriggeredEvents int
}

func (*Character) Id

func (o *Character) Id() int

func (*Character) Pack

func (o *Character) Pack() []byte

func (*Character) Size

func (o *Character) Size() int

func (*Character) TypeId

func (o *Character) TypeId() int

func (*Character) Unpack

func (o *Character) Unpack(u *packer.Unpacker) error

type Damage

type Damage struct {
	ItemId int

	X int
	Y int
	// affected player receiving damage
	ClientId     int
	Angle        int
	HealthAmount int
	ArmorAmount  int
	// true if the damage receiver the damage dealer
	Self bool
}

damage indicicator displayed as yellow stars around the tee receiving damage

func (*Damage) Id

func (o *Damage) Id() int

func (*Damage) Pack

func (o *Damage) Pack() []byte

func (*Damage) Size

func (o *Damage) Size() int

func (*Damage) TypeId

func (o *Damage) TypeId() int

func (*Damage) Unpack

func (o *Damage) Unpack(u *packer.Unpacker) error

type DeClientInfo

type DeClientInfo struct {
	ItemId int

	Local           bool
	Team            network7.GameTeam
	Name            [4]int
	Clan            [4]int
	Country         int
	SkinPartNames   [6][6]int
	UseCustomColors [6]int
	SkinPartColors  [6]int
}

only used for demos not sent over the network

func (*DeClientInfo) Id

func (o *DeClientInfo) Id() int

func (*DeClientInfo) Pack

func (o *DeClientInfo) Pack() []byte

func (*DeClientInfo) Size

func (o *DeClientInfo) Size() int

func (*DeClientInfo) TypeId

func (o *DeClientInfo) TypeId() int

func (*DeClientInfo) Unpack

func (o *DeClientInfo) Unpack(u *packer.Unpacker) error

type DeGameInfo

type DeGameInfo struct {
	ItemId int

	GameFlags    int
	ScoreLimit   int
	TimeLimit    int
	MatchNum     int
	MatchCurrent int
}

only used for demos never send over the network

func (*DeGameInfo) Id

func (o *DeGameInfo) Id() int

func (*DeGameInfo) Pack

func (o *DeGameInfo) Pack() []byte

func (*DeGameInfo) Size

func (o *DeGameInfo) Size() int

func (*DeGameInfo) TypeId

func (o *DeGameInfo) TypeId() int

func (*DeGameInfo) Unpack

func (o *DeGameInfo) Unpack(u *packer.Unpacker) error

type DeTuneParams

type DeTuneParams struct {
	ItemId int

	Params [32]int
}

only used for demos never send over the network

func (*DeTuneParams) Id

func (o *DeTuneParams) Id() int

func (*DeTuneParams) Pack

func (o *DeTuneParams) Pack() []byte

func (*DeTuneParams) Size

func (o *DeTuneParams) Size() int

func (*DeTuneParams) TypeId

func (o *DeTuneParams) TypeId() int

func (*DeTuneParams) Unpack

func (o *DeTuneParams) Unpack(u *packer.Unpacker) error

type Death

type Death struct {
	ItemId int

	X        int
	Y        int
	ClientId int
}

func (*Death) Id

func (o *Death) Id() int

func (*Death) Pack

func (o *Death) Pack() []byte

func (*Death) Size

func (o *Death) Size() int

func (*Death) TypeId

func (o *Death) TypeId() int

func (*Death) Unpack

func (o *Death) Unpack(u *packer.Unpacker) error

type Explosion

type Explosion struct {
	ItemId int

	X int
	Y int
}

func (*Explosion) Id

func (o *Explosion) Id() int

func (*Explosion) Pack

func (o *Explosion) Pack() []byte

func (*Explosion) Size

func (o *Explosion) Size() int

func (*Explosion) TypeId

func (o *Explosion) TypeId() int

func (*Explosion) Unpack

func (o *Explosion) Unpack(u *packer.Unpacker) error

type Flag

type Flag struct {
	ItemId int

	X    int
	Y    int
	Team network7.GameTeam
}

func (*Flag) Id

func (o *Flag) Id() int

func (*Flag) Pack

func (o *Flag) Pack() []byte

func (*Flag) Size

func (o *Flag) Size() int

func (*Flag) TypeId

func (o *Flag) TypeId() int

func (*Flag) Unpack

func (o *Flag) Unpack(u *packer.Unpacker) error

type GameData

type GameData struct {
	ItemId int

	GameStartTick int

	// GameStateFlags GameStateFlagsStruct
	FlagsRaw int

	GameStateEndTick int
}

func (*GameData) Id

func (o *GameData) Id() int

func (*GameData) Pack

func (o *GameData) Pack() []byte

func (*GameData) Size

func (o *GameData) Size() int

func (*GameData) TypeId

func (o *GameData) TypeId() int

func (*GameData) Unpack

func (o *GameData) Unpack(u *packer.Unpacker) error

type GameDataFlag

type GameDataFlag struct {
	ItemId int

	// It is either the client id of the carrier so 0-64 or one of those values
	//
	// -3 - FLAG_MISSING
	// -2 - FLAG_ATSTAND
	// -1 - FLAG_TAKEN
	FlagCarrierRed int

	// It is either the client id of the carrier so 0-64 or one of those values
	//
	// -3 - FLAG_MISSING
	// -2 - FLAG_ATSTAND
	// -1 - FLAG_TAKEN
	FlagCarrierBlue int

	FlagDropTickRed  int
	FlagDropTickBlue int
}

func (*GameDataFlag) Id

func (o *GameDataFlag) Id() int

func (*GameDataFlag) Pack

func (o *GameDataFlag) Pack() []byte

func (*GameDataFlag) Size

func (o *GameDataFlag) Size() int

func (*GameDataFlag) TypeId

func (o *GameDataFlag) TypeId() int

func (*GameDataFlag) Unpack

func (o *GameDataFlag) Unpack(u *packer.Unpacker) error

type GameDataRace

type GameDataRace struct {
	ItemId int

	BestTime  int
	Precision int
	RaceFlags int
}

this is a new snap item that was added after the 0.7 release so for backwards compability it includes a size field and older clients ignore it

this message is not used by official servers and is part of an effort to support community made race modifications

func (*GameDataRace) Id

func (o *GameDataRace) Id() int

func (*GameDataRace) Pack

func (o *GameDataRace) Pack() []byte

func (*GameDataRace) Size

func (o *GameDataRace) Size() int

func (*GameDataRace) TypeId

func (o *GameDataRace) TypeId() int

func (*GameDataRace) Unpack

func (o *GameDataRace) Unpack(u *packer.Unpacker) error

type GameDataTeam

type GameDataTeam struct {
	ItemId int

	TeamscoreRed  int
	TeamscoreBlue int
}

func (*GameDataTeam) Id

func (o *GameDataTeam) Id() int

func (*GameDataTeam) Pack

func (o *GameDataTeam) Pack() []byte

func (*GameDataTeam) Size

func (o *GameDataTeam) Size() int

func (*GameDataTeam) TypeId

func (o *GameDataTeam) TypeId() int

func (*GameDataTeam) Unpack

func (o *GameDataTeam) Unpack(u *packer.Unpacker) error

type HammerHit

type HammerHit struct {
	ItemId int

	X int
	Y int
}

func (*HammerHit) Id

func (o *HammerHit) Id() int

func (*HammerHit) Pack

func (o *HammerHit) Pack() []byte

func (*HammerHit) Size

func (o *HammerHit) Size() int

func (*HammerHit) TypeId

func (o *HammerHit) TypeId() int

func (*HammerHit) Unpack

func (o *HammerHit) Unpack(u *packer.Unpacker) error

type Laser

type Laser struct {
	ItemId int

	X         int
	Y         int
	FromX     int
	FromY     int
	StartTick int
}

func (*Laser) Id

func (o *Laser) Id() int

func (*Laser) Pack

func (o *Laser) Pack() []byte

func (*Laser) Size

func (o *Laser) Size() int

func (*Laser) TypeId

func (o *Laser) TypeId() int

func (*Laser) Unpack

func (o *Laser) Unpack(u *packer.Unpacker) error

type Pickup

type Pickup struct {
	ItemId int

	X    int
	Y    int
	Type network7.Pickup
}

func (*Pickup) Id

func (o *Pickup) Id() int

func (*Pickup) Pack

func (o *Pickup) Pack() []byte

func (*Pickup) Size

func (o *Pickup) Size() int

func (*Pickup) TypeId

func (o *Pickup) TypeId() int

func (*Pickup) Unpack

func (o *Pickup) Unpack(u *packer.Unpacker) error

type PlayerInfo

type PlayerInfo struct {
	ItemId int

	// TODO: parse flags
	PlayerFlags int
	Score       int
	Latency     int
}

func (*PlayerInfo) Id

func (o *PlayerInfo) Id() int

func (*PlayerInfo) Pack

func (o *PlayerInfo) Pack() []byte

func (*PlayerInfo) Size

func (o *PlayerInfo) Size() int

func (*PlayerInfo) TypeId

func (o *PlayerInfo) TypeId() int

func (*PlayerInfo) Unpack

func (o *PlayerInfo) Unpack(u *packer.Unpacker) error

type PlayerInfoRace

type PlayerInfoRace struct {
	ItemId int

	RaceStartTick int
}

this is a new snap item that was added after the 0.7 release so for backwards compability it includes a size field and older clients ignore it

this message is not used by official servers and is part of an effort to support community made race modifications

func (*PlayerInfoRace) Id

func (o *PlayerInfoRace) Id() int

func (*PlayerInfoRace) Pack

func (o *PlayerInfoRace) Pack() []byte

func (*PlayerInfoRace) Size

func (o *PlayerInfoRace) Size() int

func (*PlayerInfoRace) TypeId

func (o *PlayerInfoRace) TypeId() int

func (*PlayerInfoRace) Unpack

func (o *PlayerInfoRace) Unpack(u *packer.Unpacker) error

type PlayerInput

type PlayerInput struct {
	ItemId int

	Direction    int
	TargetX      int
	TargetY      int
	Jump         int
	Fire         int
	Hook         int
	PlayerFlags  int
	WantedWeapon int
	NextWeapon   int
	PrevWeapon   int
}

this object is never included in the snap the same order of ints is sent in the system message input

but technically this item is unused

func (*PlayerInput) Id

func (o *PlayerInput) Id() int

func (*PlayerInput) Pack

func (o *PlayerInput) Pack() []byte

func (*PlayerInput) Size

func (o *PlayerInput) Size() int

func (*PlayerInput) TypeId

func (o *PlayerInput) TypeId() int

func (*PlayerInput) Unpack

func (o *PlayerInput) Unpack(u *packer.Unpacker) error

type Projectile

type Projectile struct {
	ItemId int

	X         int
	Y         int
	VelX      int
	VelY      int
	Type      int
	StartTick int
}

func (*Projectile) Id

func (o *Projectile) Id() int

func (*Projectile) Pack

func (o *Projectile) Pack() []byte

func (*Projectile) Size

func (o *Projectile) Size() int

func (*Projectile) TypeId

func (o *Projectile) TypeId() int

func (*Projectile) Unpack

func (o *Projectile) Unpack(u *packer.Unpacker) error

type SnapObject

type SnapObject interface {
	// id separating this snap item from other items with same type
	// the ids are unique per type
	// for players it matches their ClientId
	Id() int

	// type of the snap item
	TypeId() int

	// number of packed integers
	// not the number of bytes
	//
	// only counting the payload
	// not the type id or item id
	// and also not the optional size field (game data race, player info race)
	Size() int

	Pack() []byte
	Unpack(u *packer.Unpacker) error
}

func NewObject

func NewObject(typeId int, itemId int, u *packer.Unpacker) SnapObject

Comes without payload you have to call item.Unpack(u) manually after getting it

it might consume one integer for the size field of the given unpacker if it is an item with size field

type SoundWorld

type SoundWorld struct {
	ItemId int

	X       int
	Y       int
	SoundId int
}

func (*SoundWorld) Id

func (o *SoundWorld) Id() int

func (*SoundWorld) Pack

func (o *SoundWorld) Pack() []byte

func (*SoundWorld) Size

func (o *SoundWorld) Size() int

func (*SoundWorld) TypeId

func (o *SoundWorld) TypeId() int

func (*SoundWorld) Unpack

func (o *SoundWorld) Unpack(u *packer.Unpacker) error

type Spawn

type Spawn struct {
	ItemId int

	X int
	Y int
}

func (*Spawn) Id

func (o *Spawn) Id() int

func (*Spawn) Pack

func (o *Spawn) Pack() []byte

func (*Spawn) Size

func (o *Spawn) Size() int

func (*Spawn) TypeId

func (o *Spawn) TypeId() int

func (*Spawn) Unpack

func (o *Spawn) Unpack(u *packer.Unpacker) error

type SpectatorInfo

type SpectatorInfo struct {
	ItemId int

	SpecMode    network7.Spec
	SpectatorID int
	X           int
	Y           int
}

func (*SpectatorInfo) Id

func (o *SpectatorInfo) Id() int

func (*SpectatorInfo) Pack

func (o *SpectatorInfo) Pack() []byte

func (*SpectatorInfo) Size

func (o *SpectatorInfo) Size() int

func (*SpectatorInfo) TypeId

func (o *SpectatorInfo) TypeId() int

func (*SpectatorInfo) Unpack

func (o *SpectatorInfo) Unpack(u *packer.Unpacker) error

type Unknown

type Unknown struct {
	ItemId   int
	ItemType int
	ItemSize int

	Fields []int
}

used for protocol forward compability an imaginary protocol version 0.7.6 could add a new snap item it would have an unknown type id followed by a size field we just consume size amount of integers and store it in this unknown struct then we move onto the next item

func (*Unknown) Id

func (o *Unknown) Id() int

func (*Unknown) Pack

func (o *Unknown) Pack() []byte

func (*Unknown) Size

func (o *Unknown) Size() int

func (*Unknown) TypeId

func (o *Unknown) TypeId() int

func (*Unknown) Unpack

func (o *Unknown) Unpack(u *packer.Unpacker) error

Jump to

Keyboard shortcuts

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