demostf / parser Goto Github PK
View Code? Open in Web Editor NEWParsing of tf2 demo files
Parsing of tf2 demo files
First of all, thank you for this piece of software!
I tried to parse a big pile of POV demos (3575 files) recorded over many years using parse_demo
binary but many of them failed. Here are the errors:
Error: A read game event doesn't contain the expected values, expected type Byte for kills_rank event, got type Long
Error: A read game event doesn't contain the expected values, expected type Byte for kills_rank event, got type Short
Error: Malformed utf8 while reading string
caused by: invalid utf-8 sequence of 1 bytes from index 0
Error: A read game event doesn't contain the expected values, expected type Long for weapon_def_index event, got type Short
That's it so the total number of different errors is surprisingly low :)
And it's also not unlikely that there's been some bit rot.
The demo file is rather large and I couldn't minify it, but I've attached it anyways.
The crash is
parser/src/demo/message/stringtable.rs
Line 57 in e2a631c
compressed_size
is less than 4, it will either panic on wraparound with debug assertions enabled, or tries to allocate a huge amount of memory in release mode, and aborts. (This could probably be used cause a denial of service by trying to allocate large buffers).
The fix here IMO is to do a checked subtraction there, but also not to trust the value we got from the file for the compressed size. That might be a change in bitbuffer
too, which should have tests that trying to read huge amounts of data doesn't crash, and instead returns an error, which it doesn't seem to be doing.
It would be nice to fetch out position, velocity or even projectiles (rockets/stickies/pipes).
Working on integrating this with Rocket Jump/Sticky Jump STV demos. Chat logs has helped heaps but if we can get more data that would be awesome
In the README.md, it says to pass the detailed_summary
argument to print more information.
However it doesn't work because in main.rs
the code looks for the string detailed_summaries
instead:
let detailed_summaries = args.contains(&std::string::String::from("detailed_summaries"));
Someone has once asked me if they could confirm in any way if someone possibly had something illegal on their objector, however I wasn't able to help. And in general it'd be interesting to see what people have at any given match on any of their decal applicable items.
Hello, I have been working with this program for quite a bit, modifying it to parse demo files in real time to collect data for machine learning algorithms.
I noticed that when created a DemoParser object with the new_all_with_analyzer
function, the team for each user is listed as "Other". However, creating a DemoParser object using the other function new_all
properly reports team for each player. I've been trying to fix it but had no luck, fixing this would really help me since I wouldn't have to waste time parsing the demo file twice.
Hi @icewind1991,
First of all, this is an awesome tool and I've used it to ingest chat logs from about 10 years worth of the jump communities STVs! This has allowed us to regain data lost to time (like the old World Records, players, rankings etc) โญ
(from Tempus Jump Network)
It would be awesome for my archiving and enhancement efforts if we could get the following out of STVs (feel free to say no - I'd also be happy to sponsor this project, but there's no button on GitHub ATM)
thirdperson
etc.I'm not sure if a lot of this is possible, but its a wide wishlist, for discussion.
I look forward to hearing from you soon :)
Here's an example STV demo that fails:
auto-20140701-233440-jump_propel_fixed_v3.zip
I was able to extract chat messages, by just ignoring the failure in the code, but a proper fix would be better.
Here's the commit that allowed me to continue: Hona@852d0aa
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.