Page 1 of 1

Player/Server Stats

Posted: Fri Nov 11, 2005 8:25 pm
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.

RE: Player/Server Stats

Posted: Fri Nov 11, 2005 8:28 pm
by swbf_lase
Hmm.... If im correct you just cant do it you would have to just wrtie down the points or something

RE: Player/Server Stats

Posted: Fri Nov 11, 2005 9:06 pm
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.

Posted: Sun Dec 04, 2005 5:40 pm
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

Posted: Sun Dec 04, 2005 6:17 pm
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)

Posted: Sun Dec 04, 2005 6:33 pm
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.