api

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

CSV export dedicated to the application CS Demo Manager.

It's similar to the classic CSV export - the main difference is that there are no headers and some columns differ. CS:DM doesn't use the traditional CSV export because column order is crucial as it inserts demos into a database from CSV files. If CS:DM was using the classic CSV export, any changes to the traditional CSV export would break the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzeAndExportDemo

func AnalyzeAndExportDemo(demoPath string, outputPath string, options AnalyzeAndExportDemoOptions) error

func FormatValidDemoSources

func FormatValidDemoSources() string

func FormatValidExportFormats

func FormatValidExportFormats() string

func ValidateDemoSource

func ValidateDemoSource(source constants.DemoSource) error

func ValidateExportFormat

func ValidateExportFormat(format constants.ExportFormat) error

Types

type AnalyzeAndExportDemoOptions

type AnalyzeAndExportDemoOptions struct {
	IncludePositions bool
	Source           constants.DemoSource
	Format           constants.ExportFormat
	MinifyJSON       bool
}

type AnalyzeDemoOptions

type AnalyzeDemoOptions struct {
	IncludePositions bool
	Source           constants.DemoSource
}

type Analyzer

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

type BombDefuseStart

type BombDefuseStart struct {
	Frame                  int     `json:"frame"`
	Tick                   int     `json:"tick"`
	RoundNumber            int     `json:"roundNumber"`
	PlanterSteamID64       uint64  `json:"defuserSteamId"`
	PlanterName            string  `json:"defuserName"`
	IsPlayerControllingBot bool    `json:"isPlayerControllingBot"`
	X                      float64 `json:"x"`
	Y                      float64 `json:"y"`
	Z                      float64 `json:"z"`
}

type BombDefused

type BombDefused struct {
	Frame                      int     `json:"frame"`
	Tick                       int     `json:"tick"`
	RoundNumber                int     `json:"roundNumber"`
	Site                       string  `json:"site"`
	DefuserSteamID64           uint64  `json:"defuserSteamId"`
	DefuserName                string  `json:"defuserName"`
	IsPlayerControllingBot     bool    `json:"isPlayerControllingBot"`
	X                          float64 `json:"x"`
	Y                          float64 `json:"y"`
	Z                          float64 `json:"z"`
	CounterTerroristAliveCount int     `json:"counterTerroristAliveCount"`
	TerroristAliveCount        int     `json:"terroristAliveCount"`
}

type BombExploded

type BombExploded struct {
	Frame                  int     `json:"frame"`
	Tick                   int     `json:"tick"`
	RoundNumber            int     `json:"roundNumber"`
	Site                   string  `json:"site"`
	PlanterSteamID64       uint64  `json:"defuserSteamId"`
	PlanterName            string  `json:"defuserName"`
	IsPlayerControllingBot bool    `json:"isPlayerControllingBot"`
	X                      float64 `json:"x"`
	Y                      float64 `json:"y"`
	Z                      float64 `json:"z"`
}

type BombPlantStart

type BombPlantStart struct {
	Frame                  int     `json:"frame"`
	Tick                   int     `json:"tick"`
	RoundNumber            int     `json:"roundNumber"`
	Site                   string  `json:"site"`
	PlanterSteamID64       uint64  `json:"defuserSteamId"`
	PlanterName            string  `json:"defuserName"`
	IsPlayerControllingBot bool    `json:"isPlayerControllingBot"`
	X                      float64 `json:"x"`
	Y                      float64 `json:"y"`
	Z                      float64 `json:"z"`
}

type BombPlanted

type BombPlanted struct {
	Frame                  int     `json:"frame"`
	Tick                   int     `json:"tick"`
	RoundNumber            int     `json:"roundNumber"`
	Site                   string  `json:"site"`
	PlanterSteamID64       uint64  `json:"planterSteamId"`
	PlanterName            string  `json:"planterName"`
	IsPlayerControllingBot bool    `json:"isPlayerControllingBot"`
	X                      float64 `json:"x"`
	Y                      float64 `json:"y"`
	Z                      float64 `json:"z"`
}

type ChatMessage

type ChatMessage struct {
	Frame           int         `json:"frame"`
	Tick            int         `json:"tick"`
	RoundNumber     int         `json:"roundNumber"`
	Message         string      `json:"message"`
	SenderSteamID64 uint64      `json:"senderSteamId"`
	SenderName      string      `json:"senderName"`
	SenderSide      common.Team `json:"senderSide"`
	IsSenderAlive   bool        `json:"isSenderAlive"`
}

type ChickenDeath

type ChickenDeath struct {
	Frame         int                  `json:"frame"`
	Tick          int                  `json:"tick"`
	RoundNumber   int                  `json:"roundNumber"`
	KillerSteamID uint64               `json:"killerSteamId"`
	WeaponName    constants.WeaponName `json:"weaponName"`
}

type ChickenPosition

type ChickenPosition struct {
	Frame       int     `json:"frame"`
	Tick        int     `json:"tick"`
	RoundNumber int     `json:"roundNumber"`
	X           float64 `json:"x"`
	Y           float64 `json:"y"`
	Z           float64 `json:"z"`
}

type Clutch

