osr

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// W is elapsed time since last action.
	W int64
	// X is x-axis mouse cursor position or pressed keys at osu!mania.
	// The least bit refers to state of the leftmost column and so on.
	X float64
	// Y is y-axis mouse cursor position.
	Y float64
	// Z is pressed keys at standard.
	Z int64
}

type Format

type Format struct {
	GameMode    int8
	GameVersion int32
	BeatmapMD5  string
	PlayerName  string
	ReplayMD5   string
	Num300      int16
	Num100      int16
	Num50       int16
	NumGeki     int16
	NumKatu     int16
	NumMiss     int16
	Score       int32
	Combo       int16
	FullCombo   bool
	ModsBits    int32
	LifeBar     string
	TimeStamp   int64
	ReplayData  []Action
	OnlineID    int64
}

func NewFormat added in v0.6.0

func NewFormat(file fs.File) (f *Format, err error)

NewFormat requires struct which implements the two following methods: func Read(b []byte) (n int, err error) func ReadByte() (byte, error) The simplest way is doing io.ReadAll then bytes.NewReader.

func (Format) IsAuto added in v0.6.0

func (f Format) IsAuto() bool

The easiest way to check whether the replay is auto or not is checking the last action data: {W:-12345 X:0 Y:0 Z:0}

func (Format) KeyboardReader added in v0.6.0

func (f Format) KeyboardReader(keyCount int) input.KeyboardReader

func (Format) MD5

func (f Format) MD5() (hash string, err error)

f.BeatmapMD5 is a string, consisting of 32 hexadecimal characters. It needs to be converted from 32 hexadecimal characters to 16 bytes. strconv.ParseUint(string(f.BeatmapMD5[i*2:(i+1)*2]), 16, 8) // byte

Jump to

Keyboard shortcuts

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