AW tools index

greenbird's AW Tools manual page for developers

Introduction

This page is for those who wish to code their own extra tools while using brownie/AWTools running on my server. If you want to run the whole proxy yourself on your server see the AWTools-install-guide.

Getting the data

All interesting alliance-private data is available for download from http://aw.lsmod.de/alli/af/ (replace af with your AWTools user name). It is protected the same way as the AWTools itself, so you can authenticate with either user+pass or with a cookie you got from brownie. Data is updated every six hours (check timestamps in the directory)
wget --http-user af --http-password xsecretx http://aw.lsmod.de/alli/af/fleets.csv

Interpreting the data

This is actually a tricky part for the format of some files+formats I kept for legacy reasons

relation.csv

As the name suggests, this contains relations for players you know (relations are coded as integer: legend) . The format was changed at GE11, so the following is now obsolete But what the name does not tell, the most interesting bit of information in here are certainly the races and sciences from IRs and production values for own players.
Format is:
nameTABrelationTABallianceTABcomment
The comment has \n for end-of-line characters, and \t for tab. Thus a sample comment would look like this:
automagic:
production:667,615,324,HoR2,97,40332,15012 
race:-1,+3,-1,-4,-1,+1,+3 
science:1174107736,26,27,26,24,22,25,97,1174385191.19557
login:7:1168152622:120:61 login:28:1168250809:240:61
meaning of the values is as follows:
production:prodPP(per hour),prodScience,prodCulture,artifact,tradebonus,A$,PP
race:bio,sci,cul,prod,speed,att,def
science:timeOfLastIRUpdate,Bio,Eco,Ene,Math,Phys,Soc,ETC(UNIX timestap with time to culture)
login(may appear several times):loginnum(as seen in AW Logins value):loginUNIXtimestamp:idleTime:inaccuracy (61 (seconds) means, the login might have happened up to 1 minute earlier than given in timestamp)

planetsplanning.csv

This one is very similar to relations.csv described above. Format is given in it's header line
The special things about this: sysID#0 is actually displayed as HTML above a system. It is automagically added when the system-info tool detects a link from an alliances forum in a referer.
The other special looks like
took:2007-03-15 s:2007-03-15 l:2007-03-15
and is automagically added with fleet updates. l=launch, s=siege, took=taken a planet. Each is followed by an ISOdate string (yyyy-mm-dd). I could make it date+time if needed.

fleets.csv

This one is a simple CSV file as it comes directly out of my SQL-DB. Format is
fleetID alli(the one who has seen it) status sidpid ownerid ETA firstseen lastseen trn cls ds cs bs cv xcv iscurrent info
With info being the only free-form field and it is not used by the tools itself.
Status can have values 0..3 which mean: The sidpid value needs special mentioning. It is the combination of systemId and planetID and stored as a single value: pid+13*sid
Fleets that have iscurrent=0 are only more part of history (e.g arrived after a move or changed size at a battle). Fleets expire after 36h after "lastseen" time.

The same data is available live from brownie at http://aw.lsmod.de/cgi-bin/cdinfo?p=29. Please do not request it more often than once per minute. you can get more live data as above:

   } elsif($p==2) {
      dumpwholetable("cdcv");
   } elsif($p==3) {
      dumpwholetable("cdlive");
   } elsif($p==15) {
      dumpwholetable("playerextra");
   } elsif($p==20) {
      dumptable("intelreport", $alli, 4);
   } elsif($p==21) {
      dumptable("internalintel", $alli, 32);
   } elsif($p==24) {
      dumptable("planetinfos", $alli, 2);
   } elsif($p==26) {
      dumptable("relations", $alli, 8);
   } elsif($p==27) {
      dumptable("allirelations", $alli, 8);
   } elsif($p==29) {
      dumptable("fleets", $alli, 1);

intelreport.csv

alli pid modified_at growth science culture production speed attack defense trader startuplab
   biology economy energy mathematics physics social racecurrent
Beware of using entries with racecurrent=0 (those are usually from former rounds).
modified_at is a UNIX timestamp. Everything else should be straightforward.

internalintel.csv

This file contains data that is only available about members of the own alliance.
alli pid modified_at production science culture artifact tr ad pp etc sus
etc = Estimated Time to Culture
production/science/culture are hourly values without bonusses

holes.csv

This one is actually only an extract of data from the other files (and the public ones of course). It is stored as cache to not waste ages with every click on the holes display tool. Format is
sysid members members+friends enemies worstRelation

spies.csv

Same comment as with holes.csv. Format is
spyName spyPID spyBio victimPID victimBio

/alltrades.csv

The http://aw.lsmod.de/alltrades.csv is actually public data and very similar to AR's trades.csv. Differences are that it also contains trades signed between 00:00 and 04:00 and that the order of pids is different. It is always id1>id2. A zero(0) as id might mean that the partner resigned or is not listed in the CSVs for other reasons.

/cgi-bin/public/cdinfo

The cdinfo tool offers to export info public data that is available from brownie usage. It is specifically designed for automatic retrieval and processing (but if you have many users, caching the data for a minute is still a good idea).
The points+PL table format:
playerid time points PL totalpop

CV has format:
sidpid time cv pop playerid

where sidpid is systemID*13+planetID

Valid XHTML 1.0! 100% hand coded HTML powered by vim powered by perl