Game History XML For Plugins and Script Writers

Archival storage to keep things organized and uncluttered. Can't find what you need? Search for old topics here.

Moderators: Global Moderators, Tech Team

Forum rules
Please read the Community Guidelines before posting.

Game History XML For Plugins and Script Writers

Postby chipv on Tue Sep 23, 2008 5:19 pm

lackattack has done terrific work in producing an interface for script writers to access the finished game logs of players without resorting to hideous amounts of AJAX calls. There is a new dynamic XML for each player (this is used in Map Rank GL) which produces an entire game history for the player.

It is a set of XML files divided into pages of 200 games each. (You'll have to manage this carefully).

Call it by using the url

http://www.conquerclub.com/game_history.php?username=

or

http://www.conquerclub.com/game_history.php?user_id=

That will get you the first page. For subsequent pages add

&page=2 for page 2 etc

Brief description of what is available:

<user_id>42535</user_id> : User Id of subject invoked in the calling URL
<page>1 of 4</page> - this xml page number and total number of pages
<games total="702"> - total number of games

<game_number>160306</game_number>
<tournament/>
<private>No</private>
<speed_game>No</speed_game>
<map>British Isles</map>
<game_type>Triples</game_type>
<play_order>Freestyle</play_order>
<bonus_cards>Escalating</bonus_cards>
<fortifications>Unlimited</fortifications>
<war_fog>No</war_fog>

Self explanatory descriptors for the game type etc.

<players>
<player state="Lost">16836</player>
<player state="Lost">21000</player>
<player state="Lost">24215</player>
<player state="Won">27346</player>
<player state="Won">9063</player>
<player state="Won">42535</player>
</players>

List of player User Ids together with whether they won or lost.

<events>
<event timestamp="1168099246">4 eliminated 2 from the game</event>
<event timestamp="1168181834">6 eliminated 3 from the game</event>
<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">2 loses 16 points</event>
<event timestamp="1168181913">3 loses 16 points</event>
<event timestamp="1168181913">4 gains 16 points</event>
<event timestamp="1168181913">5 gains 16 points</event>
<event timestamp="1168181913">6 gains 16 points</event>
</events>

Cut down elimination summary including timestamps - note this is in seconds not milliseconds since 1 January 1970
The numbers in the elimination summary correspond to the order of the <player> list starting its index at 1.

if you need any help in trying to write a script to use this, feel free to ask any questions.

Note that this is a work in progress and more is to come.

Once again, awesome work from lackattack, thanks ever so much for this.
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: Game History XML For Plugins and Script Writers

Postby InkL0sed on Tue Sep 23, 2008 6:15 pm

This seems like an awesome addition. Cool.
User avatar
Lieutenant InkL0sed
 
Posts: 2377
Joined: Sat Jun 23, 2007 4:06 pm
Location: underwater
Medals: 23
Standard Achievement (3) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (1) Terminator Achievement (2)
Assassin Achievement (1) Freestyle Achievement (2) Fog of War Achievement (2) Trench Warfare Achievement (1) Speed Achievement (2)
Teammate Achievement (2) Cross-Map Achievement (3)

Re: Game History XML For Plugins and Script Writers

Postby Gilligan on Tue Sep 23, 2008 6:50 pm

Awesome work!

Just one question.

How do you get to the next page?
Image
User avatar
Major Gilligan
Cartography Assistant
Cartography Assistant
 
Posts: 12235
Joined: Thu May 11, 2006 4:59 pm
Location: Providence, RI
Medals: 190
Monthly Leader Bronze (1) Standard Achievement (4) Doubles Achievement (3) Triples Achievement (3) Quadruples Achievement (3)
Terminator Achievement (3) Assassin Achievement (3) Manual Troops Achievement (3) Freestyle Achievement (4) Polymorphic Achievement (2)
Nuclear Spoils Achievement (3) Fog of War Achievement (4) Trench Warfare Achievement (3) Speed Achievement (4) Teammate Achievement (2)
Random Map Achievement (3) Cross-Map Achievement (4) Beta Map Achievement (2) Battle Royale Achievement (3) Bot Achievement (2)
Ratings Achievement (4) Tournament Achievement (30) General Achievement (29) Clan Achievement (7) Challenge Achievement (3)

Re: Game History XML For Plugins and Script Writers

Postby chipv on Tue Sep 23, 2008 6:51 pm

Gilligan wrote:Awesome work!

Just one question.

How do you get to the next page?


Add &page=2 to the url etc etc

Good question, I have modified the head post.
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: Game History XML For Plugins and Script Writers

Postby Gilligan on Tue Sep 23, 2008 6:56 pm

Hmm...

I have typed this in:

http://www.conquerclub.com/game_history ... an&Page=22

But I'm still at page 1.
Image
User avatar
Major Gilligan
Cartography Assistant
Cartography Assistant
 
Posts: 12235
Joined: Thu May 11, 2006 4:59 pm
Location: Providence, RI
Medals: 190
Monthly Leader Bronze (1) Standard Achievement (4) Doubles Achievement (3) Triples Achievement (3) Quadruples Achievement (3)
Terminator Achievement (3) Assassin Achievement (3) Manual Troops Achievement (3) Freestyle Achievement (4) Polymorphic Achievement (2)
Nuclear Spoils Achievement (3) Fog of War Achievement (4) Trench Warfare Achievement (3) Speed Achievement (4) Teammate Achievement (2)
Random Map Achievement (3) Cross-Map Achievement (4) Beta Map Achievement (2) Battle Royale Achievement (3) Bot Achievement (2)
Ratings Achievement (4) Tournament Achievement (30) General Achievement (29) Clan Achievement (7) Challenge Achievement (3)

Re: Game History XML For Plugins and Script Writers

Postby chipv on Tue Sep 23, 2008 7:02 pm

Gilligan wrote:Hmm...

I have typed this in:

http://www.conquerclub.com/game_history ... an&Page=22

But I'm still at page 1.


Case sensitive - try &page=22 that works.

This is worth correcting, though, thanks.
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: Game History XML For Plugins and Script Writers

Postby pimphawks70 on Tue Sep 23, 2008 7:28 pm

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?
Image
User avatar
Brigadier pimphawks70
 
Posts: 1106
Joined: Fri Aug 31, 2007 10:21 am
Medals: 77
Standard Achievement (4) Doubles Achievement (3) Triples Achievement (4) Quadruples Achievement (4) Terminator Achievement (3)
Assassin Achievement (3) Manual Troops Achievement (4) Freestyle Achievement (4) Nuclear Spoils Achievement (3) Fog of War Achievement (4)
Trench Warfare Achievement (1) Speed Achievement (4) Teammate Achievement (3) Random Map Achievement (1) Cross-Map Achievement (3)
Ratings Achievement (3) Tournament Achievement (21) General Achievement (3) Clan Achievement (1) General Contribution (1)

Re: Game History XML For Plugins and Script Writers

Postby chipv on Tue Sep 23, 2008 7:41 pm

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.
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: Game History XML For Plugins and Script Writers

Postby whitestazn88 on Tue Sep 23, 2008 8:47 pm

i don't know what this is... but i looked at my page very briefly
Sergeant 1st Class whitestazn88
 
Posts: 3127
Joined: Mon Feb 05, 2007 2:59 pm
Location: behind you
Medals: 28
Standard Achievement (4) Doubles Achievement (2) Triples Achievement (1) Quadruples Achievement (1) Terminator Achievement (1)
Freestyle Achievement (2) Nuclear Spoils Achievement (1) Fog of War Achievement (2) Speed Achievement (1) Teammate Achievement (2)
Random Map Achievement (2) Cross-Map Achievement (3) Ratings Achievement (3) General Achievement (2) Clan Achievement (1)

Re: Game History XML For Plugins and Script Writers

Postby yeti_c on Wed Sep 24, 2008 3:14 am

Out of curiousity - what happens for games with missing logs?

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Re: Game History XML For Plugins and Script Writers

Postby chipv on Wed Sep 24, 2008 3:43 am

yeti_c wrote:Out of curiousity - what happens for games with missing logs?

C.


<events></events>

The events tag is blank.
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: Game History XML For Plugins and Script Writers

Postby pimphawks70 on Wed Sep 24, 2008 8:47 am

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.

thank you very much
Image
User avatar
Brigadier pimphawks70
 
Posts: 1106
Joined: Fri Aug 31, 2007 10:21 am
Medals: 77
Standard Achievement (4) Doubles Achievement (3) Triples Achievement (4) Quadruples Achievement (4) Terminator Achievement (3)
Assassin Achievement (3) Manual Troops Achievement (4) Freestyle Achievement (4) Nuclear Spoils Achievement (3) Fog of War Achievement (4)
Trench Warfare Achievement (1) Speed Achievement (4) Teammate Achievement (3) Random Map Achievement (1) Cross-Map Achievement (3)
Ratings Achievement (3) Tournament Achievement (21) General Achievement (3) Clan Achievement (1) General Contribution (1)

Re: Game History XML For Plugins and Script Writers

Postby cspare on Sat Sep 27, 2008 3:22 am

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.
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm
Medals: 8
Standard Achievement (1) Doubles Achievement (1) General Contribution (6)

Re: Game History XML For Plugins and Script Writers

Postby timme10 on Tue Sep 30, 2008 5:48 am

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.


Yeah I agree, it would be a lot easier to select the right information. Good suggestion
Sergeant 1st Class timme10
 
Posts: 16
Joined: Mon Jul 09, 2007 5:32 am
Location: Australia
Medals: 1
Standard Achievement (1)

Re: Game History XML For Plugins and Script Writers

Postby cspare on Sun Oct 05, 2008 6:28 am

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.
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm
Medals: 8
Standard Achievement (1) Doubles Achievement (1) General Contribution (6)

Next

Return to Tool Archives

Who is online

Users browsing this forum: No registered users and 2 guests

Login