Moderator: Tech Team
Gilligan wrote:Awesome work!
Just one question.
How do you get to the next page?
Gilligan wrote:Hmm...
I have typed this in:
http://www.conquerclub.com/game_history ... an&Page=22
But I'm still at page 1.
pimphawks70 wrote:I enjoy using plugins and addons but I have no idea how any of it works or anything. In laymans terms could you please explain what this update does?
yeti_c wrote:Out of curiousity - what happens for games with missing logs?
C.
chipv wrote:pimphawks70 wrote:I enjoy using plugins and addons but I have no idea how any of it works or anything. In laymans terms could you please explain what this update does?
Sorry, it was aimed at code writers but does deserve a better explanation.
Scripts and plugins may wish to use data from finished game logs, say printing out the number of players you played against.
To do this you need to look at all of the game logs to see whom you played against.
Before this xml the only way was to ask the server to deliver one page containing one log at a time which puts stress on the server.
This xml puts 200 logs all on the same page thus reducing the amount of pages asked for.
So instead of asking the server for 200 separate pages for game logs, we can now ask for one page which contains all of the data for those logs.
To further increase the speed of downloading these xml files the data is cut down to the bare bones so it's lighter and faster.
This is now the best way for a script or plugin to get finished game data out of the CC database. More info may come later as well, depends on what people ask for.
So really this is for speed and saves stress on the server but also provides a standard interface for code writers to use.
<event timestamp="1168181913">6 eliminated 1 from the game</event>
<event timestamp="1168181913">4, 5, 6 won the game</event>
<event timestamp="1168181913">1 loses 16 points</event>
<event timestamp="1168181913">42535 eliminated 16836 from the game</event>
<event timestamp="1168181913">27346, 9063, 42535 won the game</event>
<event timestamp="1168181913">16836 loses 16 points</event>
cspare wrote:I'm currently developing a plugin that uses this logfile to create a chart that shows a player's score over time.<event timestamp="1168181913">6 eliminated 1 from the game</event>
<event timestamp="1168181913">4, 5, 6 won the game</event>
<event timestamp="1168181913">1 loses 16 points</event>
Processing this kind of log is rather difficult, because player numbers change each game for a given player. So I first have to lookup the relative position in the <players> element for the player I want to compile the stats for.
I would prefer something like this:<event timestamp="1168181913">42535 eliminated 16836 from the game</event>
<event timestamp="1168181913">27346, 9063, 42535 won the game</event>
<event timestamp="1168181913">16836 loses 16 points</event>
This would save alot of time processing the log, it would allow me to directly select the right information I need.
I can't imagine a use for knowing the relative player indexes anyways, but if someone wanted to know, they could still retreive it through the <players> element.
cspare wrote:I was wondering if anybody could give an indication whether my suggestion above will be implemented or not? And if so, when it will be released.
I'd like to start developing some new scripts that rely on the new XML.
cspare wrote:I was wondering if anybody could give an indication whether my suggestion above will be implemented or not? And if so, when it will be released.
I'd like to start developing some new scripts that rely on the new XML.
cspare wrote:Ok, cool. thanks.
I implemented a work around that works pretty good as well. I improved a Xpath query so that I could eliminate 2 for loops, I'm getting a pretty good performance now. Having to download all xml files still stays the main bottleneck though.
I was also wondering if you guys also keep record of a player's actual score over time, or only the events that cause the score to change (so effectively only storing the score delta)? This could help fill in the gaps of the missing game logs.
<game_history>
<user_id>107287</user_id>
<page>1 of 5</page>
<games total="1000">
</games>
</game_history>
<game_history>
<user_id>42178</user_id>
<page>1 of 4</page>
<games total="652">
</games>
</game_history>
Users browsing this forum: No registered users