View Full Version : BF1942 Server Admin

01-21-2007, 10:18 PM
OK, I've been looking at the BOT that RN_Max has been running during battles.

It is able to retrieve, in "real-time" kill tracking (i.e. [46z]H|SSze.JAMerica killed someone).

I can query a battle server using the gamespy protocol fine, which gives player stats, tickets left, etc.. fine.

Does anyone know how to get the real-time kills from the server like the IRC bot.


01-21-2007, 11:43 PM
I believe that if the server is recording in game events you can get some sort of script parsing real time. Don't know how resource consuming it is, or even on how to make it work (never tried it myself), but theoretically it's possible.
I once thought about getting the recorded events and squeeze some kind of stats from it through a perl script, but then lost interest (as in, finals came around).


01-22-2007, 12:19 AM
Thanks for the quick reply Feher,

Yeah, I basically wanted to build a new IRC bot where you could go when your sitting in the waiting room and query player stats and what not.

The fact that the IRC-bot I have is doing this without any server-side modification is a little puzzling, so it must be pulling this info from
one of the open game ports.

I guess I'll keep on digging.


01-22-2007, 12:44 AM

most stat scripts use this *nix tool to query the server on UDP 23000 and spews the info out in raw form...

like this (http://pross.org.uk/bf1942live/bf1942live.pl) for example which is written in perl and uses a perl module to do the same thing...but at this point im not sure if the perl version can get 'kill stats'

01-22-2007, 01:13 AM
I already whipped up a script that is able to query the game server and get a snapshot of the current battle, then barf that out to an IRC channel. If I can just get these pesky kill stats/and flag captures, i'll be able to produce real time player stats on demand in the channel.

Anyways, if you guys come across anything I'd appreciate it if you could pass it on.


01-22-2007, 08:47 PM
Well after a bunch of packet sniffing and testing, I've come to a conclusion regarding the IRC bot:

1) It's making a gamespy status query every 0.2 seconds
2) The "real-time" kills and flag captures are calculated from the changing points total given in each query. So, it's probably accurate as long as there aren't two kills at exactly the same time.

On the brighter side, in BF2 (and hence FH2) there are programming hooks built right into the game, so it would be quite easy to build a comprehensive stat recording and reporting system for the tourney.

Anyways, just thought I'd pass this on.

01-25-2007, 02:08 PM
Yeah it would be cool to take the eventlog and making some stats from that. Like u could show the number of kills for each person with different weapons
ie [46Z]Jockemejsel - Satchel 18, No4 56, Col45 200 and so on... That would be possible right?

It would be cool also to see the amount of different vehicles u have destroyed like it does when u play in singleplayer mode and the map ends. I don't know if this is possible though..

01-25-2007, 03:52 PM
selectBf is an awesome parser that exists. I just haven't been able to get it working due to my limited technical knowledge. You may want to have a look at that before starting from scratch.

01-25-2007, 06:20 PM
Trexer;200267']selectBf is an awesome parser that exists. I just haven't been able to get it working due to my limited technical knowledge. You may want to have a look at that before starting from scratch.

Yah, I took a look at selectBf. It isn't actively maintained, and even worse depends on PHP(which I have no desire to learn) and Java :(

But I'll still take a look!

I have started to write a python parser for the log files, and so far have gotten it to do real-time streaming from a game server and spit out the action into an irc channel.

From the logs you can calculate all sorts of useless stuff:

Healing time
Time spent in vehicles by vehicles
Kills/TK/Flag Capture (categorized by weapon)
Distance of kills (sniper competition anyone ?!?)
Favorite person to kill

etc, etc.

I don't think you can do this in single player mode, because the server does not keep a log.

Hope to have this running soon, time permitting.