type Clutch struct {
	Frame             int         `json:"frame"`
	Tick              int         `json:"tick"`
	RoundNumber       int         `json:"roundNumber"`
	OpponentCount     int         `json:"opponentCount"`
	Side              common.Team `json:"side"`
	HasWon            bool        `json:"hasWon"`
	ClutcherSteamID64 uint64      `json:"clutcherSteamId"`
	ClutcherName      string      `json:"clutcherName"`
	ClutcherSurvived  bool        `json:"clutcherSurvived"`
	ClutcherKillCount int         `json:"clutcherKillCount"`
}

type Damage

type Damage struct {
	Frame                    int                  `json:"frame"`
	Tick                     int                  `json:"tick"`
	RoundNumber              int                  `json:"roundNumber"`
	HealthDamage             int                  `json:"healthDamage"`
	ArmorDamage              int                  `json:"armorDamage"`
	AttackerSteamID64        uint64               `json:"attackerSteamId"`
	AttackerSide             common.Team          `json:"attackerSide"`
	AttackerTeamName         string               `json:"attackerTeamName"`
	IsAttackerControllingBot bool                 `json:"isAttackerControllingBot"`
	VictimHealth             int                  `json:"victimHealth"`
	VictimNewHealth          int                  `json:"victimNewHealth"`
	VictimArmor              int                  `json:"victimArmor"`
	VictimNewArmor           int                  `json:"victimNewArmor"`
	VictimSteamID64          uint64               `json:"victimSteamId"`
	VictimSide               common.Team          `json:"victimSide"`
	VictimTeamName           string               `json:"victimTeamName"`
	IsVictimControllingBot   bool                 `json:"isVictimControllingBot"`
	HitGroup                 events.HitGroup      `json:"hitgroup"`
	WeaponName               constants.WeaponName `json:"weaponName"`
	WeaponType               constants.WeaponType `json:"weaponType"`
	WeaponUniqueID           string               `json:"weaponUniqueId"`
}

func (*Damage) IsGrenadeWeapon

func (damage *Damage) IsGrenadeWeapon() bool

type DecoyStart

type DecoyStart struct {
	Frame            int         `json:"frame"`
	Tick             int         `json:"tick"`
	RoundNumber      int         `json:"roundNumber"`
	GrenadeID        string      `json:"grenadeId"`
	ProjectileID     int64       `json:"projectileId"`
	X                float64     `json:"x"`
	Y                float64     `json:"y"`
	Z                float64     `json:"z"`
	ThrowerSteamID64 uint64      `json:"throwerSteamId"`
	ThrowerName      string      `json:"throwerName"`
	ThrowerSide      common.Team `json:"throwerSide"`
	ThrowerTeamName  string      `json:"throwerTeamName"`
	ThrowerVelocityX float64     `json:"throwerVelocityX"`
	ThrowerVelocityY float64     `json:"throwerVelocityY"`
	ThrowerVelocityZ float64     `json:"throwerVelocityZ"`
	ThrowerPitch     float32     `json:"throwerPitch"`
	ThrowerYaw       float32     `json:"throwerYaw"`
}

type FlashbangExplode

type FlashbangExplode struct {
	Frame            int         `json:"frame"`
	Tick             int         `json:"tick"`
	RoundNumber      int         `json:"roundNumber"`
	GrenadeID        string      `json:"grenadeId"`
	ProjectileID     int64       `json:"projectileId"`
	X                float64     `json:"x"`
	Y                float64     `json:"y"`
	Z                float64     `json:"z"`
	ThrowerSteamID64 uint64      `json:"throwerSteamId"`
	ThrowerName      string      `json:"throwerName"`
	ThrowerSide      common.Team `json:"throwerSide"`
	ThrowerTeamName  string      `json:"throwerTeamName"`
	ThrowerVelocityX float64     `json:"throwerVelocityX"`
	ThrowerVelocityY float64     `json:"throwerVelocityY"`
	ThrowerVelocityZ float64     `json:"throwerVelocityZ"`
	ThrowerPitch     float32     `json:"throwerPitch"`
	ThrowerYaw       float32     `json:"throwerYaw"`
}

type GrenadeBounce

type GrenadeBounce struct {
	Frame            int                  `json:"frame"`
	Tick             int                  `json:"tick"`
	RoundNumber      int                  `json:"roundNumber"`
	GrenadeID        string               `json:"grenadeId"`
	ProjectileID     int64                `json:"projectileId"`
	GrenadeName      constants.WeaponName `json:"grenadeName"`
	X                float64              `json:"x"`
	Y                float64              `json:"y"`
	Z                float64              `json:"z"`
	ThrowerSteamID64 uint64               `json:"throwerSteamId"`
	ThrowerName      string               `json:"throwerName"`
	ThrowerSide      common.Team          `json:"throwerSide"`
	ThrowerTeamName  string               `json:"throwerTeamName"`
	ThrowerVelocityX float64              `json:"throwerVelocityX"`
	ThrowerVelocityY float64              `json:"throwerVelocityY"`
	ThrowerVelocityZ float64              `json:"throwerVelocityZ"`
	ThrowerPitch     float32              `json:"throwerPitch"`
	ThrowerYaw       float32              `json:"throwerYaw"`
}

type GrenadePosition

