replay

package
v0.0.0-...-de68dec Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: AGPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongMagic                    = errors.New("wrong magic")
	ErrWrongReplaySettingsVer        = errors.New("wrong replay settings version")
	ErrWrongReplayEmbeddedMapVersion = errors.New("wrong embedded map version")
)

Functions

This section is empty.

Types

type EndChunk

type EndChunk struct {
	GameTimeElapsed int `json:"gameTimeElapsed"`
}

type Game

type Game struct {
	Alliance          int           `json:"alliance"`
	Base              int           `json:"base"`
	Hash              string        `json:"hash"`
	InactivityMinutes int           `json:"inactivityMinutes"`
	IsMapMod          bool          `json:"isMapMod"`
	IsRandom          bool          `json:"isRandom"`
	Map               string        `json:"map"`
	MapHasScavengers  bool          `json:"mapHasScavengers"`
	MaxPlayers        int           `json:"maxPlayers"`
	ModHashes         []interface{} `json:"modHashes"`
	Name              string        `json:"name"`
	Power             int           `json:"power"`
	Scavengers        int           `json:"scavengers"`
	TechLevel         int           `json:"techLevel"`
	Type              int           `json:"type"`
}

type GameOptions

type GameOptions struct {
	DataHash          []interface{}    `json:"dataHash"`
	Game              Game             `json:"game"`
	Ingame            Ingame           `json:"ingame"`
	Multistats        []Multistats     `json:"multistats"`
	NetplayBComms     bool             `json:"netplay.bComms"`
	NetplayHostPlayer int              `json:"netplay.hostPlayer"`
	NetplayPlayers    []NetplayPlayers `json:"netplay.players"`
	RandSeed          int              `json:"randSeed"`
	SelectedPlayer    int              `json:"selectedPlayer"`
	VersionString     string           `json:"versionString"`
}

type Ingame

type Ingame struct {
	Flags           int               `json:"flags"`
	Side            bool              `json:"side"`
	StructureLimits []StructureLimits `json:"structureLimits"`
}

type Multistats

type Multistats struct {
	Identity        string `json:"identity"`
	Losses          int    `json:"losses"`
	Played          int    `json:"played"`
	RecentKills     int    `json:"recentKills"`
	RecentPowerLost int    `json:"recentPowerLost"`
	RecentScore     int    `json:"recentScore"`
	TotalKills      int    `json:"totalKills"`
	TotalScore      int    `json:"totalScore"`
	Wins            int    `json:"wins"`
}

type NetplayPlayers

type NetplayPlayers struct {
	Ai              int    `json:"ai"`
	Allocated       bool   `json:"allocated"`
	Colour          int    `json:"colour"`
	Difficulty      int    `json:"difficulty"`
	Faction         int    `json:"faction"`
	Heartattacktime int    `json:"heartattacktime"`
	Heartbeat       bool   `json:"heartbeat"`
	IsSpectator     bool   `json:"isSpectator"`
	Kick            bool   `json:"kick"`
	Name            string `json:"name"`
	Position        int    `json:"position"`
	Ready           bool   `json:"ready"`
	Team            int    `json:"team"`
}

type Replay

type Replay struct {
	Settings    ReplaySettings
	EmbeddedMap []byte
	Messages    []ReplayPacket
	End         EndChunk
}

func ReadReplay

func ReadReplay(r io.Reader) (o *Replay, err error)

type ReplayPacket

type ReplayPacket struct {
	Player byte
	packet.NetPacket
}

type ReplaySettings

type ReplaySettings struct {
	GameOptions     GameOptions `json:"gameOptions"`
	Major           int         `json:"major"`
	Minor           int         `json:"minor"`
	ReplayFormatVer int         `json:"replayFormatVer"`
}

type StructureLimits

type StructureLimits struct {
	ID    int `json:"id"`
	Limit int `json:"limit"`
}

Jump to

Keyboard shortcuts

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