Skip to content

Repository files navigation

libenforcer

TypeScript and WebAssembly library for detecting cheating in Super Smash Bros Melee replays (.slp files).

Install

yarn add slp-enforcer

Usage

importinit,{SlpGame}from'slp-enforcer'awaitinit()constgame=newSlpGame(slpBytes)constresult=game.analyzePlayer(playerIndex)console.log(result.controller_type)// "Box" or "Analog"console.log(result.is_legal)// true if all applicable checks pass// Box controller checks (undefined if analog)result.travel_time// CheckResultresult.disallowed_cstick// CheckResultresult.crouch_uptilt// CheckResultresult.sdi// CheckResultresult.input_fuzzing// FuzzAnalysis (LLR score, p-values, odds ratio)// Analog controller checks (undefined if box)result.goomwave// CheckResultresult.uptilt_rounding// CheckResultgame.free()

Other SlpGame methods

game.isBoxController(playerIndex)// booleangame.getMainStickCoords(playerIndex)// Coord[]game.getCStickCoords(playerIndex)// Coord[]game.isHandwarmer()// booleangame.getGameSettings()// GameSettingsgame.isSlpMinVersion()// boolean

Utility functions

Standalone functions that operate on raw coordinate arrays:

isBoxControllerFromCoords, getCStickViolations, averageTravelCoordHitRate, hasGoomwaveClamping, getJoystickRegion, processAnalogStick, FloatEquals, isEqual, getUniqueCoords, getTargetCoords

Development

Build

yarn build # WASM + TypeScript
yarn build:wasm # WASM only
yarn build:ts # TypeScript only

Test

yarn test# Rust + TypeScript (all tests)
yarn test:rust # Rust unit + integration tests only
yarn test:ts # TypeScript integration tests only

About

TypeScript library for the SLP enforcer app

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages