Slapnuts
Member
+0|6616
Hi there,

Not wanting to outdo this site or anything, just want to know where BF2s gets its stats from. I'm really more interested in getting stats for BF2142, but i want to see how it works. Whats the EA stats server address? whats it running?

Is it a HTML page? a SOAP request? a web service?

How does it work? I cant find any information about it from EA. Is it a secret?!

Any help much apprecieted.

Cheers

[XS]Shrapnel
loonitic
...is a potty mouth
+286|6756|Valhalla
EA i would have thought
~Smokey~
Steve Irwin Reincarnate
+396|6759|Internetfitlerland

Jenspm wrote:

I could tell you, but I would have to kill you...
and then you would reaspawn 15 seconds later, and I would have to kill you again.


Seriously ask Chuy/admins.

Last edited by ~Smokey~ (2006-10-25 04:38:48)

RedTwizzler
I do it for the lulz.
+124|6758|Chicago
Why does it matter? Can't you just use this site and be happy with it? People these days...
liquidat0r
wtf.
+2,223|6848|UK
EA provide a feed.
Slapnuts
Member
+0|6616
Ok wheres the "feed" or do i need a knife and fork. Whos the best person to ask?

Like I said, im not wanting to outdo this site, i like this site, i just want to see for myself whats behind getting the stats.

Cheers
Ask Jeeves
Cctoide
Member
+0|6692|Portugal
It's an XML feed, which chuy got special permission to use, making this a little more official than other stats sites. I doubt it's for public consumption.
jsnipy
...
+3,276|6744|...

Cctoide wrote:

It's an XML feed, which chuy got special permission to use, making this a little more official than other stats sites. I doubt it's for public consumption.
more official feed? (Granted this site looks more official than most )

Last edited by jsnipy (2006-10-25 05:24:50)

Slapnuts
Member
+0|6616
no one knows then?
liquidat0r
wtf.
+2,223|6848|UK
Slapnuts
Member
+0|6616
Thanks that was helpful, if anyone else is interested, so is this link

http://www.kquery.com/forums/index.php?showtopic=1580
soadlink
Member
+2|6942
Some pretty useless replies here, but I use this php script to retrieve my live global score instead of waiting hours for it to refresh:

<?
//Pretend you're the Battlefield 2 Client
ini_set(user_agent,"GameSpyHTTP/1.0");

//Get the PID from a nickname
$query_url = 'http://bf2web.gamespy.com/ASP/searchforplayers.aspx?nick=' . $_GET['nick'] . '&where=b&sort=a&debug=txs&transpose=0';

$results = @file($query_url);
if(IsSet($results) && is_array($results)) {
$descriptions = explode("\t", $results[3]);
$values = explode("\t", $results[4]);
for($i=0;$i<count($values);$i++) {
    $v[$descriptions[$i]] = $values[$i];
}
?>
<?
}
?>
<?

//Pretend you're the Battlefield 2 Client again
ini_set(user_agent,"GameSpyHTTP/1.0");

//Get the score from the PID
$query_url = 'http://bf2web.gamespy.com/ASP/getplayerinfo.aspx?pid=' . $v['pid'] . '&info=per*,cmb*,twsc,cpcp,cacp,dfcp,kila,heal,rviv,rsup,rpar,tgte,dkas,dsab,cdsc,rank,cmsc,kick,kill,deth,suic,ospm,klpm,klpr,dtpr,bksk,wdsk,bbrs,tcdr,ban,dtpm,lbtl,osaa,vrk,tsql,tsqm,tlwf,mvks,vmks,mvn*,vmr*,fkit,fmap,fveh,fwea,wtm-,wkl-,wdt-,wac-,wkd-,vtm-,vkl-,vdt-,vkd-,vkr-,atm-,awn-,alo-,abr-,ktm-,kkl-,kdt-,kkd-';

$results = @file($query_url);
if(IsSet($results) && is_array($results)) {
$descriptions = explode("\t", $results[3]);
$values = explode("\t", $results[4]);
for($i=0;$i<count($values);$i++) {
    $v[$descriptions[$i]] = $values[$i];
}
?>
<? echo $v['scor']; ?>
<?
}
?>
If you copy that to a text file and save it as file.php, and upload it to a webserver that supports php you can run it like this:  http://www.website.com/file.php?nick=Blazin.UK

^ The page will then run the code and echo the global score for that user. That is just the global score though, you can echo a ton of things from different feeds. I commented it to help you better understand it a little better, but if you are familiar with php it shouldnt be hard to see what's going on.

Of course that php code might be a bit bloated, so that is where Chuy or someone else could come in and trim it... but the code works.

Here is a good wiki that goes in depth about the BF2 stats feeds: http://bf2.fun-o-matic.org/index.php/BF2Stats

The feed basically comes from a webpage, except you need to be identified as a 'gamespy client' to see that page or else you simply cant see it. So using firefox or IE to view it wont work. That is why you see the php code changing your user agent: ini_set(user_agent,"GameSpyHTTP/1.0");

Let me know if you need anymore info about it... glad to help
Slapnuts
Member
+0|6616
Thats good thanks. I figured out as much from looking at an etherreal dump of a reuqest by a stats program, and i've written what you have in Java.

The thing is i'm trying to get my BF2142 stats really. So I did a dump of a BF2142 connection, and there is an auth=[insert shit here] in the query string. That suggests to me some kind of encryption preventing just any old connection obtaining my results.

does this mean that it isnt possible to obtain my results without using the encryption key that EA must use to request stats?

Any ideas?

Cheers
[XS]Shrapnel
soadlink
Member
+2|6942

Slapnuts wrote:

Thats good thanks. I figured out as much from looking at an etherreal dump of a reuqest by a stats program, and i've written what you have in Java.

The thing is i'm trying to get my BF2142 stats really. So I did a dump of a BF2142 connection, and there is an auth=[insert shit here] in the query string. That suggests to me some kind of encryption preventing just any old connection obtaining my results.

does this mean that it isnt possible to obtain my results without using the encryption key that EA must use to request stats?

Any ideas?

Cheers
[XS]Shrapnel
Knowing the past of DICE, their encryption methods are pretty weak. This guy (http://aluigi.altervista.org/papers.htm) has done a lot of research and reverse engineering with products that incorporate gamespy into them, and by reading his tutorials you can see the encryption methods for various things are poor. You might be able to email him and see if he can dig into bf2142 and see how stat information is encrypted, but more than likely its nothing too complicated. For example, the cdkey checking in BF2 uses UDP packets that are XORd with the phrase 'gamespy'. Of course the cd key is MD5d before hand with other stuff (as shown in his tutorial), but it wouldnt be hard to decode the XORd text. XORing is a weak form of encryption.

But all in all, it shouldnt be hard to retrieve 2142 stats if you do some digging. You might also see if the guys over at bf2player.com would be kind enough to tell you how they do it. Good luck, let us know how you come along

Board footer

Privacy Policy - © 2024 Jeff Minard