client

package
v0.0.0-...-0021660 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDataFromUrl

func GetDataFromUrl(url string) ([]byte, error)

func MapIdentity

func MapIdentity(host string) (uint32, error)

Types

type Damage

type Damage struct {
	ID     int    `json:"id"`
	Msg    string `json:"msg"`
	Sender string `json:"sender"`
	Enemy  bool   `json:"enemy"`
	Mode   string `json:"mode"`
	Time   int    `json:"time"`
}

type Entity

type Entity struct {
	Type     string  `json:"type"`
	Color    string  `json:"color"`
	ColorRGB []int   `json:"color[]"`
	Blink    int     `json:"blink"`
	Icon     string  `json:"icon"`
	IconBG   string  `json:"icon_bg"`
	X        float64 `json:"x"`
	Y        float64 `json:"y"`
	Dx       float64 `json:"dx"`
	Dy       float64 `json:"dy"`
	Sx       float64 `json:"sx"`
	Sy       float64 `json:"sy"`
	Ex       float64 `json:"ex"`
	Ey       float64 `json:"ey"`
}

type Event

type Event struct{}

type HudMsg

type HudMsg struct {
	Events []Event  `json:"events"`
	Damage []Damage `json:"damage"`
}

func (*HudMsg) Each

func (h *HudMsg) Each(callback func(dmg Damage, index int) bool)

func (*HudMsg) GetLastDmg

func (h *HudMsg) GetLastDmg() *Damage

func (*HudMsg) Load

func (h *HudMsg) Load(host string, lastEvt uint64, lastDmg uint64) error

func (*HudMsg) MatchMessages

func (h *HudMsg) MatchMessages(pattern *regexp.Regexp) []Damage

func (*HudMsg) Unmarshal

func (h *HudMsg) Unmarshal(jsonBytes []byte) error

type Indicators

type Indicators struct {
	Valid            bool    `json:"valid"`
	Army             string  `json:"army"`
	Type             string  `json:"type"`
	Speed            float64 `json:"speed"`
	Pedals1          float64 `json:"pedals1"`
	Pedals2          float64 `json:"pedals2"`
	Pedals3          float64 `json:"pedals3"`
	Pedals4          float64 `json:"pedals4"`
	StickElevator    float64 `json:"stick_elevator"`
	StickAilerons    float64 `json:"stick_ailerons"`
	Vario            float64 `json:"vario"`
	AltitudeHour     float64 `json:"altitude_hour"`
	AltitudeMin      float64 `json:"altitude_min"`
	Altitude10K      float64 `json:"altitude_10k"`
	Altitude1Hour    float64 `json:"altitude1_hour"`
	Altitude1Min     float64 `json:"altitude1_min"`
	Altitude1100     float64 `json:"altitude1_10k"`
	AviahorizonRoll  float64 `json:"aviahorizon_roll"`
	AviahorizonPitch float64 `json:"aviahorizon_pitch"`
	Bank             float64 `json:"bank"`
	Bank2            float64 `json:"bank2"`
	Turn             float64 `json:"turn"`
	Compass1         float64 `json:"compass1"`
	Compass2         float64 `json:"compass2"`
	ClockHour        float64 `json:"clock_hour"`
	ClockMin         float64 `json:"clock_min"`
	ClockSec         float64 `json:"clock_sec"`
	ManifoldPressure float64 `json:"manifold_pressure"`
	RpmMin           float64 `json:"rpm_min"`
	RpmHour          float64 `json:"rpm_hour"`
	OilPressure      float64 `json:"oil_pressure"`
	OilPressure1     float64 `json:"oil_pressure1"`
	OilTemperature   float64 `json:"oil_temperature"`
	HeadTemperature  float64 `json:"head_temperature"`
	Mixture          float64 `json:"mixture"`
	CarbTemperature  float64 `json:"carb_temperature"`
	Fuel1            float64 `json:"fuel1"`
	FuelPressure     float64 `json:"fuel_pressure"`
	Gears            float64 `json:"gears"`
	Gears1           float64 `json:"gears1"`
	Flaps            float64 `json:"flaps"`
	Throttle         float64 `json:"throttle"`
	Weapon2          float64 `json:"weapon2"`
	Weapon3          float64 `json:"weapon3"`
	Weapon4          float64 `json:"weapon4"`
	PropPitch        float64 `json:"prop_pitch"`
	Supercharger     float64 `json:"supercharger"`
	FlapsIndicator   float64 `json:"flaps_indicator"`
	GearLIndicator   float64 `json:"gear_l_indicator"`
	GearRIndicator   float64 `json:"gear_r_indicator"`
	GearCIndicator   float64 `json:"gear_c_indicator"`
	GMeter           float64 `json:"g_meter"`
	GMeterMin        float64 `json:"g_meter_min"`
	GMeterMax        float64 `json:"g_meter_max"`
	Blister1         float64 `json:"blister1"`
	Blister2         float64 `json:"blister2"`
}

