Demo Parser - Printable Version +- Xonotic Forums (https://forums.xonotic.org) +-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10) +--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12) +--- Thread: Demo Parser (/showthread.php?tid=5485) |
Demo Parser - BuddyFriendGuy - 05-16-2015 I decided to start a new thread since this has different focus from my original thread. What I'm trying to do here?
What demo parsers are out there? I was able to find two existing parsers:
Any other recommendation? Is there a format documentation (beside the source code)? If I really have to invent the wheel, is there a document? Obviously if everything fails I'll go read the Darkplaces code, but I'm hoping somebody has figured that out so I don't have to. RE: Demo Parser - TimePath - 05-16-2015 Here's one I prepared earlier: https://github.com/TimePath/xonotic-demo-parser It's pending a rewrite and q1vm integration (needed to parse messages the game has control over). RE: Demo Parser - machine! - 05-16-2015 (05-16-2015, 01:32 AM)BuddyFriendGuy Wrote: What demo parsers are out there? You might not still want to use it but just for the record: Code: $ cabal sandbox init RE: Demo Parser - BuddyFriendGuy - 05-17-2015 (05-16-2015, 06:40 AM)TimePath Wrote: Here's one I prepared earlier: https://github.com/TimePath/xonotic-demo-parser Thanks so much, @TimePath. Brilliant work! I was able to run the parser and get the messages printed out, although it chocked at some sv_bad ("case unknown" in your DemoParser.scala). I tried several demo files and all of them have sv_bad. May I know whether there's a document on those SVC.* types? Also, how are you using this utilities? For those of you who are also interested, I installed gradle to build TimePath's jcompile as the dependencies (api.jar and q1vm.jar are needed), and then installed scala, kotlin, Apache commons.io for the runtime libs: (the following is for Arch Linux 64 environment) Code: $ java -cp build/libs/xonotic-demo-parser-1.0-SNAPSHOT.jar:../jcompile/backends/q1vm/build/libs/q1vm-0.1-SNAPSHOT.jar:../jcompile/api/build/libs/api-0.1-SNAPSHOT.jar:/usr/share/scala/lib/*:/usr/share/java/commons-io/*:/usr/share/kotlin/lib/* com.timepath.xonotic.DemoParser ~/.xonotic/data/demos/2015-05-16_03-21_afterslime.dem (05-16-2015, 10:38 AM)machine! Wrote: You might not still want to use it but just for the record: Thanks, @machine! I'm glad you told me this -- otherwise I would have really brought my machine into the cabal hell! To build it, I had to relax some version requirement (base<4.8) with "--allow-newer" during dependencies installation, and manually changed "transformer<0.4" to "<0.5" to build. At the end, the code still has some error. I think I'll wait for Sl@ava to fix those before I dig deeper. RE: Demo Parser - TimePath - 05-17-2015 @BuddyFriendGuy: There are a few currently unhandled messages: (https://github.com/TimePath/xonotic-demo-parser/blob/master/src/main/scala/com/timepath/xonotic/DemoParser.scala#L405), as soon as it sees one of them it just exits with sv_bad. I can't really do much about that until all messages are handled, as the length of each message is not sent. I wrote all of this by looking at the darkplaces source. If there's documentation, I haven't found it. The original use for this utility was to try and discover why some servers were crashing on malicious player input using server demos, but we could never get a demo file. Congratulations on setting all that up without further instructions btw , I usually just run things from my IDE. I should just add a `./gradlew run` task RE: Demo Parser - BuddyFriendGuy - 05-19-2015 Thanks a lot, @TimePath. Your code was well written -- that's why I was able to put things together. I guess I'll just have to go read DarkPlaces code. |