Talk:BF2 Statistics

From BF2 Technical Information Wiki
Revision as of 03:09, 18 January 2010 by Lam0 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

How to get the statistics for C4, Claymore and AT-Mine like bf2s.com

Has someone else a solution to solve this problem?

--eRoZion

Getting stats from unranked servers

I'm looking for a way to get stats from my lan server, which is, obviously, unranked. Is there a way to: - generate a log file - get the stats snapshot from my lan server and parse it - parse a battlerecorder file - query my server for stats of the last few rounds

--Kneeso 08:39, 19 Jul 2005 (MDT)

Check www.bighamster.de for an lan or non ranked stats script

--Darkseed 06:55, 28 Jul 2005 (MDT)

Thanks for the link. I'm working on an own thing right now with a slightly different approach and goal. Gonna reveal it here once it's ready.

--Kneeso 04:28, 29 Jul 2005 (MDT)

Stats Retrieval

It appears that EA/Gamespy is now blocking access to the stats server? The game still grabs stats correctly, but I can no longer hit the page. My script fails and I can't figure out why.

--L0ser 09:28, 13 Jul 2005 (MDT)

EA/Gamespy have blocked basic stats retrieval, apparently because of overuse, and missuse. See this stats page for details. There are ways around the block, and the code running on my clan's website for example exactly emulates the games call to the stats server in order to get the data. However we're only tracking 40 odd members, and we use database caching so it doesn't stress the stats server. For the moment I'm not going to post the code for getting around the block, as I think it's best to wait and see whether EA/Gamespy sort out an alternate method for us all to use.

--Vex 18:32, 14 Jul 2005 (MDT)

Shortly after I posted I figured out how to get around it as well. My sig generator (ugly interface, atm) works well again. Of course, our web server being flakey means that uptime sucks. Soon to be fixed, hopefully.

--L0ser 00:31, 15 Jul 2005 (MDT)

Their official update said the issue is related to web sites tracking BF2 stats, the stats tracking feed may be turned off temporarily in order to speed up this process. However, it will be turned back on after this issue has been resolved. I noticed that their stats server has very little protection against users doing stupid things. I fear they didn't plan for third party usage. The news on bf2s.com confirms that they're working on improving the Gamespy server. In the meantime, if you've found a way around their blocking, it's probably best to be discrete about it until they can fix things up.

--KuranesGrey 17:02, 16 Jul 2005 (MDT)

I thought I'd say hello and add a couple of notes based on my exploration of the BF2 stats system. I would guess that it's possibly related to the info= stuff. When I poll the server with getplayerinfo.aspx?pid=12345678&info=foo,bar I get the whole deal, just as though I had left the "info" part of the request off. So I'm guessing that they've temporarily killed the part of the script that parsed that nvp and are returning the pre-set list of data. That may be what's causing GameSpy to have the blocking hack that they do. Hope to be able to help out with the actual wiki in the coming weeks!

--Excession 22:39, 17 Jul 2005 (EDT)

Apparently EA is blocking the requests based on the useragent. Setting the useragent to "GameSpyHTTP/1.0" allows u to access the stats

--Darkseed 14:05, 28 Jul 2005 (EDT)

<?php useragent=GameSpyHTTP/1.0 // i know this is wrong, but tell me what is the right method? :) $uri = "http://bf2web.gamespy.com/ASP/getleaderboard.aspx?pid=123456789"; $contents = file_get_contents($uri); echo $contents; ?>

where (and how) to put the useragent? Searched all php.net for it, no answers there :S

--RustyKnight 21:40, 30 Sep 2005 (EDT)

Please don't ever load content from URLs with file_get_contents...seriously. try fsockopen(). --Co.cane 15:33, 21 April 2006 (MDT).

I was wondering if any body has done any work in Java? I'd like to put a little client together to get my stats using Java, but the connection is reset when ever I try to connect. Any help would be appricated

--RustyKnight 22:16, 01 Sep 2005 (EDT)

Gamespy seems to be blocking the use of getplayerinfo.aspx but not the other scripts?

--Tm1000 20:13, 8 Nov 2005 (MST)

getplayerinfo.aspx still works, just not with the nick parameter. Passing a pid still retrieves data but only if (afaict) the query is the same as the query that BF2 passes.

--L0ser 17:47, 9 Nov 2005 (MST)


Just like this : http://bf2web.gamespy.com/ASP/getplayerinfo.aspx?pid=$pid and still with the same user-agent...

--Whiler 17:41, 18 Nov 2005 (MST)

Documentation

This documentation is going great!

--KuranesGrey 09:55, 4 Jul 2005 (MDT)

Well, it's certainly starting to get somewhere. :) I've recently contacted the author of this stats page, to see if he can help us with how to get the time information for squad leader/member/lonewolf as I've been unable to find that within the getplayerinfo data.

--Vex 10:56, 4 Jul 2005 (MDT)

I tried $_SERVER["HTTP_USER_AGENT"]="GameSpyHTTP/1.0"; but doesn't seem to work. It does change the value if I echo it... So probably thhis workaround is outdated?!

Please somebody delete his question cause its stupid to set read-only variables... --Co.cane 15:33, 21 April 2006 (MDT)

Current Server

Great guide! Is it possible to get the server a player is currently using (or indeed if they are currently online)? I don't seem to get a value for svr- returned.


Currently the stats server doesn't return any values (as far as I can tell), for these fields. There seem to be several data fields that are listed but don't have values. I don't think there's anyway to find out if a player is currently online, or playing, other than to scan each server and check the player list!

--Vex 18:32, 14 Jul 2005 (MDT)

Anybody have a clue as to when the stat server will be made available again?

--Pmingo 00:28, 17 Aug 2005 (MDT)

bf2s.com is able to tell last time/date played and if the player is currently online. I suppose they get that information through a gs call. Any idea so far?

--Whiler 17:55, 18 Nov 2005 (MST)

No, I think they have a partnership with Game-Monitor...

When you look at the getplayerinfo columns there are many values for the last servers the user was playing on. They are srv-0, srv-1, srv-2 etc. But i wasnt able to get any of those values yet. Vex said something like that already. --Co.cane 15:33, 21 April 2006 (MDT)

Alternate Battlefield 2 Ranking.

Hey all, im working on an statistics, INGAME ( BFHQ ) and just on our website. actually, what EA has, i want for my clan :)

i have managed to do almost all of it, i only need to have more informtion about a specific function host.pers_gamespyStatsSendSnapshotUpdate(GameData)

