[bf1942] Log parsing..
Forrest Thiessen
thiessen at alum.mit.edu
Fri Feb 13 16:54:16 EST 2004
I'm working on an XML log parser, with three goals in mind:
(1) To be used like BFSMLP (which I don't think is supported
any more) to read logs and write player stats information
into a MySQL database, which can then be displayed
via PHP or whatever. The XML logs are considerably
richer in data than the BFSM logs that BFSMLP used,
so I will be able to have all kinds of interesting
detailed information available (for example, a plot
of ranges of sniper kill shots, players' favorite
weapons, etc.)
(2) To be able to implement real-time game monitoring
and implement real-time "supplemental rules": for
example, to kick players who use "inappropriate"
language in chat messages, or to kick
players who spawn camp (several ways that could
be done).
If you just want to be able to suck in a .xml or .zxml log file and spit
out all the chat messages, correctly attributed to the right players, my
code can already do that (it correctly handles name-change events, and
even handles players who disconnect and reconnect with a different name
by matching up hash keys).
Unfortunately, while XML logging in BF1942 v1.6 is light-years ahead of
previous versions (it actually generates well-formed XML, for one
thing!) it still leaves a few things to be desired: for example, console
messages (ala game.sayall) are *not* logged, nor are there any events
generated corresponding to player kicks, bans, votes, games pauses or
unpauses, IP addresses, or several other things that really ought to be
in them. Nonetheless, all player chat *is* logged (thank you Andreas!),
and all radio messages (e.g. F1-F1 = "Roger") are also logged, so the
chat part of what you are asking for can easily be done. (As an aside,
as another person pointed out you can also get the chat messages from
the BFSM log, which DOES show kicks, bans, etc. if they were executed
via BFSM. . . however, BFSM makes no effort to track players by key hash
or IP--it just tells you the chat message and the in-game name of the
player who said it).
My code is written using Perl and the XML::Parser::PerlSAX library; I
expect to have an early version of it up and running within a couple of
weeks, give or take, depending on how much time I can snag to finish it.
My plan is to make it available to anyone who wants it once it reaches
the point of being reasonably complete.
What platform are you using? I'm developing this using ActiveState
Perl, so the end product can be either Perl code that can be run on
Linux or Windows, or a stand-alone Windows binary executable. If you
are in a rush and you're on Windows, I could give you an executable now,
but I'd prefer to get the rest of the basic functions in the code before
I release that.
--Forrest
thiessen at cyberscapearena.com
-----Original Message-----
From: James Gurney [mailto:james at globalmegacorp.org]
Sent: Thursday, February 12, 2004 11:35 PM
To: bf1942 at icculus.org
Subject: [bf1942] Log parsing..
I know at least on person on this list was working on a log parser..
anyone got anything they'd be willing to share? Right now I'd like a way
to view the chat log, but there's no simple way to do it since the text
is linked by player ID, so it's more complex than the level of grepping
and awking I'm up for. Ideally, it would be nice to have a perl script
which, when passed a logfile, just outputs the chat log in a sort of IRC
format:
<luser1> tihs m4p is t3h suck!
<luser2> i r 0wnz0r j00 biznatch3z!
<luser3> OMG BS!
<admin> You're all fucking banned.
etc.. maybe including some events like kicking, banning etc.
Anyone have anything like that they'd be willing to share?
James
-----Original Message-----
From: James Gurney [mailto:james at globalmegacorp.org]
Sent: Thursday, February 12, 2004 11:35 PM
To: bf1942 at icculus.org
Subject: [bf1942] Log parsing..
I know at least on person on this list was working on a log parser..
anyone got anything they'd be willing to share? Right now I'd like a way
to view the chat log, but there's no simple way to do it since the text
is linked by player ID, so it's more complex than the level of grepping
and awking I'm up for. Ideally, it would be nice to have a perl script
which, when passed a logfile, just outputs the chat log in a sort of IRC
format:
<luser1> tihs m4p is t3h suck!
<luser2> i r 0wnz0r j00 biznatch3z!
<luser3> OMG BS!
<admin> You're all fucking banned.
etc.. maybe including some events like kicking, banning etc.
Anyone have anything like that they'd be willing to share?
James
More information about the Bf1942
mailing list