type GrenadePosition struct {
	Frame            int                  `json:"frame"`
	Tick             int                  `json:"tick"`
	RoundNumber      int                  `json:"roundNumber"`
	GrenadeID        string               `json:"grenadeId"`
	ProjectileID     int64                `json:"projectileId"`
	X                float64              `json:"x"`
	Y                float64              `json:"y"`
	Z                float64              `json:"z"`
	ThrowerSteamID64 uint64               `json:"throwerSteamId"`
	ThrowerName      string               `json:"throwerName"`
	ThrowerSide      common.Team          `json:"throwerSide"`
	ThrowerTeamName  string               `json:"throwerTeamName"`
	ThrowerVelocityX float64              `json:"throwerVelocityX"`
	ThrowerVelocityY float64              `json:"throwerVelocityY"`
	ThrowerVelocityZ float64              `json:"throwerVelocityZ"`
	ThrowerPitch     float32              `json:"throwerPitch"`
	ThrowerYaw       float32              `json:"throwerYaw"`
	GrenadeName      constants.WeaponName `json:"grenadeName"`
}

type GrenadeProjectileDestroy

type GrenadeProjectileDestroy struct {
	Frame            int                  `json:"frame"`
	Tick             int                  `json:"tick"`
	RoundNumber      int                  `json:"roundNumber"`
	GrenadeID        string               `json:"grenadeId"`
	ProjectileID     int64                `json:"projectileId"`
	GrenadeName      constants.WeaponName `json:"grenadeName"`
	X                float64              `json:"x"`
	Y                float64              `json:"y"`
	Z                float64              `json:"z"`
	ThrowerSteamID64 uint64               `json:"throwerSteamId"`
	ThrowerName      string               `json:"throwerName"`
	ThrowerSide      common.Team          `json:"throwerSide"`
	ThrowerTeamName  string               `json:"throwerTeamName"`
	ThrowerVelocityX float64              `json:"throwerVelocityX"`
	ThrowerVelocityY float64              `json:"throwerVelocityY"`
	ThrowerVelocityZ float64              `json:"throwerVelocityZ"`
	ThrowerPitch     float32              `json:"throwerPitch"`
	ThrowerYaw       float32              `json:"throwerYaw"`
}

type HeGrenadeExplode

type HeGrenadeExplode struct {
	Frame            int         `json:"frame"`
	Tick             int         `json:"tick"`
	RoundNumber      int         `json:"roundNumber"`
	GrenadeID        string      `json:"grenadeId"`
	ProjectileID     int64       `json:"projectileId"`
	X                float64     `json:"x"`
	Y                float64     `json:"y"`
	Z                float64     `json:"z"`
	ThrowerSteamID64 uint64      `json:"throwerSteamId"`
	ThrowerName      string      `json:"throwerName"`
	ThrowerSide      common.Team `json:"throwerSide"`
	ThrowerTeamName  string      `json:"throwerTeamName"`
	ThrowerVelocityX float64     `json:"throwerVelocityX"`
	ThrowerVelocityY float64     `json:"throwerVelocityY"`
	ThrowerVelocityZ float64     `json:"throwerVelocityZ"`
	ThrowerPitch     float32     `json:"throwerPitch"`
	ThrowerYaw       float32     `json:"throwerYaw"`
}

type HostagePickUpStart

type HostagePickUpStart struct {
	Frame                  int     `json:"frame"`
	Tick                   int     `json:"tick"`
	RoundNumber            int     `json:"roundNumber"`
	PlayerSteamID64        uint64  `json:"playerSteamId"`
	IsPlayerControllingBot bool    `json:"isPlayerControllingBot"`
	HostageEntityId        int     `json:"hostageEntityId"`
	X                      float64 `json:"x"`
	Y                      float64 `json:"y"`
	Z                      float64 `json:"z"`
}

type HostagePickedUp

type HostagePickedUp struct {
	Frame                  int     `json:"frame"`
	Tick                   int     `json:"tick"`
	RoundNumber            int     `json:"roundNumber"`
	HostageEntityId        int     `json:"hostageEntityId"`
	PlayerSteamID64        uint64  `json:"playerSteamId"`
	IsPlayerControllingBot bool    `json:"isPlayerControllingBot"`
	X                      float64 `json:"x"`
	Y                      float64 `json:"y"`
	Z                      float64 `json:"z"`
}

type HostagePosition

type HostagePosition struct {
	Frame       int                 `json:"frame"`
	Tick        int                 `json:"tick"`
	RoundNumber int                 `json:"roundNumber"`
	X           float64             `json:"x"`
	Y           float64             `json:"y"`
	Z           float64             `json:"z"`
	State       common.HostageState `json:"state"`
}

type HostageRescued

type HostageRescued struct {
	Frame                  int     `json:"frame"`
	Tick                   int     `json:"tick"`
	RoundNumber            int     `json:"roundNumber"`
	PlayerSteamID64        uint64  `json:"playerSteamId"`
	IsPlayerControllingBot bool    `json:"isPlayerControllingBot"`
	HostageEntityId        int     `json:"hostageEntityId"`
	X                      float64 `json:"x"`
	Y                      float64 `json:"y"`
	Z                      float64 `json:"z"`
}

type InfernoPosition