this function (from what i've been told ) pushes stats information to EA. i'd like to get my hands on more information!

basicly i want a copy of all data, send to a different host. at this moment im using the stats tool of bighamster.de, but it lacks essential information.

Update : we are currently discussing with BigHamster Stats, to make both Bf2stats & ABR work together.

Project Homepage : http://www.bf2scripts.com

--SatcomNL 14:46, 25 Jul 2005 (MDT)

get the country of a player

Hi all, i trying to get the country of a player but the getleaderboard dont work and dont receive the correct things...or maybe im doing something wrong, exist other form of get the country of a player?

UPDATE: solved! :P correct use of getleaderboard

William Valentine here, I'm setting up a website to track my clans stats, but I can't seem to get the country code to work, what is the correct coding to get the country code?

UPDATE: Nevermind, I figured it out on my own.

New Links

I noticed these in the bf2.exe file, not sure what they do, they return odd results. Maybe someone with a better understanding could look into them.

selectunlock.aspx?pid= &id= (returns E 121 for any unlock id the person doesn't have, and returns nothing for an unlock id they do have)

searchforplayers.aspx?nick= (appears to return just the headers, no data)

ranknotification.aspx?pid= (not sure, maybe if the person will be given a rank update on next login?)

--King of Camelot 17:53, 6 Nov 2005 (MST)

  • I believe selectunlock is called by the client whenever someone tries to use select an unlock in-game. This would make it harder to enable all unlocks on servers. --Dackz 22:04, 6 Nov 2005 (MST)

New Information since SF

Since Special Forces release I get new data from getplayerinfo.aspx
A new weapon:
wkd-13,wtm-13,wkl-13,wdt-13,wac-13
I'm not sure. Tactical Weaponry stats??

de-6 - using Flashbang??
de-7 - using Grappling Hook??
de-8 - using Zip Line??

I'm not very sure. Please correct it.



deployed tactical de6
deployed grappling hook de7
deployed zip line de8
--Whistler 15:39, 27 Nov 2005 (MST)

getplayerinfo.aspx returning null ?

Hi all, I've been contacted by my clanmates as to why our stats/sig gen stopped updating. Looking further into it, it seems as tho all calls to

http://bf2web.gamespy.com/ASP/getplayerinfo.aspx?pid=43861616

fail will nothing coming back. This all used to work fine, and I can see the UserAgent etc hasn't changed. I've even tested this functionality using the BF2 Url Tester :

http://www.bat-clan.be/bf2urltester.php

But that also fails with the playerinfo call. All of the other calls (getawards etc) work fine, but getplayerinfo.aspx just returns blank, regardless of the pid passed to it.

Its probably something stupid I'm doing, since no-one else has posted about it, but since I can't even get the URLTester to get the output, I was thinking it must be something wider.

Ideas ?

Cheers Si.


No idea what caused it, but after a bit of packet sniffing on my network while using BFHQ from within the game and I'm now using exactly the same format urls as the in game stats browser and its all working fine.
Very bizarre...
Si.

--FishSlice 22:23, 29 Nov 2005 (MST)




I've got the same problem. Nothing was changed in my scripts but now playerinfo call doesn't work at all. Other functions are going on working. The only way to solve this problem that I found out is to change the call of the function to the internal call of the BFHQ.

--Alex 04:33, 18 Jan 2006 (MST)


SOLUTION

The solution for this is to use the following call:

http://bf2web.gamespy.com/ASP/getplayerinfo.aspx?pid=43861616&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-

(this is the same call as BFHQ uses)

For more information read http://bf2.fun-o-matic.org/index.php/BF2_Statistics

This url works on the bf2 url tester (http://www.bat-clan.be/bf2urltester.php)

--Hydra 07:01, 12 June 2006 (MDT)

Here is some code and a basic working stats script using that url: (It can fetch many more values than in the example)

script: http://www.bat-clan.be/simple_stats.php?pid=44652121 code: http://www.bat-clan.be/simple_stats.txt

--Hydra 04:25, 13 June 2006 (MDT)

Server to busy

Hi,

It keeps saying that the server is to busy , could someone tell me how to bypass it . Because it is getting realy annoying

Cheers

Gather Serverinfo where a Player ist currently Playing

Hi Folks,

I have one Question. Is it possible to get infos where a player is currently playing from gamespy?

--Zed 16:53, 3 March 2006 (MST)

Hi, i would like to know it too. there are so many sites who can do this and i asked them but no one answerd me.. Does someone know how its posible??? many thx

--Watwerbistdudenn 07:02, 17 April 2006 (MDT)

Hi... maybe you can write a client tracking where bf2.exe (if its runing) sends many udp data packets.

Reverse engineering Battlefield 2 login process

Hello,

I wasn't sure if this is the right place to post this comment, but here goes anyway:

I have been looking into the way Battlefield 2 logins a player to the game, and trying to reverse engineer (i guess you could say) the login process. I noticed when doing a packet scan with ethereal, it connects to this ip 207.38.11.34, and this port 29900.

When I went to my browser and typed in 207.38.11.34:29900 it comes back with an error like: \lc\1\challenge\OUPBEXLDGL\id\1\final\\error\\err\1\fatal\\errmsg\There was an error parsing an incoming request.\final\

In this error, the 'OUPBEXLDGL' part changes everytime you refresh the page. I know this has to be the login server where they validate login information.

Does anyone have any ideas on where I could go from here? I'm just trying to submit a username and password, and have it return data to me letting me know if it was valid or not (but without having to be logged into battlefield 2).

I am pretty good with VB, so is there something I could maybe code with VB (like by using winsock) to connect to this login server and send it information, and have it return information? Or maybe this could be done through just a website by changing the link(like how stats are retreived).

Thanks a lot!


This page might help a lot: http://aluigi.altervista.org/papers.htm Wish you luck and please tell us how you went in the end :) --Danielphin 08:04, 28 August 2006 (MDT)


I was successful =) I actually did it a long time ago just havent gotten time to update you guys. I coded it to work with php and visual basic, all thanks to Danielphin's help by giving that page >=D! Thank you very much, I will have to post my code soon if anyone wants it (of course that page has the source code for a PW checker written in C now).


Looking forward to it :D --Danielphin 23:18, 27 September 2006 (MDT)


User Agent

Does anyone know how to set the user agent in Java. This is what I want in PHP... ini_set("user_agent","GameSpyHTTP/1.0");

Maps

I can get all the names of the maps and stuff but I cant seem to get the wins, losses, time played,.... plz help!

example:

Map Time Wins Losses Best Round Kubra Dam

n/a n/a n/a n/a

How to get Teamkills

I´m looking for something to get the current Teamkills of a player an write them into a SQL Database. Secound thing is not a big problem, but how can i track the Teamkills?


Solution: I´ve written a php-script which reads the html-file from another stats-site and returns the value of teamkills.

How to gather stats for mbr- ?

I ask if anybody knows how to do that

How to get only specified values

It's possible to get only, for example, "first played" and "last played" values? Or I should use standart query to get all playerinfo values and run parser?

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox