1 (edited by hl037 2015-01-14 02:42:48)

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 wink ), 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 !

2

Re: [SOLVED] Problems using the Demoplayer to get some stats

Why not use any filebased or sql system?

How to database by FFanta: http://puu.sh/jdPVk/fa37a95ac2.png

3 (edited by hl037 2015-01-01 03:21:51)

Re: [SOLVED] Problems using the Demoplayer to get some stats

Maybe because I use it XD
...but this part is not a problem, actually I want to read the demo to retrieve the game stats and then save it to the db. The db is already ready, but the it is tricky to make the demo player working properly.

The goal is not to have to mod the server and to be able to work on previously recorded games.
Then, the servers participating to the project just have to send their demo to us and we populate the db. It could also become an account system later if this project get to be widely used. But up to now, it is just designed to be a tool for Evil clan to monitor games and players.

4

Re: [SOLVED] Problems using the Demoplayer to get some stats

That sounds intresting to me smile I cant help you since i dont know anything about the demo stuff ._. Will it be opensource? *-*

How to database by FFanta: http://puu.sh/jdPVk/fa37a95ac2.png

5

Re: [SOLVED] Problems using the Demoplayer to get some stats

Yep, it will. But only at release time smile

...But I'm still having problems with the demo player :@

6

Re: [SOLVED] Problems using the Demoplayer to get some stats

I don't really understand your problem, maybe you could show up on IRC somewhen so that your problem can be discussed?

Server: irc.quakenet.org
Channel: #teeworlds

(Warning: People in IRC react very slowly, bring some time as it might take a bit until someone can answer.)

7 (edited by hl037 2015-01-02 03:31:33)

Re: [SOLVED] Problems using the Demoplayer to get some stats

I'm asking smile

My problem is that the behavior of the demoplayer is not the same between the when we read a demo with the client than when I call forever doTicks() with my standalone tool

8

Re: [SOLVED] Problems using the Demoplayer to get some stats

This might be helpful https://github.com/chaosk/baguette
Python implementation of a demo parser (a bit outdated..)

9 (edited by 2015-01-14 02:41:28)

Re: [SOLVED] Problems using the Demoplayer to get some stats

interesting, but I would like to use the official demoPlayer to ease the updates

Problem solved :
In my standalone bin, I've forgotten to initialize the table of types' chunk size, so it generated this anoying error -3...