type InfernoPosition struct {
	Frame            int        `json:"frame"`
	Tick             int        `json:"tick"`
	RoundNumber      int        `json:"roundNumber"`
	ThrowerSteamID64 uint64     `json:"throwerSteamId"`
	ThrowerName      string     `json:"throwerName"`
	UniqueID         int64      `json:"uniqueId"`
	X                float64    `json:"x"`
	Y                float64    `json:"y"`
	Z                float64    `json:"z"`
	ConvexHull2D     []r2.Point `json:"convexHull2D"`
}

type Kill

type Kill struct {
	Frame                    int                  `json:"frame"`
	Tick                     int                  `json:"tick"`
	RoundNumber              int                  `json:"roundNumber"`
	WeaponType               constants.WeaponType `json:"weaponType"`
	WeaponName               constants.WeaponName `json:"weaponName"`
	KillerName               string               `json:"killerName"`
	KillerSteamID64          uint64               `json:"killerSteamId"`
	KillerSide               common.Team          `json:"killerSide"`
	KillerTeamName           string               `json:"killerTeamName"`
	KillerX                  float64              `json:"killerX"`
	KillerY                  float64              `json:"killerY"`
	KillerZ                  float64              `json:"killerZ"`
	IsKillerAirborne         bool                 `json:"is_killer_airborne"`
	IsKillerBlinded          bool                 `json:"is_killer_blinded"`
	IsKillerControllingBot   bool                 `json:"isKillerControllingBot"`
	VictimName               string               `json:"victimName"`
	VictimSteamID64          uint64               `json:"victimSteamId"`
	VictimSide               common.Team          `json:"victimSide"`
	VictimTeamName           string               `json:"victimTeamName"`
	VictimX                  float64              `json:"victimX"`
	VictimY                  float64              `json:"victimY"`
	VictimZ                  float64              `json:"victimZ"`
	IsVictimAirborne         bool                 `json:"is_victim_airborne"`
	IsVictimBlinded          bool                 `json:"is_victim_blinded"`
	IsVictimControllingBot   bool                 `json:"isVictimControllingBot"`
	IsVictimInspectingWeapon bool                 `json:"isVictimInspectingWeapon"`
	AssisterName             string               `json:"assisterName"`
	AssisterSteamID64        uint64               `json:"assisterSteamId"`
	AssisterSide             common.Team          `json:"assisterSide"`
	AssisterTeamName         string               `json:"assisterTeamName"`
	AssisterX                float64              `json:"assisterX"`
	AssisterY                float64              `json:"assisterY"`
	AssisterZ                float64              `json:"assisterZ"`
	IsAssisterControllingBot bool                 `json:"isAssisterControllingBot"`
	IsHeadshot               bool                 `json:"isHeadshot"`
	PenetratedObjects        int                  `json:"penetratedObjects"`
	IsAssistedFlash          bool                 `json:"isAssistedFlash"`
	IsThroughSmoke           bool                 `json:"isThroughSmoke"`
	IsNoScope                bool                 `json:"isNoScope"`
	IsTradeKill              bool                 `json:"isTradeKill"`  // The attacker did a trade kill
	IsTradeDeath             bool                 `json:"isTradeDeath"` // The victim did a trade death
	Distance                 float32              `json:"distance"`
}

func (*Kill) IsSuicide

func (kill *Kill) IsSuicide() bool

func (*Kill) IsTeamKill

func (kill *Kill) IsTeamKill() bool

type Match

