Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 #11

Open
wants to merge 124 commits into
base: master
Choose a base branch
from
Open

V2 #11

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
a612fd2
feat(exports): uses actorId instead of chIndex
xNocken Jan 7, 2022
683b187
feat(parsing): switches from buffer to uint8array
xNocken Jan 14, 2022
427ff7a
feat(header): changes header and info properties to camel case
xNocken Jan 14, 2022
5e9429a
feat(externalData): adds external data is encrypted property
xNocken Jan 21, 2022
9d52722
feat(players): tracks playerpawn seperate from player
xNocken Jan 21, 2022
50a044a
feat(decompression): begins with official oodle dll
xNocken Feb 4, 2022
ca5d871
Merge branch 'master' into major
xNocken Feb 4, 2022
1742a87
feat(ooz): adds support for windows
xNocken Feb 24, 2022
d20e51c
feat(exports): adds damage cues
xNocken Feb 26, 2022
1bd184a
fix(receiveProperties): fixes not parsing cache when no propeties hav…
xNocken Feb 26, 2022
2b7e128
fix(classNetCache): fixes undeclared classNetCache
xNocken Feb 27, 2022
a00da3f
feat(spectatorInfo): adds spectator info exports
xNocken Mar 1, 2022
7389484
feat(elim-event): adds position to elim events
xNocken Mar 7, 2022
0dd6264
feat(health-set): adds overshield support
xNocken Apr 13, 2022
ae5c09e
feat(vehicles): adds missing vehicles
xNocken Apr 13, 2022
b35279c
feat(network version): adds network version 17
xNocken Apr 22, 2022
c95753e
feat(streaming): seperates metadata and buffer parsing
xNocken Apr 22, 2022
dfa154b
feat(export): exports actor id directly
xNocken Apr 22, 2022
38120ba
feat(exportGroup): speeds up resolve function
xNocken Apr 22, 2022
5312233
chore(netFieldExport): removes debug code
xNocken Apr 22, 2022
a2592a9
feat(parsing): minor speed improvements
xNocken Apr 22, 2022
c8023e9
feat(vehicles): adds workaround for removed vehicle propery
xNocken Apr 25, 2022
8560fa6
feat(netFieldExports): removes useless properties
xNocken Apr 30, 2022
94da5ff
feat(cache-classes): changes to type
xNocken Apr 30, 2022
38eb859
feat(debug): adds actorToPath to debug mode
xNocken May 1, 2022
ec7a3d0
fix(subActor): fixes subactors of static actors
xNocken May 1, 2022
1bc8c10
feat(actorDespawn): fixes despawns before export
xNocken May 12, 2022
f6379c3
feat(streaming): fixes bug with stopParsing function
xNocken May 19, 2022
aa170c4
feat(vehicle): adds vehicleseatcomponent parse level
xNocken Jun 18, 2022
ca7441c
feat(nfe): improves structure of dir and file
xNocken Jun 20, 2022
41dd44b
feat(checkpoints): fixes changed net guid structure
xNocken Jun 20, 2022
5375a4f
feat(events): adds missing events
xNocken Jun 21, 2022
120b4d6
feat(events): adds improved event structure
xNocken Jun 22, 2022
2be866d
chore(docs): begins with documentation
xNocken Jun 23, 2022
69b9d70
feat(player): adds bot unique id
xNocken Jun 23, 2022
f3f3d66
feat(time): adds readDate function
xNocken Jun 23, 2022
fc6ac7f
feat(eslint): adds eslint
xNocken Jun 23, 2022
3594359
chore(tests): fixes tests
xNocken Jun 23, 2022
10b9e87
chore(files): restructures files and remove unused files
xNocken Jun 24, 2022
b6fac3f
feat(nfe): adds storeAsHandleMaxDepth setting
xNocken Jul 2, 2022
b9c6ee0
feat(actor-spawn): adds actor spawn export
xNocken Jul 4, 2022
b73dde7
chore(test): fixes tests
xNocken Jul 4, 2022
2ba6ecc
fix(actor-spawn): removes dormant state on reopen
xNocken Jul 5, 2022
d543331
feat(settings): renames handleEventEmitters setting
xNocken Jul 5, 2022
c5c84fb
feat(nfe): fixes validation
xNocken Jul 5, 2022
aa21af8
feat(events): adds AdditionGFP event
xNocken Jul 5, 2022
f296f1c
feat(nfe): adds custom export name to properties
xNocken Jul 5, 2022
3eed6ee
chore(exports): removes useless properties
xNocken Jul 5, 2022
e5030be
fix(channel-close): fixes missing actor crash
xNocken Jul 5, 2022
105ff14
feat(parser): improves speed
xNocken Jul 9, 2022
829ae7e
feat(nfe): use export name for nfe references
xNocken Jul 9, 2022
7124543
perf(replay): improve performance by using bitshift
vastoa Jul 11, 2022
d788a25
Merge pull request #10 from pxladin/patch-1
xNocken Jul 13, 2022
6f9bce8
Merge branch 'major' of https://github.com/xNocken/replay-reader into…
xNocken Jul 26, 2022
3ab178f
refactor(typescript): adds typescript configurations
xNocken Aug 28, 2022
0971944
refactor(typescript): convertes code to typescript
xNocken Aug 28, 2022
e90699c
refactor(typescript): switches classes to typecript
xNocken Aug 28, 2022
babd9cf
refactor(enums): changes enums to typescript
xNocken Aug 28, 2022
4cd43ef
refactor(exports): switches to typescript
xNocken Aug 28, 2022
d789b3f
refactor(typescript): enables noImplicitAny
xNocken Aug 28, 2022
ade8cfa
fix(uint): fixes bug in read unsigned bits
xNocken Aug 28, 2022
0f1c543
chore(deps): adds prepare script
xNocken Aug 28, 2022
40043f3
chore(deps): fixes prepare script
xNocken Aug 28, 2022
438c633
feat(logger): adds logger
xNocken Aug 29, 2022
3b4bf5a
refactor(result): renames info to meta
xNocken Aug 29, 2022
8d80f48
feat(versions): adds version checks
xNocken Aug 29, 2022
11e73e0
feat(streaming): puts downloads into extra thread
xNocken Aug 29, 2022
76dfa5c
chore(deps): adds missing files to package-json
xNocken Aug 30, 2022
71bd624
feat(types): removes useless generics
xNocken Aug 30, 2022
54fc68e
chore(types): improves adds generics
xNocken Sep 5, 2022
ee45b83
chore(paths): removes path aliases
xNocken Sep 5, 2022
a162078
fix(update): adds support for enw 27 and nw 18
xNocken Sep 19, 2022
d1622a2
Merge branch 'master' into major
xNocken Sep 19, 2022
b9a737f
feat(header): adds missing properties
xNocken Sep 24, 2022
b7b20c8
fix(parsing): fixes some bugs
xNocken Sep 24, 2022
4a39e3e
fix(parsing): fixes replays larger than 256mb
xNocken Sep 24, 2022
429d356
chore(typings): puts events into seperate file
xNocken Sep 24, 2022
a866d36
feat(finished): adds on finished event
xNocken Sep 24, 2022
56af992
chore(ts): changes config to compile all ts files
xNocken Sep 24, 2022
3f1e698
fix(nfe): adds missing storeAsHandle option
xNocken Sep 26, 2022
a501ddd
fix(nfe): adds missing storeAsHandle option
xNocken Sep 26, 2022
b619a3d
fix(nfe): adds missing nfe options
xNocken Sep 27, 2022
a1824ee
Merge branch 'master' into major
xNocken Sep 29, 2022
59147ed
fix(parsing): fixes some general bugs
xNocken Sep 29, 2022
2a5732e
fix(errors): improves error handling
xNocken Sep 29, 2022
0f01072
fix(bc): fixes backwards compatibility issues
xNocken Sep 29, 2022
5e216b7
feat(classes/enums): adds c and e to netFieldParser
xNocken Sep 30, 2022
6de3393
feat(export): adds export name to nfe internal
xNocken Sep 30, 2022
48fe35f
chore(nfes): adds dynamic nfe typings
xNocken Sep 30, 2022
85bc2aa
chore(types): moves nfe into own file
xNocken Sep 30, 2022
841b4a0
feat(nfe): adds version based overrides
xNocken Sep 30, 2022
274d31f
chore(nfe): fixes typing error
xNocken Sep 30, 2022
54db485
fix(nfe): fixes nfe default config
xNocken Oct 6, 2022
4621506
fix(events): adds once typings
xNocken Nov 17, 2022
0972719
fix(checkpoints): fixes checkpoint parsing
xNocken Nov 17, 2022
47f004d
fix(events): fixes safezone and position events
xNocken Nov 17, 2022
f14d929
feat(playerbuilds): adds type, location and rotation
xNocken Nov 17, 2022
b1d26b9
fix(typings): fixes some typing bugs
xNocken Nov 17, 2022
00aa48b
fix(parseUnkownHandles): adds functionality
xNocken Nov 20, 2022
6b8ae41
fix(nfe-types): adds ignore to config types
xNocken Nov 20, 2022
ef2c88f
feat(player): adds damage dealt property
xNocken Nov 20, 2022
bcf06d6
fix(env-30): adds support for new network version
xNocken Dec 6, 2022
d4370ea
fix(static): adds support for new ids
xNocken Dec 7, 2022
8b03075
fix(bugs): fixes some bugs
xNocken Dec 20, 2022
6584202
feat(functions): adds support for functions without data
xNocken Dec 21, 2022
874700e
fix(damage-cue): adds damage to right player
xNocken Jan 23, 2023
a32de55
feat(player): adds encrypted player health
xNocken Jan 26, 2023
85f6d3a
Merge branch 'major' of https://github.com/xNocken/replay-reader into…
xNocken Jan 26, 2023
bfb0dd8
feat(events): adds must be parsed events
xNocken Jan 29, 2023
af283b0
fix(debugobject): fixes double size
xNocken Jan 30, 2023
a52b871
feat(custom-versions): starts with custom versions
xNocken Feb 13, 2023
fcc7051
fix(test): fixes tests
xNocken Feb 13, 2023
5e95463
fix(test): removes macos tests
xNocken Feb 13, 2023
606360b
feat(versions): uses enums for version checks
xNocken Mar 14, 2023
89d8343
fix(env-31): adds support for env 31
xNocken Mar 14, 2023
0cb2b07
Merge branch 'major' into majorr/custom-versions
xNocken Mar 14, 2023
42a4c3c
fix(net-delta): uses the correct version
xNocken Jun 17, 2023
6f88bfe
fix: tests
xNocken Jun 17, 2023
708af34
Merge pull request #15 from xNocken/majorr/custom-versions
xNocken Jun 17, 2023
3069ead
fix: fixes wrong version checks
xNocken Jun 17, 2023
736827e
fix(version-manager): fixes network version guid
xNocken Jun 17, 2023
434c7e0
fix: removes wrong return
xNocken Jun 18, 2023
f70030d
chore: add required folders to files thingy
xNocken Aug 25, 2024
f4f54b1
fix: support env CustomExports
xNocken Nov 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
38 changes: 38 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
env: {
es2020: true,
browser: true,
es6: true,
node: true,
},
plugins: ['node', 'promise'],
extends: ['eslint:recommended', 'prettier'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
rules: {
'no-console': 0,
'no-continue': 0,
'no-loop-func': 0,
'no-constant-condition': 0,
'no-unused-vars': 0,
'no-async-promise-executor': 0,
'semi': 2,
'comma-dangle': ['error', 'always-multiline'],
'max-len': [
'error',
{
code: 120,
ignoreComments: true,
ignoreStrings: true,
ignoreUrls: true,
ignoreTemplateLiterals: true,
},
],
},
};
58 changes: 29 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Tests
'on':
push:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['14', '15', '16']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: yarn and test
run: |
yarn
yarn test
name: Tests
'on':
push:
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['16', '17', '18']
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}

