(08 Jan 11, 12:47AM)tempest Wrote:(07 Jan 11, 11:06PM)Fiz Wrote: I think the only reason it isn't done yet is the lack of documentation or examples on how that could be done and the fact that its in binary format.
A demo file is just a gzipped stream of packets, with a header at the start. readdemo() reads the data packet by packet and forwards it through enet to parsemessages() in clients2c.cpp, where the information is read from the packets using getint() and friends and is then processed.
Now you could just get in at readdemo(), but instead of passing the stuff through enet, you'd just take it apart right there.
Not easy , but possible - read the code :P
Ok, well I will just state this plainly. C/C++ is my kryptonite :P I can read the code most of the time but its pretty hard to comprehend on a level that allows me to convert it to the languages I use. Since it was put in my head I did start down the road of looking for the code in the source to try and convert to PHP(my fav language) to see if I can get some usefull data from the demos. I believe they should be able to be parsed relatively fast. Now that I have the file (thanks to you :)) It will be easier to figure out.... maybe...
I did have some concerns about it specially after comparing the direct output of the console with the log files. A few things I think might be useful are missing in the logfiles but can be gotten if the console is grabbed. I noticed in the log files team switching is not logged so it is hard to see when someone switches from 1 team to another. Useful for realtime stats and maybe some other ladder based "awards". The other is who votes on what also possibly useful for ladder "awards' but more importantly to see if there is any voting abuse and who is all involved. Neither are available in the logs even with the highest logging setting. I am curious to see if it is available in the demos.
Edit: with highest logging who voted for what is available sorry.
Also I didn't mean "lack of documentation" as in a failure on the devs part but if any one has done it before its not documented. I do seem to remember someone having a system to parse demos and look for cheaters but I couldn't find any code on the net that showed how that might be done.