type Match struct {
	Checksum        string               `json:"checksum"`
	Game            constants.Game       `json:"game"`
	DemoFilePath    string               `json:"demoFilePath"`
	DemoFileName    string               `json:"demoFileName"`
	Source          constants.DemoSource `json:"source"`
	Type            constants.DemoType   `json:"type"`
	MapName         string               `json:"mapName"`
	TickCount       int                  `json:"tickCount"`
	TickRate        float64              `json:"tickrate"`
	FrameRate       float64              `json:"framerate"`
	Date            time.Time            `json:"date"`
	Duration        time.Duration        `json:"duration"`
	ServerName      string               `json:"serverName"`
	ClientName      string               `json:"clientName"`
	NetworkProtocol int                  `json:"networkProtocol"`
	BuildNumber     int                  `json:"buildNumber"` // CS2 only
	GameType        constants.GameType   `json:"gameType"`
	GameMode        constants.GameMode   `json:"gameMode"`

	IsRanked                  bool                        `json:"isRanked"`
	MaxRounds                 int                         `json:"maxRounds"` // mp_maxrounds if detected or based on final scores
	OvertimeCount             int                         `json:"overtimeCount"`
	HasVacLiveBan             bool                        `json:"hasVacLiveBan"`
	TeamA                     *Team                       `json:"teamA"` // Team A is the Team that started as CT
	TeamB                     *Team                       `json:"teamB"` // Team B is the Team that started as T
	Winner                    *Team                       `json:"winner"`
	PlayersBySteamID          map[uint64]*Player          `json:"players"`
	Kills                     []*Kill                     `json:"kills"` // Includes suicides and bomb explosions too
	Shots                     []*Shot                     `json:"shots"`
	Rounds                    []*Round                    `json:"rounds"`
	Clutches                  []*Clutch                   `json:"clutches"`
	BombsPlanted              []*BombPlanted              `json:"bombsPlanted"`
	BombsDefused              []*BombDefused              `json:"bombsDefused"`
	BombsExploded             []*BombExploded             `json:"bombsExploded"`
	BombsPlantStart           []*BombPlantStart           `json:"bombsPlantStart"`
	BombsDefuseStart          []*BombDefuseStart          `json:"bombsDefuseStart"`
	PlayersFlashed            []*PlayerFlashed            `json:"playersFlashed"`
	GrenadePositions          []*GrenadePosition          `json:"grenadePositions"`
	InfernoPositions          []*InfernoPosition          `json:"infernoPositions"`
	HostagePickUpStart        []*HostagePickUpStart       `json:"hostagePickUpStart"`
	HostagePickedUp           []*HostagePickedUp          `json:"hostagePickedUp"`
	HostageRescued            []*HostageRescued           `json:"hostageRescued"`
	HostagePositions          []*HostagePosition          `json:"hostagePositions"`
	SmokesStart               []*SmokeStart               `json:"smokesStart"`
	DecoysStart               []*DecoyStart               `json:"decoysStart"`
	HeGrenadesExplode         []*HeGrenadeExplode         `json:"heGrenadesExplode"`
	FlashbangsExplode         []*FlashbangExplode         `json:"flashbangsExplode"`
	GrenadeBounces            []*GrenadeBounce            `json:"grenadeBounces"`
	GrenadeProjectilesDestroy []*GrenadeProjectileDestroy `json:"grenadeProjectilesDestroy"`
	ChickenPositions          []*ChickenPosition          `json:"chickenPositions"`
	ChickenDeaths             []*ChickenDeath             `json:"chickenDeaths"`
	Damages                   []*Damage                   `json:"damages"`
	PlayerPositions           []*PlayerPosition           `json:"playerPositions"`
	PlayersBuy                []*PlayerBuy                `json:"playersBuy"`
	PlayerEconomies           []*PlayerEconomy            `json:"playerEconomies"`
	ChatMessages              []*ChatMessage              `json:"chatMessages"`
	// contains filtered or unexported fields
}

Match is the root struct that contains relevant data from a demo. It excludes data from warmup / halftime / after match.

func AnalyzeDemo

func AnalyzeDemo(demoPath string, options AnalyzeDemoOptions) (*Match, error)

func (Match) AssistCount

func (match Match) AssistCount() int

This returns the number of assists excluding BOT assists.

func (Match) DeathCount

func (match Match) DeathCount() int

This returns the number of player deaths in the match. Unlike KillCount, it takes into account ALL deaths whatever the reason is (weapon, suicide, bomb explosion...).

func (Match) GameModeStr

func (match Match) GameModeStr() constants.GameModeStr

func (*Match) GetPlayerEconomyAtRound

func (match *Match) GetPlayerEconomyAtRound(playerName string, steamID64 uint64, roundNumber int) *PlayerEconomy

func (Match) KillCount

func (match Match) KillCount() int

This returns the number of kills in the match. It doesn't include suicides and deaths by bomb explosion.

func (*Match) KillsByRound

func (match *Match) KillsByRound() map[int][]*Kill

func (*Match) MarshalJSON

func (match *Match) MarshalJSON() ([]byte, error)

func (Match) Players

func (match Match) Players() []*Player

func (Match) ShotCount

func (match Match) ShotCount() int

func (Match) Team

func (match Match) Team(team common.Team) *Team

This returns the team currently on the given side.

type MatchAlias

type MatchAlias Match

type MatchJSON

type MatchJSON struct {
	*MatchAlias
	GameModeStr string `json:"gameModeStr"`
}

type Player

type Player struct {
	SteamID64          uint64       `json:"steamId"`
	Name               string       `json:"name"`
	Score              int          `json:"score"`
	Team               *Team        `json:"team"`
	MvpCount           int          `json:"mvpCount"`
	RankType           int          `json:"rankType"`
	Rank               int          `json:"rank"`
	OldRank            int          `json:"oldRank"`
	WinCount           int          `json:"winCount"`
	CrosshairShareCode string       `json:"crosshairShareCode"`
	Color              common.Color `json:"color"`
	InspectWeaponCount int          `json:"inspectWeaponCount"`
	// contains filtered or unexported fields
}

func (*Player) ArmorDamage

func (player *Player) ArmorDamage() int

func (*Player) AssistCount

func (player *Player) AssistCount() int

func (*Player) AverageAssistPerRound

func (player *Player) AverageAssistPerRound() float32

func (*Player) AverageDamagePerRound

func (player *Player) AverageDamagePerRound() float32

func (*Player) AverageDeathPerRound

func (player *Player) AverageDeathPerRound() float32

func (*Player) AverageKillPerRound

func (player *Player) AverageKillPerRound() float32

func (*Player) BombDefusedCount

func (player *Player) BombDefusedCount() int

func (*Player) BombPlantedCount

func (player *Player) BombPlantedCount() int

func (*Player) Clutches

func (player *Player) Clutches() []*Clutch

func (*Player) DeathCount

func (player *Player) DeathCount() int

func (*Player) Deaths

func (player *Player) Deaths() []*Kill

func (*Player) FirstDeathCount

func (player *Player) FirstDeathCount() int

func (*Player) FirstKillCount

func (player *Player) FirstKillCount() int

