You are not logged in.

#1 12 Jan 2007 11:42 am

New Member
Registered: Jan 2007
Posts: 2

in-game stats?

I think that this is different than the gamespy status stuff... maybe... maybe not...

Is there a way to get the in-games stats / score during a game session? There is
a G15 keyboard app that is able to get this info ( I email the author about it but
haven't gotten a response yet ) so I assume that there is some way to get this
info while the game is playing.  I'd like to be able to pass this info to a second
computer on my network and display the stats on a second system.

I'm not talking about leaderboard stats... you are #12345 out of 555000 players...
I'm talking about tracking the 1-64 players that are on a server... who has the
most kills, points, etc for that one session.

Thanks - jack



#2 12 Jan 2007 12:40 pm

From: Dallas TX
Registered: Jun 2006
Posts: 529

Re: in-game stats?

yes, you can query the game server and it will return the game stats / player info for that current round.  I've run across the protocol in the past (its the same for 2142 as it was for battlefield 2). 

you basically open a socket to the game server ip on port 29900 (this is the default anyway, individual servers may use something different), and send a request, which is an 11 byte request packet (0xfe 0xfd 0x09 0x21 0x21 0x21 0x21 0xff 0xff 0xff 0x01).  the server will respond with (from what I can tell is a 4 byte response) which you add into a challenge packet: (0xfe 0xfd 0x00 0x21 0x21 0x21 0x21 [b1 b2 b3 b4] 0xff 0xff 0xff 0x01 where b1-b4 are the bytes returned from the request).  you then send that to the server and it will return you the list of players and their in game stats.  you'll have to parse that data out but should be listed as:


hostname|player name|score|ping|deaths|pid|skill|team|team_total|score_total

I've never actually done it so I may have said something wrong.  I've read about it a long time ago but don't have the time right now to either test this out or find the threads I read on it.  I can test it out later tonight when I get home from work on my own server to verify thats how you do it.

there's an app that I found a while ago (which I used as reference for the specifics on the protocol) called lgsl which can be found at it should let you see this without having to write anything (or could help you write your own thing if you wanted).

EDIT:: there's a page on the bf2tech wiki on this: but since it was derived from the beta, things may have changed... I notice that richard's code (from graycube) is different than what they've documented on the wiki but it should give a good starting point.

Last edited by MadHatter (12 Jan 2007 3:44 pm)



© 2003 - 2022 NullFX
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License