- name: yarn and test
run: |
yarn
yarn test
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules/
log.log
*.replay
replay.json
netfieldexports.txt
notReadingGroups.txt
netGuidToPathName.txt
debug-readNFE.txt
debug-notReadNFE.txt
debug-netGuidToPathName.txt
dist
4 changes: 4 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
singleQuote: true,
trailingComma: 'all',
};
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/test.js"
"program": "${workspaceFolder}/dist/test.js",
"preLaunchTask": "build"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
11 changes: 11 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "yarn tsc",
"problemMatcher": ["$tsc"]
}
]
}
7 changes: 0 additions & 7 deletions Classes/ActorGuid.js

This file was deleted.

5 changes: 5 additions & 0 deletions Classes/ActorGuid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { NetworkGUID } from "./NetworkGUID";

export class ActorGuid extends NetworkGUID {

}
97 changes: 56 additions & 41 deletions Classes/DebugObject.js → Classes/DebugObject.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
const Replay = require("../src/Classes/Replay");
const FGameplayTag = require("./FGameplayTag");
const FGameplayTagContainer = require("./FGameplayTagContainer");
const FName = require("./FName");
const FRepMovement = require("./FRepMovement");
const ItemDefinition = require("./ItemDefinition");

class DebugObject {
/**
* @type {Buffer}
*/
data;
name;

constructor(data, exportt, bits, header) {
if (!data || !exportt) {
return;
}

this.data = data;
this.name = exportt.name;
this.size = bits;
this.header = header;
}

/**
* @param {Replay} reader
*/
serialize(reader, globalData, config) {
import { CustomClass, Header } from '../types/lib';
import GlobalData from '../src/Classes/GlobalData';
import { NetGuidCache } from '../src/Classes/NetGuidCache';
import Replay from "../src/Classes/Replay";
import { FGameplayTag } from "./FGameplayTag";
import { FGameplayTagContainer } from "./FGameplayTagContainer";
import { FName } from "./FName";
import { FRepMovement } from "./FRepMovement";
import { ItemDefinition } from "./ItemDefinition";

export class DebugObject {
data: Buffer;
name: string;
size: number;
header: Header;
globalData: GlobalData;
config: unknown;
cache: NetGuidCache;

serialize(reader: Replay, globalData: GlobalData, config: unknown) {
this.size = reader.getBitsLeft();
this.data = reader.readBits(this.size);
this.data = Buffer.from(reader.readBits(this.size));
this.globalData = globalData;
this.config = config;
this.header = reader.header;
}

resolve(cache) {
resolve(cache: NetGuidCache) {
this.cache = cache;
}

Expand Down Expand Up @@ -71,12 +62,12 @@ class DebugObject {
return null;
}

return this.data.toString('utf-8', 4, length);
return this.data.toString('utf-8', 4, length + 3);
}

getValueAsClass(Class) {
getValueAsClass(Class: new () => CustomClass) {
const container = new Class();
const replay = new Replay(this.data, this.size);
const replay = new Replay(this.data, this.globalData, this.size);

replay.header = this.header;

Expand All @@ -87,14 +78,14 @@ class DebugObject {
}

if (this.cache && container.resolve) {
container.resolve(this.cache);
container.resolve(this.cache, this.globalData);
}

return container;
}

getValueAsFVector() {
const replay = new Replay(this.data, this.size);
getValueAsFVector3d() {
const replay = new Replay(this.data, this.globalData, this.size);

replay.header = this.header;

Expand All @@ -107,8 +98,24 @@ class DebugObject {
return vector;
}

getValueAsFVector3f() {
const replay = new Replay(this.data, this.globalData, this.size);

replay.header = this.header;

const vector = replay.readVector3f();

if (replay.isError) {
return null;
}

return vector;
}

getValueAsIntPacked() {
const replay = new Replay(this.data, this.size);
const replay = new Replay(this.data, this.globalData, this.size);

replay.header = this.header;

const înt = replay.readIntPacked();

Expand All @@ -119,9 +126,18 @@ class DebugObject {
return înt;
}

getValueAsDouble() {
if (this.data.length < 8) {
return null;
}

return this.data.readDoubleLE();
}

toJSON() {
return {
size: this.size,
data: Array.from(this.data),
float: this.getValueAsFloat(),
int: this.getValueAsInt(),
boolean: this.getValueAsBoolean(),
Expand All @@ -131,10 +147,9 @@ class DebugObject {
itemDefinition: this.getValueAsClass(ItemDefinition),
fRepMovement: this.getValueAsClass(FRepMovement),
fName: this.getValueAsClass(FName),
fVector: this.getValueAsFVector(),
fVector: this.getValueAsFVector3d(),
intPacked: this.getValueAsIntPacked(),
double: this.getValueAsDouble(),
};
}
}

module.exports = DebugObject;
10 changes: 0 additions & 10 deletions Classes/FAthenaPawnReplayData.js

This file was deleted.

21 changes: 21 additions & 0 deletions Classes/FAthenaPawnReplayData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type GlobalData from '../src/Classes/GlobalData';
import type Replay from '../src/Classes/Replay';
import type { CustomClass } from '../types/lib';

export class FAthenaPawnReplayData implements CustomClass {
health: number;
shield: number;

serialize(reader: Replay, globalData: GlobalData) {
const length = reader.readUInt32();

if (!length) {
return;
}

const encryptedPlayerData = reader.decryptBuffer(length, globalData.playerStateEncryptionKey);

this.health = encryptedPlayerData.readFloat32();
this.shield = encryptedPlayerData.readFloat32();
}
}
13 changes: 0 additions & 13 deletions Classes/FDateTime.js

This file was deleted.

13 changes: 13 additions & 0 deletions Classes/FDateTime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Replay from '../src/Classes/Replay';

export class FDateTime {
time: Date;

serialize(reader: Replay) {
this.time = reader.readDate();
}

toJSON() {
return this.time.toISOString();
}
}
24 changes: 0 additions & 24 deletions Classes/FGameplayTag.js

This file was deleted.

Loading
Loading