rplpa

package module
v0.0.0-...-2150375 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 10 Imported by: 10

README

rplpa Build Status

rplpa is an Replay Parser for golang.
IDK for what you'll use it, but i'll use it for an anticheat.

Example:

package main

import (
  "ioutil"

  "github.com/Mempler/rplpa"
)

func main() {
  buf, err := ioutil.ReadFile("path/to/replay.osr")
  if err != nil {
    panic(err)
  }
  replay, err := ParseReplay(b)
  if err != nil {
    panic(err)
  }
}

or compressed replays

package main

import (
  "ioutil"

  "github.com/Mempler/rplpa"
)

func main() {
  RawData := []byte{} // IDK, some data.
  replaydata, err := ParseCompressed(RawData)
  if err != nil {
    panic(err)
  }
}

Documentation

Index

Constants

View Source
const (
	OSU   = 0
	TAIKO = 1
	CTB   = 2
	MANIA = 3
)

All osu playmodes

View Source
const (
	LEFTCLICK  = 1 << 0
	RIGHTCLICK = 1 << 1
	KEY1       = 1 << 2
	KEY2       = 1 << 3
	SMOKE      = 1 << 4
)

ClickState

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyPressed

type KeyPressed struct {
	LeftClick  bool
	RightClick bool
	Key1       bool
	Key2       bool
	Smoke      bool
}

KeyPressed is the Parsed Compressed KeyPressed.

type LifeBarGraph

type LifeBarGraph struct {
	Time int32
	HP   float32
}

LifeBarGraph is the Bar under the Score stuff.

type Replay

type Replay struct {
	PlayMode     int8
	OsuVersion   int32
	BeatmapMD5   string
	Username     string
	ReplayMD5    string
	Count300     uint16
	Count100     uint16
	Count50      uint16
	CountGeki    uint16
	CountKatu    uint16
	CountMiss    uint16
	Score        int32
	MaxCombo     uint16
	Fullcombo    bool
	Mods         uint32
	LifebarGraph []LifeBarGraph
	Timestamp    time.Time
	ReplayData   []*ReplayData
	ScoreID      int64 // idk if it's the scoreid, maybe it is maybe not.
}

Replay is the Parsed replay.

func NewReplay

func NewReplay() *Replay

NewReplay returns an Empty Replay

func ParseReplay

func ParseReplay(file []byte) (r *Replay, err error)

ParseReplay parses a Replay and returns a *Replay

type ReplayData

type ReplayData struct {
	Time       int64
	MosueX     float32
	MouseY     float32
	KeyPressed *KeyPressed
}

ReplayData is the Parsed Compressed Replay data.

func ParseCompressed

func ParseCompressed(file []byte) (d []*ReplayData, err error)

ParseCompressed parses a compressed replay, (ReplayData)

Jump to

Keyboard shortcuts

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