func (*Indicators) IsValid

func (indicators *Indicators) IsValid() bool

func (*Indicators) Load

func (s *Indicators) Load(host string) error

func (*Indicators) Unmarshal

func (indicators *Indicators) Unmarshal(jsonBytes []byte) error

type MapInfo

type MapInfo struct {
	Valid         bool      `json:"valid"`
	GridSize      []float64 `json:"grid_size"`
	GridSteps     []float64 `json:"grid_steps"`
	GridZero      []float64 `json:"grid_zero"`
	HudType       int       `json:"hud_type"`
	MapGeneration int       `json:"map_generation"`
	MapMax        []float64 `json:"map_max"`
	MapMin        []float64 `json:"map_min"`
}

func (*MapInfo) GetDistance

func (m *MapInfo) GetDistance(x1, y1, x2, y2 float64) float64

func (*MapInfo) GetSpeed

func (m *MapInfo) GetSpeed(x1, y1, x2, y2 float64, duration time.Duration) float64

func (*MapInfo) GetSpeedKmh

func (m *MapInfo) GetSpeedKmh(x1, y1, x2, y2 float64, duration time.Duration) float64

func (*MapInfo) IsValid

func (m *MapInfo) IsValid() bool

func (*MapInfo) Load

func (m *MapInfo) Load(host string) error

func (*MapInfo) Unmarshal

func (m *MapInfo) Unmarshal(jsonBytes []byte) error

type MapObj

type MapObj []Entity

func (*MapObj) GetAircrafts

func (mapObj *MapObj) GetAircrafts() *[]Entity

func (*MapObj) GetAircraftsByColors

func (mapObj *MapObj) GetAircraftsByColors(colors *[]string) *[]Entity

func (*MapObj) GetAirfields

func (mapObj *MapObj) GetAirfields() *[]Entity

func (*MapObj) GetCaptureZones

func (mapObj *MapObj) GetCaptureZones() *[]Entity

func (*MapObj) GetDistance

func (mapObj *MapObj) GetDistance(ent1 *Entity, ent2 *Entity, mapInfo *MapInfo) float64

func (*MapObj) GetFighterRespawnBases

func (mapObj *MapObj) GetFighterRespawnBases() *[]Entity

func (*MapObj) GetGroundUnitsByColors

func (mapObj *MapObj) GetGroundUnitsByColors(colors *[]string) *[]Entity

func (*MapObj) GetHeading

func (mapObj *MapObj) GetHeading(ent1 *Entity, ent2 *Entity) float64

func (*MapObj) GetPlayerEntity

func (mapObj *MapObj) GetPlayerEntity() *Entity

func (*MapObj) GetTankRespawnBases

func (mapObj *MapObj) GetTankRespawnBases() *[]Entity

func (*MapObj) GetTanks

func (mapObj *MapObj) GetTanks() *[]Entity

func (*MapObj) Load

func (mapObj *MapObj) Load(host string) error

func (*MapObj) Unmarshal

func (mapObj *MapObj) Unmarshal(jsonBytes []byte) error

type State

type State map[string]any

func (*State) IsValid

func (state *State) IsValid() bool

func (*State) Load

func (state *State) Load(host string) error

func (*State) Unmarshal

func (state *State) Unmarshal(jsonBytes []byte) error

Jump to

Keyboard shortcuts

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