saul / demofile

Node.js library for parsing Counter-Strike: Global Offensive demo files
https://demofile.dev
MIT License
481 stars 53 forks source link

Self recorded demos rising unexpected error #138

Closed Henroks closed 4 years ago

Henroks commented 4 years ago

Describe the bug Demos recorded by the player (using record test.dem) rise error cannot delete an entity already marked for deletion. Tested only with Valve's Match Making

Code to reproduce

let demo = new DemoFile();

demo.parse(demoBuffer); //Demo recorded by the player

demo.on("end", (e) => {
    console.log(e);
});

Stack

AssertionError [ERR_ASSERTION]: cannot delete an entity already marked for deletion
    at Entities._removeEntity (dist\entities.js:323:13)
    at Entities._handlePacketEntities (dist\entities.js:411:26)
    at DemoFile.<anonymous> (dist\entities.js:97:49)
    at DemoFile.emit (events.js:210:5)
    at DemoFile._handleDemoPacket (dist\demo.js:187:14)
    at DemoFile._parseRecurse (dist\demo.js:240:16)
    at processImmediate (internal/timers.js:439:21)
saul commented 4 years ago

Dupe of #72. See an in progress PR here which fixes it: https://github.com/saul/demofile/pull/100

The problem is that supporting in-eye demos results in a significant perf drop. This is because more information needs to be held on to to support them.

VitorCaleffi commented 4 years ago

Cool. I saw it before, but didn't thought these 2 problems were related. Does demoinfogo also have this problem? Is there a way I could help?

saul commented 4 years ago

Yes demoinfogo has the same issue - I’ve yet to see a library that does it properly.