parser

package
v0.0.0-...-e8fbdbe Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Hex values for all modes
	ModeStandard Mode = 0x0
	ModeTaiko    Mode = 0x1
	ModeCTB      Mode = 0x2
	ModeMania    Mode = 0x3
	// Names for all modes
	ModeStandardName = "osu!standard"
	ModeTaikoName    = "osu!taiko"
	ModeCTBName      = "osu!catch"
	ModeManiaName    = "osu!mania"
)

Variables

This section is empty.

Functions

func ReadBoolean

func ReadBoolean(buffer *bufio.Reader) (bool, error)

Get the boolean value of the next byte of a reader

func ReadInteger

func ReadInteger(buffer io.Reader) (uint32, error)

func ReadLZMA

func ReadLZMA(reader *bufio.Reader, length uint32) (string, error)

func ReadLong

func ReadLong(buffer io.Reader) (uint64, error)

func ReadShort

func ReadShort(buffer io.Reader) (uint16, error)

Read a short value (uint16) from a reader

func ReadString

func ReadString(reader *bufio.Reader) (string, error)

Get the string value from bufio.Reader

func ReadUleb

func ReadUleb(reader *bufio.Reader) (uint64, error)

Get the value of a variable length integer

Types

type Action

type Action struct {
	Millis  int64   `json:"millis"`
	X       float32 `json:"x"`
	Y       float32 `json:"y"`
	Pressed []Key   `json:"pressed"`
}

type Common

type Common struct {
	Mode              Mode   `json:"mode"`
	GameVersion       uint32 `json:"game_version"`
	BeatMapHash       string `json:"beat_map_hash"`
	PlayerName        string `json:"player_name"`
	ReplayHash        string `json:"replay_hash"`
	Amount300s        uint16 `json:"amount_300_s"`
	Amount100s        uint16 `json:"amount_100_s"`
	Amount50s         uint16 `json:"amount_50_s"`
	AmountSpecial300s uint16 `json:"amount_special_300_s"`
	AmountSpecial100s uint16 `json:"amount_special_100_s"`
	AmountMisses      uint16 `json:"amount_misses"`
	TotalScore        uint32 `json:"total_score"`
	LongestCombo      uint16 `json:"longest_combo"`
	IsPerfect         bool   `json:"is_perfect"`
	Timestamp         uint64 `json:"timestamp"`
	ScoreID           uint64 `json:"score_id"`
}

type HealthGraphPoint

type HealthGraphPoint struct {
	Millis uint64  `json:"millis"`
	Life   float32 `json:"life"`
}

type Key

type Key string

type Mod

type Mod struct {
	Name       string  `json:"name"`
	Multiplier float32 `json:"multiplier"`
	// contains filtered or unexported fields
}

func (Mod) String

func (m Mod) String() string

type Mode

type Mode byte

OSU! mode (Standard, Taiko, Catch the Beat, Mania)

func (Mode) MarshalJSON

func (m Mode) MarshalJSON() ([]byte, error)

func (Mode) String

func (m Mode) String() string

type ReplayData

type ReplayData struct {
	Common
	Mods        []Mod              `json:"mods"`
	HealthGraph []HealthGraphPoint `json:"health_graph"`
	ReplayData  []Action           `json:"replay_data"`
}

export replay structure

func GetFileReplay

func GetFileReplay(file string) (*ReplayData, error)

Jump to

Keyboard shortcuts

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