saul / demofile

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

history[index] is undefined in stringtables.js #43

Closed thorebear closed 6 years ago

thorebear commented 6 years ago

The following error happens in some newer demos and crashes the parsing: TypeError: Cannot read property 'slice' of undefined at _.reduce (..../demofile/stringtables.js:193:38) One example of such demo is the Train game in the following demo: https://www.hltv.org/matches/2317946/fnatic-vs-faze-ecs-season-4-finals

saul commented 6 years ago

Can you reproduce this consistently? I assume that these demos play fine in the in-game client?

The only reason I ask is because these demos also fail to be parsed by the official demoinfo-go client.

thorebear commented 6 years ago

Yes, the error is consistent. I have encountered this error in 3 different demos during the last couple of days (but I have parsed more successfully.).

I have parsed the demo (linked above) successfully using demoinfogo (the linux port from https://github.com/kaimallea/demoinfogo-linux).

I do not have any opportunity to test the demo with the in-game client right now.

thorebear commented 6 years ago

Okay, there is also something that the demoinfogo cannot parse, but it does not crash and parse the rest of the demo just fine.

---- CNETMsg_Tick (12 bytes) -----------------
tick: 195071
host_computationtime: 3702
host_computationtime_std_deviation: 707
host_framestarttime_std_deviation: 1
UpdateStringTable:3(soundprecache):3:
 2212, +player\vo\seal\affirmative01.wav, 31, åÂÈÒÞ¾ØÞÆÖÜØÞÂÈ`n\îÂì 
 2213, ‰…±­…¹qɅ‘¥½}±•Ñ͝½Áܸ܅Ùü, 0, (null) 
 0, , 0, (null) 
UpdateStringTable:16(Scenes):3:
 39, scenes/seal/affirmative01.vcd, 0, (null) 
 40, radio_locknload07.vcd, 0, (null) 
 41, balkan/radio_letsgo07.vcd, 0, (null)
saul commented 6 years ago

It does in debug builds. I’ve messaged one of the CSGO developers to see what the format change is.

saul commented 6 years ago

Also when I said consistent I meant do all demos after the update suffer from this bug? Thanks

thorebear commented 6 years ago

Okay. No, not all demos suffers from this bug - and the 3 demos where I have encountered this bug, there is no pattern in where the bug happens (all official matches with demos from HLTV.org, but in one case the error happens before any rounds starts, and in another case it happens during the second half).

saul commented 6 years ago

Fixed in 0.4.11, thanks for the report