Game History XML For Plugins and Script Writers
Posted: 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.
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.