Documentation ¶
Overview ¶
Code generated by "genops.go -type=Operator -atkval=Attack -defval=Defense"; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func ListReplayFiles(root *os.File) ([]string, error)
- func Ok(err error) bool
- type GameMode
- type Header
- type Map
- type MatchReader
- func (m *MatchReader) Data() any
- func (m *MatchReader) FirstRound() (r *Reader, err error)
- func (m *MatchReader) LastRound() (r *Reader, err error)
- func (m *MatchReader) Listen(pattern []byte, callback func(r *Reader) error)
- func (m *MatchReader) NumRounds() int
- func (m *MatchReader) PlayerStats() []PlayerMatchStats
- func (m *MatchReader) Read() error
- func (m *MatchReader) RoundAt(i int) (r *Reader, err error)
- func (m *MatchReader) WriteExcel(out io.Writer) error
- func (m *MatchReader) WriteJSON(out io.Writer) error
- type MatchType
- type MatchUpdate
- type MatchUpdateType
- type Operator
- type Player
- type PlayerMatchStats
- type PlayerRoundStats
- type Reader
- func (r *Reader) Bytes(n int) ([]byte, error)
- func (r *Reader) Dump(w io.StringWriter) error
- func (r *Reader) Head()
- func (r *Reader) Int() (int, error)
- func (r *Reader) KillsAndDeaths() []MatchUpdate
- func (r *Reader) Listen(pattern []byte, callback func(r *Reader) error)
- func (r *Reader) NumPlayers(team int) int
- func (r *Reader) OpeningDeath() MatchUpdate
- func (r *Reader) OpeningKill() MatchUpdate
- func (r *Reader) PlayerIndexByID(id []byte) int
- func (r *Reader) PlayerIndexByUsername(username string) int
- func (r *Reader) PlayerStats() []PlayerRoundStats
- func (r *Reader) Read() (err error)
- func (r *Reader) ReadPartial() error
- func (r *Reader) Seek(pattern []byte) error
- func (r *Reader) Skip(n int) error
- func (r *Reader) String() (string, error)
- func (r *Reader) Trades() [][]MatchUpdate
- func (r *Reader) Uint32() (uint32, error)
- func (r *Reader) Uint64() (uint64, error)
- func (r *Reader) Write(w io.Writer) (n int, err error)
- type Scoreboard
- type ScoreboardPlayer
- type Team
- type TeamRole
- type WinCondition
Constants ¶
const ( QuickMatch MatchType = 1 Ranked MatchType = 2 CustomGameLocal MatchType = 3 CustomGameOnline MatchType = 4 Standard MatchType = 8 Bomb GameMode = 327933806 SecureArea GameMode = 1983085217 Hostage GameMode = 2838806006 ClubHouse Map = 837214085 KafeDostoyevsky Map = 1378191338 Kanal Map = 1460220617 Yacht Map = 1767965020 PresidentialPlane Map = 2609218856 ConsulateY7 Map = 2609221242 BartlettU Map = 2697268122 Coastline Map = 42090092951 Tower Map = 53627213396 Villa Map = 88107330328 Fortress Map = 126196841359 HerefordBase Map = 127951053400 ThemePark Map = 199824623654 Oregon Map = 231702797556 House Map = 237873412352 Chalet Map = 259816839773 Skyscraper Map = 276279025182 Border Map = 305979357167 Favela Map = 329867321446 Bank Map = 355496559878 Outback Map = 362605108559 EmeraldPlains Map = 365284490964 StadiumBravo Map = 270063334510 NighthavenLabs Map = 378595635123 Consulate Map = 379218689149 Lair Map = 388073319671 KilledOpponents WinCondition = "KilledOpponents" SecuredArea WinCondition = "SecuredArea" // TODO DisabledDefuser WinCondition = "DisabledDefuser" DefusedBomb WinCondition = "DefusedBomb" ExtractedHostage WinCondition = "ExtractedHostage" // TODO Time WinCondition = "Time" Attack TeamRole = "Attack" Defense TeamRole = "Defense" Recruit Operator = 359656345734 Castle Operator = 92270642682 // May technically refer to the op icon? Aruni Operator = 104189664704 Kaid Operator = 161289666230 Mozzie Operator = 174977508820 Pulse Operator = 92270642708 Ace Operator = 104189664390 Echo Operator = 92270642214 Azami Operator = 378305069945 Solis Operator = 391752120891 Capitao Operator = 92270644215 Zofia Operator = 92270644189 Dokkaebi Operator = 92270644267 Warden Operator = 104189662920 Mira Operator = 92270644319 Sledge Operator = 92270642344 Melusi Operator = 104189664273 Bandit Operator = 92270642526 Valkyrie Operator = 92270642188 Rook Operator = 92270644059 Kapkan Operator = 92270641980 Zero Operator = 291191151607 Iana Operator = 104189664038 Ash Operator = 92270642656 Blackbeard Operator = 92270642136 Osa Operator = 288200867444 Thorn Operator = 373711624351 Jager Operator = 92270642604 Kali Operator = 104189663920 Thermite Operator = 92270642760 Brava Operator = 288200866821 Amaru Operator = 104189663607 Ying Operator = 92270642292 Lesion Operator = 92270642266 Doc Operator = 92270644007 Lion Operator = 104189661861 Fuze Operator = 92270642032 Smoke Operator = 92270642396 Vigil Operator = 92270644293 Mute Operator = 92270642318 Goyo Operator = 104189663698 Wamai Operator = 104189663803 Ela Operator = 92270644163 Montagne Operator = 92270644033 Nokk Operator = 104189663024 Alibi Operator = 104189662071 Finka Operator = 104189661965 Caveira Operator = 92270644241 Nomad Operator = 161289666248 Thunderbird Operator = 288200867351 Sens Operator = 384797789346 IQ Operator = 92270642578 Blitz Operator = 92270642539 Hibana Operator = 92270642240 Maverick Operator = 104189662384 Flores Operator = 328397386974 Buck Operator = 92270642474 Twitch Operator = 92270644111 Gridlock Operator = 174977508808 Thatcher Operator = 92270642422 Glaz Operator = 92270642084 Jackal Operator = 92270644345 Grim Operator = 374667788042 Tachanka Operator = 291437347686 Oryx Operator = 104189664155 Frost Operator = 92270642500 Maestro Operator = 104189662175 Clash Operator = 104189662280 Fenrir Operator = 288200867339 Ram Operator = 395943091136 Tubarao Operator = 288200867549 Deimos Operator = 374667787816 )
Variables ¶
var ErrInvalidFile = errors.New("dissect: not a dissect file")
var ErrInvalidFolder = errors.New("dissect: not a match folder")
var ErrInvalidStringSep = errors.New("dissect: invalid string separator")
Functions ¶
Types ¶
type GameMode ¶
type GameMode int
func (GameMode) MarshalJSON ¶
func (*GameMode) UnmarshalJSON ¶ added in v0.11.0
type Header ¶
type Header struct { GameVersion string `json:"gameVersion"` CodeVersion int `json:"codeVersion"` Timestamp time.Time `json:"timestamp"` MatchType MatchType `json:"matchType"` Map Map `json:"map"` Site string `json:"site,omitempty"` RecordingPlayerID uint64 `json:"recordingPlayerID"` RecordingProfileID string `json:"recordingProfileID,omitempty"` AdditionalTags string `json:"additionalTags"` GameMode GameMode `json:"gamemode"` RoundsPerMatch int `json:"roundsPerMatch"` RoundsPerMatchOvertime int `json:"roundsPerMatchOvertime"` RoundNumber int `json:"roundNumber"` OvertimeRoundNumber int `json:"overtimeRoundNumber"` Teams [2]Team `json:"teams"` Players []Player `json:"players"` GMSettings []int `json:"gmSettings"` PlaylistCategory int `json:"playlistCategory,omitempty"` MatchID string `json:"matchID"` }
func (Header) RecordingPlayer ¶
type MatchReader ¶
func NewMatchReader ¶
func NewMatchReader(in *os.File) (m *MatchReader, err error)
func (*MatchReader) Data ¶ added in v0.13.0
func (m *MatchReader) Data() any
func (*MatchReader) FirstRound ¶
func (m *MatchReader) FirstRound() (r *Reader, err error)
func (*MatchReader) LastRound ¶
func (m *MatchReader) LastRound() (r *Reader, err error)
func (*MatchReader) Listen ¶ added in v0.15.0
func (m *MatchReader) Listen(pattern []byte, callback func(r *Reader) error)
Listen registers a callback to be run during round Read whenever the pattern is found.
func (*MatchReader) NumRounds ¶
func (m *MatchReader) NumRounds() int
func (*MatchReader) PlayerStats ¶
func (m *MatchReader) PlayerStats() []PlayerMatchStats
func (*MatchReader) Read ¶
func (m *MatchReader) Read() error
func (*MatchReader) WriteExcel ¶ added in v0.17.1
func (m *MatchReader) WriteExcel(out io.Writer) error
type MatchType ¶
type MatchType int
func (MatchType) MarshalJSON ¶
func (*MatchType) UnmarshalJSON ¶ added in v0.11.0
type MatchUpdate ¶ added in v0.10.0
type MatchUpdate struct { Type MatchUpdateType `json:"type"` Username string `json:"username,omitempty"` Target string `json:"target,omitempty"` Headshot *bool `json:"headshot,omitempty"` Time string `json:"time"` TimeInSeconds float64 `json:"timeInSeconds"` Message string `json:"message,omitempty"` Operator Operator `json:"operator,omitempty"` }
type MatchUpdateType ¶ added in v0.10.0
type MatchUpdateType int
const ( Kill MatchUpdateType = iota Death DefuserPlantStart DefuserPlantComplete DefuserDisableStart DefuserDisableComplete LocateObjective OperatorSwap Battleye PlayerLeave Other )
func (MatchUpdateType) MarshalJSON ¶ added in v0.10.0
func (i MatchUpdateType) MarshalJSON() (text []byte, err error)
func (MatchUpdateType) String ¶ added in v0.10.0
func (i MatchUpdateType) String() string
func (*MatchUpdateType) UnmarshalJSON ¶ added in v0.11.0
func (i *MatchUpdateType) UnmarshalJSON(data []byte) (err error)
type Operator ¶ added in v0.10.0
type Operator uint64
func (Operator) MarshalJSON ¶ added in v0.10.0
func (*Operator) UnmarshalJSON ¶ added in v0.11.0
type Player ¶
type Player struct { ID uint64 `json:"id,omitempty"` ProfileID string `json:"profileID,omitempty"` // Ubisoft stats identifier Username string `json:"username"` TeamIndex int `json:"teamIndex"` Operator Operator `json:"operator"` HeroName int `json:"heroName,omitempty"` Alliance int `json:"alliance"` RoleImage int `json:"roleImage,omitempty"` RoleName string `json:"roleName,omitempty"` RolePortrait int `json:"rolePortrait,omitempty"` Spawn string `json:"spawn,omitempty"` DissectID []byte `json:"-" deep:"-"` // dissect player id at end of packet (4 bytes) }
type PlayerMatchStats ¶
type PlayerRoundStats ¶
type PlayerRoundStats struct { Username string `json:"username"` TeamIndex int `json:"-"` Score int `json:"score"` Operator string `json:"-"` Kills int `json:"kills"` Died bool `json:"died"` Assists int `json:"assists"` Headshots int `json:"headshots"` HeadshotPercentage float64 `json:"headshotPercentage"` OneVx int `json:"1vX,omitempty"` }
type Reader ¶ added in v0.11.0
type Reader struct { Header Header `json:"header"` MatchFeedback []MatchUpdate `json:"matchFeedback"` Scoreboard Scoreboard // contains filtered or unexported fields }
func (*Reader) Dump ¶ added in v0.11.0
func (r *Reader) Dump(w io.StringWriter) error
Dump dumps packet information to w. Packets are separated line-by-line into sections based on game time.
func (*Reader) KillsAndDeaths ¶ added in v0.11.0
func (r *Reader) KillsAndDeaths() []MatchUpdate
func (*Reader) Listen ¶ added in v0.13.0
Listen registers a callback to be run during Read whenever the pattern is found.
func (*Reader) NumPlayers ¶ added in v0.11.0
func (*Reader) OpeningDeath ¶ added in v0.11.0
func (r *Reader) OpeningDeath() MatchUpdate
OpeningDeath returns the first player to die (KILL or DEATH activity).
func (*Reader) OpeningKill ¶ added in v0.11.0
func (r *Reader) OpeningKill() MatchUpdate
OpeningKill returns the first player to kill.
func (*Reader) PlayerIndexByID ¶ added in v0.13.0
func (*Reader) PlayerIndexByUsername ¶ added in v0.13.0
func (*Reader) PlayerStats ¶ added in v0.11.0
func (r *Reader) PlayerStats() []PlayerRoundStats
func (*Reader) Read ¶ added in v0.11.0
Read continues reading the replay past the header until the EOF.
func (*Reader) ReadPartial ¶ added in v0.11.0
ReadPartial continues reading the replay past the header until the full player list is read. This information does not include dynamic data, such as attack operator swaps. Use ReadPartial for faster, minimal reads.
func (*Reader) Trades ¶ added in v0.11.0
func (r *Reader) Trades() [][]MatchUpdate
Trades returns KILL Activity pairs of trades.
type Scoreboard ¶ added in v0.18.0
type Scoreboard struct {
Players []ScoreboardPlayer
}
type ScoreboardPlayer ¶ added in v0.18.0
type Team ¶
type Team struct { Name string `json:"name"` Score int `json:"score"` Won bool `json:"won"` WinCondition WinCondition `json:"winCondition,omitempty"` Role TeamRole `json:"role,omitempty"` }
type WinCondition ¶ added in v0.10.0
type WinCondition string