Giter Site home page Giter Site logo

xnocken / replay-reader Goto Github PK

View Code? Open in Web Editor NEW
45.0 5.0 8.0 19.72 MB

The only libary that can parse 99% (or more) of fortnite replays.

License: MIT License

JavaScript 100.00%
nodejs parser javascript node parse fortnite replays hacktoberfest

replay-reader's Introduction

Fortnite Replay Parser

npm version

The only libary that can parse 100% of fortnite replays.

Documentation

Prerequisites

Installation

npm i fortnite-replay-parser  

or

yarn add fortnite-replay-parser

Code Example

Writing code with this library is pretty straight-forward as there is only one function.

The function takes two arguments:

  1. The buffer of the replay file, which can easily be obtained by using fs.
  2. (optional) A config that allows you to customize some things (e.g. parseLevel).
const fs = require('fs');
const parseReplay = require('fortnite-replay-parser');
const replayBuffer = fs.readFileSync('your.replay');

const config = {
  parseLevel: 10,
  debug: true,
}

parseReplay(replayBuffer, config).then((parsedReplay) => {
  fs.writeFileSync('replayData.json', JSON.stringify(parsedReplay));
}).catch((err) => {
  console.error('An error occured while parsing the replay!', err);
});

Optimizing Runtime

You (very) often don't need all of the data that is parsed, which is why there is an option that lets you specify which data you want to parse. It will also greatly improve the parser's speed. The tutorial on how to do that is here.

Tip

If you're using Node v14 or v15 you have to start process with --experimental-wasm-simd

replay-reader's People

Contributors

hidechae avatar martinevsky avatar vastoa avatar xnocken avatar zimpatrick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

replay-reader's Issues

Also not an issue, but a question

Would you happen to know how to get these files from a console? Or do you have any suggestions on where to look to figure that out myself? I'm not sure if I am using the wrong search terms or what but I can't seem to find anything.

Not an issue, just my own incompetence!

I get this error about ooz-wasm...

Uncaught Error Error: Cannot find module 'ooz-wasm'

I'm more of a python coder, so I honestly cannot figure out how to add the ooz-wasm module so replay-reader can find it.

Sorry if I'm asking something very basic...

Can't get `UniqueId`

Starting from C4S4, I can't get UniqueId from the replay files.
Could you please address this issue so I can get the UniqueId again?

v2 changes

Features

  • Add onActorCreate event
  • Allow multiple states objects per nfe
  • Allow multiple export objects per nfe
  • Allow states to be an array
  • Only create state entry if exportGroup is empty
  • Add handleAsName max depth setting to nfe
  • Make path array or string in nfe
  • Add an option to disable chunks export
  • Add Missing Events
  • Restructure events for easier access
  • Use customExportName for references withon nfes
  • Add version validation
  • Extra thread for downloading
  • Add setting overrides for different version types

Bugs

  • VehicleSeatComponent has a lower parse level than vehicle
  • Look into receiveNetFieldExportsCompat
  • Partial path does not work with static objects
  • Check checkpoints
  • Check older versions
  • storeAsHandleMaxDepth gets overwritten by undefined if its set to 0
  • logger is undfined while parse level check

Other

  • Documentation
  • Change handleExports settings name
  • Remove useless properties from NFEs
  • Rename files
  • Remove unused files and variables
  • Adjust NFE Validation
  • Typescript rewrite
  • Improve nfe
  • Add classes and enums to cache so it can be easily accessed and overwritten
  • Store export name in nfe
  • Improve typings that they show only valid options in nfes

If player is a bot, BotUniqueId is empty

Thanks for your awesome work on this project.

I am having an issue getting Bot player IDs.

If a player is a bot, they do not have a "UniqueId" property, instead it's "BotUniqueId".

I can't work out how to get "BotUniqueId" to pass. If I replace this line with BotUniqueId, the BotUniqueId's come through, but not the real PlayerIds.

Any suggestions @xNocken?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.