func (*Player) FirstTradeDeathCount

func (player *Player) FirstTradeDeathCount() int

func (*Player) FirstTradeKillCount

func (player *Player) FirstTradeKillCount() int

func (*Player) FiveKillCount

func (player *Player) FiveKillCount() int

func (*Player) FourKillCount

func (player *Player) FourKillCount() int

func (*Player) HeadshotCount

func (player *Player) HeadshotCount() int

func (*Player) HeadshotPercent

func (player *Player) HeadshotPercent() int

func (*Player) HealthDamage

func (player *Player) HealthDamage() int

func (*Player) HltvRating

func (player *Player) HltvRating() float32

This returns the player's HLTV rating 1.0. Formula: https://web.archive.org/web/20170427062206/http://www.hltv.org/?pageid=242&eventid=0

func (*Player) HltvRating2

func (player *Player) HltvRating2() float32

This returns the player's HLTV rating 2.0. https://flashed.gg/posts/reverse-engineering-hltv-rating/ 0.0073*KAST + 0.3591*KPR + -0.5329*DPR + 0.2372*Impact + 0.0032*ADR + 0.1587 ≈ Rating 2.0

func (*Player) HostageRescuedCount

func (player *Player) HostageRescuedCount() int

func (*Player) KAST

func (player *Player) KAST() float32

This returns the percentage of rounds in which the player either had a kill, assist, survived or was traded.

func (*Player) KillCount

func (player *Player) KillCount() int

func (*Player) KillDeathRatio

func (player *Player) KillDeathRatio() float32

func (*Player) MarshalJSON

func (player *Player) MarshalJSON() ([]byte, error)

func (*Player) OneKillCount

func (player *Player) OneKillCount() int

func (*Player) OneVsFiveCount

func (player *Player) OneVsFiveCount() int

func (*Player) OneVsFiveLostCount

func (player *Player) OneVsFiveLostCount() int

func (*Player) OneVsFiveWonCount

func (player *Player) OneVsFiveWonCount() int

func (*Player) OneVsFourCount

func (player *Player) OneVsFourCount() int

func (*Player) OneVsFourLostCount

func (player *Player) OneVsFourLostCount() int

func (*Player) OneVsFourWonCount

func (player *Player) OneVsFourWonCount() int

func (*Player) OneVsOneCount

func (player *Player) OneVsOneCount() int

func (*Player) OneVsOneLostCount

func (player *Player) OneVsOneLostCount() int

func (*Player) OneVsOneWonCount

func (player *Player) OneVsOneWonCount() int

func (*Player) OneVsThreeCount

func (player *Player) OneVsThreeCount() int

func (*Player) OneVsThreeLostCount

func (player *Player) OneVsThreeLostCount() int

func (*Player) OneVsThreeWonCount

func (player *Player) OneVsThreeWonCount() int

func (*Player) OneVsTwoCount

func (player *Player) OneVsTwoCount() int

func (*Player) OneVsTwoLostCount

func (player *Player) OneVsTwoLostCount() int

func (*Player) OneVsTwoWonCount

func (player *Player) OneVsTwoWonCount() int

func (*Player) String

func (player *Player) String() string

func (*Player) TeamName

func (player *Player) TeamName() string

func (*Player) ThreeKillCount

func (player *Player) ThreeKillCount() int

func (*Player) TradeDeathCount

func (player *Player) TradeDeathCount() int

func (*Player) TradeKillCount

func (player *Player) TradeKillCount() int

func (*Player) TwoKillCount

func (player *Player) TwoKillCount() int

func (*Player) UtilityDamage

func (player *Player) UtilityDamage() int

func (*Player) UtilityDamagePerRound

func (player *Player) UtilityDamagePerRound() float32

type PlayerAlias

type PlayerAlias Player

type PlayerBuy

type PlayerBuy struct {
	Frame           int                  `json:"frame"`
	Tick            int                  `json:"tick"`
	RoundNumber     int                  `json:"roundNumber"`
	PlayerSteamID64 uint64               `json:"playerSteamId"`
	PlayerSide      common.Team          `json:"playerSide"`
	PlayerName      string               `json:"playerName"`
	WeaponName      constants.WeaponName `json:"weaponName"`
	WeaponType      constants.WeaponType `json:"weaponType"`
	WeaponUniqueID  string               `json:"weaponUniqueId"`
	HasRefunded     bool                 `json:"hasRefunded"`
}

type PlayerEconomy

type PlayerEconomy struct {
	RoundNumber    int                   `json:"roundNumber"`
	Name           string                `json:"name"`
	SteamID64      uint64                `json:"steamId"`
	StartMoney     int                   `json:"startMoney"`
	MoneySpent     int                   `json:"moneySpent"`
	EquipmentValue int                   `json:"equipmentValue"`
	Type           constants.EconomyType `json:"type"`
	PlayerSide     common.Team           `json:"playerSide"`
}

type PlayerFlashed

