structs

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSMap

type CSMap struct {
	RoundWins             map[string]string `json:"round_wins"`
	Mode                  string            `json:"mode"`
	Name                  string            `json:"name"`
	Phase                 string            `json:"phase"`
	Round                 int               `json:"Round"`
	TeamCt                *Team             `json:"team_ct"`
	TeamT                 *Team             `json:"team_t"`
	NumMatchesToWinSeries int               `json:"num_matches_to_win_series"`
}

func (*CSMap) String

func (csmap *CSMap) String() string

type GSIEvent

type GSIEvent struct {
	CSMap    *CSMap         `json:"map"`
	Player   *Player        `json:"Player"`
	Provider *Provider      `json:"Provider"`
	Round    *Round         `json:"Round"`
	Previous *GSIEvent      `json:"Previously"`
	Added    *GSIEventAdded `json:"Added"`

	OriginalData string `json:"-"`
}

func NewGSIEvent

func NewGSIEvent(requestBody string) (*GSIEvent, error)

func (*GSIEvent) GetOriginalRequestFlat

func (gsiEvent *GSIEvent) GetOriginalRequestFlat() string

func (*GSIEvent) String

func (gsiEvent *GSIEvent) String() string

type GSIEventAdded

type GSIEventAdded struct {
	Player *struct {
		Weapons map[string]bool `json:"weapons"`
	} `json:"player"`
	Round *struct {
		Bomb    bool `json:"bomb"`
		WinTeam bool `json:"win_team"`
	}
}

type Player

type Player struct {
	Steamid      string         `json:"steamid"`
	Name         string         `json:"name"`
	ObserverSlot int            `json:"observer_slot"`
	Team         string         `json:"Team"`
	Activity     PlayerActivity `json:"activity"`
	MatchStats   struct {
		Kills   int `json:"kills"`
		Assists int `json:"assists"`
		Deaths  int `json:"deaths"`
		Mvps    int `json:"mvps"`
		Score   int `json:"score"`
	} `json:"match_stats"`

	State struct {
		Health      *int `json:"health"`
		Armor       *int `json:"armor"`
		Helmet      bool `json:"helmet"`
		Flashed     int  `json:"flashed"`
		Smoked      int  `json:"smoked"`
		Burning     int  `json:"burning"`
		Money       int  `json:"money"`
		RoundKills  int  `json:"round_kills"`
		RoundKillHS int  `json:"round_killhs"`
		EquipValue  int  `json:"equip_value"`
	} `json:"state"`
	Weapons WeaponCollection `json:"Weapons"`
}

func (*Player) String

func (player *Player) String() string

type PlayerActivity

type PlayerActivity string
const (
	PlayerActivityPaused      PlayerActivity = "menu"
	PlayerActivityPlaying     PlayerActivity = "playing"
	PlayerActivityInTextInput PlayerActivity = "textinput"
)

type Provider

type Provider struct {
	Name      string `json:"name"`
	Appid     int    `json:"appid"`
	Version   int    `json:"version"`
	SteamID   string `json:"steamid"`
	Timestamp int    `json:"timestamp"`
}

func (*Provider) String

func (provider *Provider) String() string

type Round

type Round struct {
	Phase   string `json:"phase"`
	WinTeam string `json:"win_team"`
	Bomb    string `json:"bomb"`
}

func (*Round) String

func (round *Round) String() string

type Team

type Team struct {
	Score                  int `json:"score"`
	ConsecutiveRoundLosses int `json:"consecutive_round_losses"`
	TimeoutsRemaining      int `json:"timeouts_remaining"`
	MatchesWonThisSeries   int `json:"matches_won_this_series"`
}

func (*Team) String

func (team *Team) String() string

type Weapon

type Weapon struct {
	Name        string      `json:"name"`
	Paintkit    string      `json:"paintkit"`
	Type        WeaponType  `json:"type"`
	AmmoClip    *int        `json:"ammo_clip"`
	AmmoClipMax *int        `json:"ammo_clip_max"`
	AmmoReserve *int        `json:"ammo_reserve"`
	State       WeaponState `json:"state"`
}

func (*Weapon) String

func (weapon *Weapon) String() string

type WeaponCollection

type WeaponCollection map[string]*Weapon

func (*WeaponCollection) String

func (wCollection *WeaponCollection) String() string

type WeaponState

type WeaponState string
const (
	WeaponStateHolstered WeaponState = "holstered"
	WeaponStateActive    WeaponState = "active"
	WeaponStateReloading WeaponState = "reloading"
)

type WeaponType

type WeaponType string
const (
	WeaponTypePistol  WeaponType = "Pistol"
	WeaponTypeGrenade WeaponType = "Grenade"
)

Jump to

Keyboard shortcuts

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