dissect

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Code generated by "genops.go -type=Operator -atkval=Attack -defval=Defense"; DO NOT EDIT.

Index

Constants

View Source
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
)
View Source
const (
	Y7S1 int = 6884476
	Y7S2 int = 7040830
	Y7S4 int = 7338571
	Y8S1 int = 7408213
	Y8S2 int = 7601998
	Y8S3 int = 7762708
	Y8S4 int = 7921866
	Y9S1 int = 8111697
)

Variables

View Source
var ErrInvalidFile = errors.New("dissect: not a dissect file")
View Source
var ErrInvalidFolder = errors.New("dissect: not a match folder")
View Source
var ErrInvalidStringSep = errors.New("dissect: invalid string separator")

Functions

func ListReplayFiles added in v0.15.0

func ListReplayFiles(root *os.File) ([]string, error)

func Ok

func Ok(err error) bool

Ok returns true if err only pertains to EOF (read was successful).

Types

type GameMode

type GameMode int

func (GameMode) MarshalJSON

func (i GameMode) MarshalJSON() (text []byte, err error)

func (GameMode) String

func (i GameMode) String() string

func (*GameMode) UnmarshalJSON added in v0.11.0

func (i *GameMode) UnmarshalJSON(data []byte) (err error)
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

func (h Header) RecordingPlayer() Player

type Map

type Map int

func (Map) MarshalJSON

func (i Map) MarshalJSON() (text []byte, err error)

func (Map) String

func (i Map) String() string

func (*Map) UnmarshalJSON added in v0.11.0

func (i *Map) UnmarshalJSON(data []byte) (err error)

type MatchReader

type MatchReader struct {
	Root *os.File
	// contains filtered or unexported fields
}

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) RoundAt

func (m *MatchReader) RoundAt(i int) (r *Reader, err error)

func (*MatchReader) WriteExcel added in v0.17.1

func (m *MatchReader) WriteExcel(out io.Writer) error

func (*MatchReader) WriteJSON added in v0.17.1

func (m *MatchReader) WriteJSON(out io.Writer) error

type MatchType

type MatchType int

func (MatchType) MarshalJSON

func (i MatchType) MarshalJSON() (text []byte, err error)

func (MatchType) String

func (i MatchType) String() string

func (*MatchType) UnmarshalJSON added in v0.11.0

func (i *MatchType) UnmarshalJSON(data []byte) (err error)

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 (i Operator) MarshalJSON() (text []byte, err error)

func (Operator) Role added in v0.10.0

func (i Operator) Role() TeamRole

func (Operator) String added in v0.10.0

func (i Operator) String() string

func (*Operator) UnmarshalJSON added in v0.11.0

func (i *Operator) UnmarshalJSON(data []byte) (err error)

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 PlayerMatchStats struct {
	Username           string  `json:"username"`
	TeamIndex          int     `json:"-"`
	Rounds             int     `json:"rounds"`
	Kills              int     `json:"kills"`
	Deaths             int     `json:"deaths"`
	Assists            int     `json:"assists"`
	Headshots          int     `json:"headshots"`
	HeadshotPercentage float64 `json:"headshotPercentage"`
}

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 NewReader

func NewReader(in io.Reader) (r *Reader, err error)

NewReader decompresses in using zstd and validates the dissect header.

func (*Reader) Bytes added in v0.13.0

func (r *Reader) Bytes(n int) ([]byte, error)

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) Head added in v0.11.0

func (r *Reader) Head()

func (*Reader) Int added in v0.13.0

func (r *Reader) Int() (int, error)

func (*Reader) KillsAndDeaths added in v0.11.0

func (r *Reader) KillsAndDeaths() []MatchUpdate

func (*Reader) Listen added in v0.13.0

func (r *Reader) Listen(pattern []byte, callback func(r *Reader) error)

Listen registers a callback to be run during Read whenever the pattern is found.

func (*Reader) NumPlayers added in v0.11.0

func (r *Reader) NumPlayers(team int) int

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 (r *Reader) PlayerIndexByID(id []byte) int

func (*Reader) PlayerIndexByUsername added in v0.13.0

func (r *Reader) PlayerIndexByUsername(username string) int

func (*Reader) PlayerStats added in v0.11.0

func (r *Reader) PlayerStats() []PlayerRoundStats

func (*Reader) Read added in v0.11.0

func (r *Reader) Read() (err error)

Read continues reading the replay past the header until the EOF.

func (*Reader) ReadPartial added in v0.11.0

func (r *Reader) ReadPartial() error

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) Seek added in v0.13.0

func (r *Reader) Seek(pattern []byte) error

Seek skips through the replay until the pattern is found.

func (*Reader) Skip added in v0.13.0

func (r *Reader) Skip(n int) error

Skip increases the replay offset by n bytes.

func (*Reader) String added in v0.13.0

func (r *Reader) String() (string, error)

func (*Reader) Trades added in v0.11.0

func (r *Reader) Trades() [][]MatchUpdate

Trades returns KILL Activity pairs of trades.

func (*Reader) Uint32 added in v0.13.0

func (r *Reader) Uint32() (uint32, error)

func (*Reader) Uint64 added in v0.13.0

func (r *Reader) Uint64() (uint64, error)

func (*Reader) Write added in v0.16.3

func (r *Reader) Write(w io.Writer) (n int, err error)

type Scoreboard added in v0.18.0

type Scoreboard struct {
	Players []ScoreboardPlayer
}

type ScoreboardPlayer added in v0.18.0

type ScoreboardPlayer struct {
	ID               []byte
	Score            uint32
	Assists          uint32
	AssistsFromRound uint32
}

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 TeamRole added in v0.10.0

type TeamRole string

type WinCondition added in v0.10.0

type WinCondition string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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