Player/Server Stats

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Bhozar

Player/Server Stats

Post by Bhozar »

Does anyone know if its possible to pull player stats out of server software? My guild is looking at putting stats on a website so we can compare who is best etc when playing on our SWBFII server.

I thought it might need to be some kind of server side mod. I'm really shooting in the dark trying to find out. Its disapointing that it doesnt output log files on the server software.
User avatar
swbf_lase
Major General
Major General
Posts: 647
Joined: Fri Jul 08, 2005 7:07 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: 127.0.0.1:465
Contact:

RE: Player/Server Stats

Post by swbf_lase »

Hmm.... If im correct you just cant do it you would have to just wrtie down the points or something
Bhozar

RE: Player/Server Stats

Post by Bhozar »

Thats a shame. When so many other games have this feature, including Battlefield 2, you would think it would be possible to do. I really think it would keep the game going for many people much longer as guild members could compete with each other.
Dvondrake

Post by Dvondrake »

I think I've found away to do it through xFire.. Hold on, I'll edit this post later when I can confirm that it's a working way. :)
Just trying to keep the hope up. :P
DFYX

Post by DFYX »

If I remember correctly, I saw a script that shows you the server stats on a homepage. But sorry, can't remember where it was. Either some of the pages that are linked on the left or starwarsbattlefront.filefront.com (Or somewhere on the forums)
Dvondrake

Post by Dvondrake »

Well, instead of using xfire, I've found some code that might be usable for BF2, except this code is from BF1. Who knows, maybe it'll work. :P

Code: Select all

$socket = fsockopen($server,$port,$errno,$error, 5) or die($error."(".$errno.")");

$send = pack("H*",$request);
fwrite($socket,$send) or die ("ERROR IN SENDING PACKETS");
fread($socket,1);

$bytes_left = socket_get_status($socket);
if($bytes_left[unread_bytes] > 0) {
	$buf = fread($socket,$bytes_left[unread_bytes]);
}
fclose($socket);

$out = pack("H*", 00);
$outpa = explode($out,$buf);

$hostname = $outpa[1];
$gamever = $outpa[3];
$port = $outpa[5];
$mapname = $outpa[7];
$gametype = $outpa[9];
$numplayers = $outpa[11];
$numteams = $outpa[13];
$maxplayers = $outpa[15];
$gamemode = $outpa[17];
$teamplay = $outpa[19];
$fraglimit = $outpa[21];
$timelimit = $outpa[23];
$session = $outpa[25];
$prvsession = $outpa[27];
$swbregion = $outpa[29];
Should be pretty self explanitory if you know what you're doing.
Post Reply