type PlayerFlashed struct {
	Frame                   int         `json:"frame"`
	Tick                    int         `json:"tick"`
	RoundNumber             int         `json:"roundNumber"`
	Duration                float32     `json:"duration"`
	FlashedSteamID64        uint64      `json:"flashedSteamId"`
	FlashedName             string      `json:"flashedName"`
	FlashedSide             common.Team `json:"flashedSide"`
	IsFlashedControllingBot bool        `json:"isFlashedControllingBot"`
	FlasherSteamID64        uint64      `json:"flasherSteamId"`
	FlasherName             string      `json:"flasherName"`
	FlasherSide             common.Team `json:"flasherSide"`
	IsFlasherControllingBot bool        `json:"isFlasherControllingBot"`
}

type PlayerJSON

type PlayerJSON struct {
	*PlayerAlias
	KillCount             int     `json:"killCount"`
	DeathCount            int     `json:"deathCount"`
	AssistCount           int     `json:"assistCount"`
	KillDeathRatio        float32 `json:"killDeathRatio"`
	KAST                  float32 `json:"kast"`
	BombDefusedCount      int     `json:"bombDefusedCount"`
	BombPlantedCount      int     `json:"bombPlantedCount"`
	HealthDamage          int     `json:"healthDamage"`
	ArmorDamage           int     `json:"armorDamage"`
	UtilityDamage         int     `json:"utilityDamage"`
	HeadshotCount         int     `json:"headshotCount"`
	HeadshotPercent       int     `json:"headshotPercent"`
	OneVsOneCount         int     `json:"oneVsOneCount"`
	OneVsOneWonCount      int     `json:"oneVsOneWonCount"`
	OneVsOneLostCount     int     `json:"oneVsOneLostCount"`
	OneVsTwoCount         int     `json:"oneVsTwoCount"`
	OneVsTwoWonCount      int     `json:"oneVsTwoWonCount"`
	OneVsTwoLostCount     int     `json:"oneVsTwoLostCount"`
	OneVsThreeCount       int     `json:"oneVsThreeCount"`
	OneVsThreeWonCount    int     `json:"oneVsThreeWonCount"`
	OneVsThreeLostCount   int     `json:"oneVsThreeLostCount"`
	OneVsFourCount        int     `json:"oneVsFourCount"`
	OneVsFourWonCount     int     `json:"oneVsFourWonCount"`
	OneVsFourLostCount    int     `json:"oneVsFourLostCount"`
	OneVsFiveCount        int     `json:"oneVsFiveCount"`
	OneVsFiveWonCount     int     `json:"oneVsFiveWonCount"`
	OneVsFiveLostCount    int     `json:"oneVsFiveLostCount"`
	HostageRescuedCount   int     `json:"hostageRescuedCount"`
	AverageKillPerRound   float32 `json:"averageKillPerRound"`
	AverageDeathPerRound  float32 `json:"averageDeathPerRound"`
	AverageDamagePerRound float32 `json:"averageDamagePerRound"`
	UtilityDamagePerRound float32 `json:"utilityDamagePerRound"`
	FirstKillCount        int     `json:"firstKillCount"`
	FirstDeathCount       int     `json:"firstDeathCount"`
	FirstTradeDeathCount  int     `json:"firstTradeDeathCount"`
	TradeDeathCount       int     `json:"tradeDeathCount"`
	TradeKillCount        int     `json:"tradeKillCount"`
	FirstTradeKillCount   int     `json:"firstTradeKillCount"`
	OneKillCount          int     `json:"oneKillCount"`
	TwoKillCount          int     `json:"twoKillCount"`
	ThreeKillCount        int     `json:"threeKillCount"`
	FourKillCount         int     `json:"fourKillCount"`
	FiveKillCount         int     `json:"fiveKillCount"`
	HltvRating            float32 `json:"hltvRating"`
	HltvRating2           float32 `json:"hltvRating2"`
}

type PlayerPosition

type PlayerPosition struct {
	Frame                  int                    `json:"frame"`
	Tick                   int                    `json:"tick"`
	RoundNumber            int                    `json:"roundNumber"`
	IsAlive                bool                   `json:"isAlive"`
	Name                   string                 `json:"name"`
	SteamID64              uint64                 `json:"steamId"`
	X                      float64                `json:"x"`
	Y                      float64                `json:"y"`
	Z                      float64                `json:"z"`
	Yaw                    float32                `json:"yaw"`
	FlashDurationRemaining float64                `json:"flashDurationRemaining"`
	Side                   common.Team            `json:"side"`
	Money                  int                    `json:"money"`
	Health                 int                    `json:"health"`
	Armor                  int                    `json:"armor"`
	HasHelmet              bool                   `json:"hasHelmet"`
	HasBomb                bool                   `json:"hasBomb"`
	HasDefuseKit           bool                   `json:"hasDefuseKit"`
	IsDucking              bool                   `json:"isDucking"`
	IsAirborne             bool                   `json:"isAirborne"`
	IsScoping              bool                   `json:"isScoping"`
	IsDefusing             bool                   `json:"isDefusing"`
	IsPlanting             bool                   `json:"isPlanting"`
	IsGrabbingHostage      bool                   `json:"isGrabbingHostage"`
	ActiveWeaponName       constants.WeaponName   `json:"activeWeaponName"`
	Equipments             []constants.WeaponName `json:"equipments"`
	Grenades               []constants.WeaponName `json:"grenades"`
	Pistols                []constants.WeaponName `json:"pistols"`
	SMGs                   []constants.WeaponName `json:"smgs"`
	Rifles                 []constants.WeaponName `json:"rifles"`
	Heavy                  []constants.WeaponName `json:"heavy"`
}

type Round

type Round struct {
	Number              int                   `json:"number"`
	StartTick           int                   `json:"startTick"`
	StartFrame          int                   `json:"startFrame"`
	FreezeTimeEndTick   int                   `json:"freezeTimeEndTick"`
	FreezeTimeEndFrame  int                   `json:"freezeTimeEndFrame"`
	EndTick             int                   `json:"endTick"`
	EndFrame            int                   `json:"endFrame"`
	EndOfficiallyTick   int                   `json:"endOfficiallyTick"`
	EndOfficiallyFrame  int                   `json:"endOfficiallyFrame"`
	OvertimeNumber      int                   `json:"overtimeNumber"`
	TeamAName           string                `json:"teamAName"`
	TeamBName           string                `json:"teamBName"`
	TeamAScore          int                   `json:"teamAScore"`
	TeamBScore          int                   `json:"teamBScore"`
	TeamASide           common.Team           `json:"teamASide"`
	TeamBSide           common.Team           `json:"teamBSide"`
	TeamAEquipmentValue int                   `json:"teamAEquipmentValue"`
	TeamBEquipmentValue int                   `json:"teamBEquipmentValue"`
	TeamAMoneySpent     int                   `json:"teamAMoneySpent"`
	TeamBMoneySpent     int                   `json:"teamBmoneySpent"`
	TeamAEconomyType    constants.EconomyType `json:"teamAEconomyType"`
	TeamBEconomyType    constants.EconomyType `json:"teamBEconomyType"`
	Duration            int64                 `json:"duration"`
	EndReason           events.RoundEndReason `json:"endReason"`
	WinnerName          string                `json:"winnerName"`
	WinnerSide          common.Team           `json:"winnerSide"`
	// contains filtered or unexported fields
}

func (*Round) MarshalJSON

func (round *Round) MarshalJSON() ([]byte, error)

func (*Round) StartMoneyTeamA

func (round *Round) StartMoneyTeamA() int

func (*Round) StartMoneyTeamB

func (round *Round) StartMoneyTeamB() int

type RoundAlias

type RoundAlias Round

type RoundJSON

type RoundJSON struct {
	*RoundAlias
	StartMoneyTeamA int `json:"teamAStartMoney"`
	StartMoneyTeamB int `json:"teamBStartMoney"`
}

type Shot

type Shot struct {
	Frame                  int                  `json:"frame"`
	Tick                   int                  `json:"tick"`
	RoundNumber            int                  `json:"roundNumber"`
	WeaponName             constants.WeaponName `json:"weaponName"`
	WeaponID               string               `json:"weaponId"`
	ProjectileID           int64                `json:"projectileId"` // Available only for grenades
	X                      float64              `json:"x"`
	Y                      float64              `json:"y"`
	Z                      float64              `json:"z"`
	PlayerName             string               `json:"playerName"`
	PlayerSteamID64        uint64               `json:"playerSteamId"`
	PlayerTeamName         string               `json:"playerTeamName"`
	PlayerSide             common.Team          `json:"playerSide"`
	IsPlayerControllingBot bool                 `json:"isPlayerControllingBot"`
	PlayerVelocityX        float64              `json:"playerVelocityX"`
	PlayerVelocityY        float64              `json:"playerVelocityY"`
	PlayerVelocityZ        float64              `json:"playerVelocityZ"`
	Yaw                    float32              `json:"yaw"`
	Pitch                  float32              `json:"pitch"`
	RecoilIndex            float32              `json:"recoilIndex"`
	AimPunchAngleX         float64              `json:"aimPunchAngleX"`
	AimPunchAngleY         float64              `json:"aimPunchAngleY"`
	ViewPunchAngleX        float64              `json:"viewPunchAngleX"`
	ViewPunchAngleY        float64              `json:"viewPunchAngleY"`
}

type SmokeStart

type SmokeStart struct {
	Frame            int         `json:"frame"`
	Tick             int         `json:"tick"`
	RoundNumber      int         `json:"roundNumber"`
	GrenadeID        string      `json:"grenadeId"`
	ProjectileID     int64       `json:"projectileId"`
	X                float64     `json:"x"`
	Y                float64     `json:"y"`
	Z                float64     `json:"z"`
	ThrowerSteamID64 uint64      `json:"throwerSteamId"`
	ThrowerName      string      `json:"throwerName"`
	ThrowerSide      common.Team `json:"throwerSide"`
	ThrowerTeamName  string      `json:"throwerTeamName"`
	ThrowerVelocityX float64     `json:"throwerVelocityX"`
	ThrowerVelocityY float64     `json:"throwerVelocityY"`
	ThrowerVelocityZ float64     `json:"throwerVelocityZ"`
	ThrowerPitch     float32     `json:"throwerPitch"`
	ThrowerYaw       float32     `json:"throwerYaw"`
}

type Team

type Team struct {
	Name            string               `json:"name"`
	Letter          constants.TeamLetter `json:"letter"`
	Score           int                  `json:"score"`
	ScoreFirstHalf  int                  `json:"scoreFirstHalf"`
	ScoreSecondHalf int                  `json:"scoreSecondHalf"`
	CurrentSide     *common.Team         `json:"currentSide"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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