Topic: [SOLVED] Problems using the Demoplayer to get some stats
Hey all !!!
I'm working on a statistic system based on server-side Demos. But I've some problem to achieve that :
What I want is to implement CDemoPlayer::IListner and retrieve all snapshots and messages data to save some stats in a standalone program : load the demo assed as argument, then play the full demo using the demo player (no graphic render ), then the listener do everything about the stats.
The first problem is that the CDemoplayer has strange public interface : the "Play" function does only seek the demo start (or something like thins), then "SetPos" doesn't accept 1.0 as parametter (because it corresponds to the last seekable point which is not reachable)... And finally, the "NextFrame()" function that *could* work is in private interface (though, a while on this function doesn't even work because the IsPlaying() function return true while the player is in pause mode... (so eof is not detected)
Then... What is the best solution to workaround ?
Finally, for now, I use the while Nextframe() (that is not used in the official client and server). That seems to work, but there are still some strange problems between snapshots (call to listener->OnNewSnapshot()) :
I've got a "error during unpacking of delta, err=-3" and sometime "error during unpacking of delta, err=-2"
...I don't have these errors playing the demo with the gameclient
...And it's... weird... (the problem seems to occur on delta-snapshot, but I can't figure what the
I think I'm wrong somewhere... I was inspiried by CClient to implement my listener, I'll give other details if needed
Thank you !