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.
Player/Server Stats
Moderator: Moderators
- swbf_lase
- Major General
- Posts: 647
- Joined: Fri Jul 08, 2005 7:07 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: 127.0.0.1:465
- Contact:
RE: Player/Server Stats
Hmm.... If im correct you just cant do it you would have to just wrtie down the points or something
RE: Player/Server Stats
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.
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.
Should be pretty self explanitory if you know what you're doing.
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];