/ Forside / Teknologi / Udvikling / Perl / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Perl
#NavnPoint
bjarneA 141
poul_from 50
soccer 30
Nicknack 14
Tmpj 0
Problem med Perl-script under Apache
Fra : Jimmy Marcus Larsen


Dato : 15-06-01 08:04

Hej!

Jeg har nogle problemer med et Perl-script jeg har hentet fra nettet. Det er
et script der skal vise hvor mange spillere der er på en Counter Strike
server.
Min Linux Apache server kommer med en "Internal Server Error 500" i
browseren når jeg forsøger at køre scriptet. I Apache's Error Log står der
"Premature end of script headers". Hvad betyder det?
Jeg har et lille script der bare siger "testing 1, 2, 3" som virker fint så
jeg tror ik det er Apache's mod_perl modul der ik er konfigureret korrekt.

Her er scriptet som ik fungerer... Det er lidt langt


#!/usr/bin/perl -T
use POSIX qw(strftime);
use Net::hostent;
use Socket;

############################################################################
####
# csserverstat.pl - A server info and log parser for Half-Life
Counter-Strike #
# servers.
#
############################################################################
####
# http://server.counter-strike.net/csserverstat
#
# Version 1.06 #
# Modified 3/24/01 for new CS1.1 Logging format by Neo
#
############################################################################
####


# Set the path to your configuration file here. Make sure you use forward
slashes, even if you are running Windows (i.e.
c:/wwwroot/cgi-bin/csserverstat.conf).

$settings{configfile} = "/var/www/html/csserverstat/csserverstat.conf";


############################################################################
####
# Do not modify anything below this line!
#
############################################################################
####

$settings{version} = "1.06";

# Weapon display list.
%weaponlist = (
knife => "a Knife",
glock18 => "a Glock 18 9mm",
usp => "a H&K USP Tactical .45",
deagle => "a Desert Eagle .50",
p228 => "a Sig Sauer P-228 9mm",
elite => "a Beretta 96G Elite 9mm",
fiveseven => "a FN Five-Seven 5.7mm",
m3 => "a Bernelli M3 Super 90 12 gauge",
xm1014 => "a Bernelli XM1014 12 gauge",
mp5navy => "a H&K MP5/Navy 9mm",
tmp => "a Steyr Tactical Machine Pistol 9mm",
p90 => "a FN P90 5.7mm",
mac10 => "an Ingram Mac-10 9mm",
ump45 => "a H&K UMP .45",
awp => "an Arctic Warfare/Magnum (AWM) .338",
g3sg1 => "a H&K G3/SG-1 7.62mm",
scout => "a Steyr Scout 7.62mm",
aug => "a Steyr Aug 5.56mm",
m4a1 => "a Colt M4/A1 5.56mm",
sg550 => "a Sig SG-550 Sniper 5.56mm",
sg552 => "a Sig SG-552 Commando 5.56mm",
ak47 => "an AK47 7.62mm",
m249 => "a FN M-249 PARA 5.56mm",
grenade => "a High-Explosive Grenade",
);

# This subrouting will replace any occurance of "<" or ">" with their web
tag codes of "&#60;" and "&#62;", respectively.
sub TagFilter {
$_[0] =~ s/</&#60;/g;
$_[0] =~ s/>/&#62;/g;
}

# Get configuration pairs and place them in %settings.
if (!-f $settings{configfile}) {
print "Content-type: text/html\n\n<h3>Unable to open configuration file
\"$settings{configfile}\".<p>Check your server's file and directory
permissions, as well as your\$configfile setting in csserverstat.pl.</h3>";
exit;
}

open(CONFIG,"$settings{configfile}");

foreach $_ (<CONFIG>) {
chop;
s/^\s+//;
s/\s+$//;
next if /^$/;
next if /^#/;
s/\s*#.*//;
(my $setting,my $value) = split(/=/);
$setting =~ s/^\s+//;
$setting =~ s/\s+$//;
$value =~ s/^\s+//;
$value =~ s/\s+$//;
$settings{$setting} = $value;
}

close CONFIG;

# Check to see if all our path settings are ok.
if (!-f $settings{template}) {
print "Content-type: text/html\n\n<h3>Unable to open template
\"$settings{template}\".<p>Check your server's file and directory
permissions, as well as your \"template\" setting in
$settings{configfile}.</h3>";
exit;
}

if (!-e $settings{logdir} and !-d $settings{logdir}) {
print "Content-type: text/html\n\n<h3>Unable to open directory
\"$settings{logdir}\".<p>Check your server's file and directory permissions,
as well as your \"logdir\" setting in $settings{configfile}.</h3>";
exit;
}

if (!-e $settings{qstatpath} or !-d $settings{qstatpath}) {
print "Content-type: text/html\n\n<h3>Unable to locate the QStat
directory, or \"$settings{qstatpath}\" is not a directory.<p>Check your
server's file and directory permissions, as well as your \"qstatpath\" in
$settings{configfile}.</h3>";
exit;
}

if ($settings{log_anal_url} and $settings{log_anal_path}) {

if (!-e $settings{log_anal_path} or !-d $settings{log_anal_path}) {
print "Content-type: text/html\n\n<h3>Unable to open directory
\"$settings{log_anal_path}\".<p>Check your server's file and directory
permissions, as well as your \"log_anal_path\" setting in
$settings{configfile}.</h3>";
exit;
}

}

# Get configuration settings that were entered into the URL, if any.
$ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;

if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $in, $ENV{'CONTENT_LENGTH'});
} else {
$in = $ENV{'QUERY_STRING'};
}

my @settings = split(/&/, $in);

foreach my $settings (@settings) {
(my $setting, my $value) = split(/=/, $settings);
$setting =~ tr/+/ /;
$setting =~ s/%(..)/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%(..)/pack("C", hex($1))/eg;
TagFilter($setting);
TagFilter($value);

if ($setting eq "server") {
($settings{serverip},$settings{serverport}) = split(/:/,$value);
}

if ($setting eq "events") {
$settings{numevents} = $value;
}

if ($setting eq "refresh") {
$settings{refresh} = $value;
}

}

# Get the local time.
$now = localtime;

$tmp = gethost($settings{serverip});

if ($tmp) {
$settings{serverip} = inet_ntoa($tmp->addr);
}

# Determine the current log file.
opendir(LOGDIR,"$settings{logdir}");
@logdir = sort (grep (/$settings{serverip}/,readdir(LOGDIR)));
closedir(LOGDIR);
$settings{logfile} = pop(@logdir);

# Read the current log file and look for defined events. We assume that the
file is readable since the script was able to view the directory to figure
out which file to use.
open(LOGFILE,"$settings{logdir}/$settings{logfile}");
@logdata = grep ( /\>\" say/|
/\" say_team/|
/\" killed/|
/\" committed suicide with/|
/Touched_A_Hostage/|
/Rescued_A_Hostage/|
/Killed_A_Hostage/|
/killed a teammate/|
/Planted_The_Bomb/|
/Defused_The_Bomb/|
/Target_Bombed/|
/Bomb_Defused/|
/All_Hostages_Rescued/|
/Hostages_Not_Rescued/|
/VIP_Escaped/|
/VIP_Assasinated/|
/Terrorists_Win/|
/CTs_Win/|
/connected,/|
/\" disconnected/|
/Team "CT" scored/|
/Team "TERRORIST" scored/|
/joined team /
,<LOGFILE>);
close(LOGFILE);

# Don't go outside our allowable range for refresh and event display.
if ($settings{refresh} < $settings{minrefresh}) {
$settings{refresh} = $settings{minrefresh};
} else {
$settings{refresh} = $settings{defrefresh} unless $settings{refresh};
}

if ($settings{numevents} > $settings{maxevents}) {
$settings{numevents} = $settings{maxevents};
} else {
$settings{numevents} = $settings{defevents} unless $settings{numevents};
}

# The majority of the URL for each event setting change link is the same and
is defined here for convenience.
$cgiurl =
"refresh=$settings{refresh}&server=$settings{serverip}:$settings{serverport}
";

# Get game server, player, and rule information from QStat.
@qstatoptions = ("-R","-P","-tsw","-raw","!@#@!","-hls");
my($qstat) = open(QSTAT,"-|");
die "Couldn't open pipe to subprocess" unless defined($qstat);
system("$settings{qstatpath}/qstat",@qstatoptions,"$settings{serverip}:$sett
ings{serverport}") or die "Couldn't exec qstat" if $qstat == 0;
@qstat = <QSTAT>;
close QSTAT;

chomp(@qstat);
$serverstat = shift(@qstat);
$ruleslist = shift(@qstat);
@playerlines = @qstat;
($type,$ip,$servername,$map,$maxplayers,$curplayers,$ping,$timeout) =
split(/!@#@!/,$serverstat);

if (!-e "$settings{imagepath}\/$map.jpg") {
$mapimage = "default.jpg";
} else {
$mapimage = "$map.jpg";
}

# If debug mode is on, place the %settings hash in $debug.
if ($settings{debug} == 1) {
$debug .= "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n";

foreach $setting (sort (keys %settings)) {
$debug .= "<tr><td nowrap><font size=\"1\"
color=\"#808080\">$setting</font></td><td><font size=\"1\"
color=\"#E0E0E0\">&nbsp;=&nbsp;</font></td><td width=\"100%\"><font
size=\"1\" color=\"#E0E0E0\">$settings{$setting}</font></td></tr>\n";
}

$debug .= "</table>\n<hr size=\"1\" width=\"100%\">";
}

# If HLMaps is defined, link the map name and image to HLMaps. If HLMaps is
not defined but Log_Anal is, link the map name and image to Log_Anal.
Otherwise, leave it alone.
if ($settings{hlmaps}) {
$mapname = "<a href=\"$settings{hlmaps}?map=$map\">$map</a>";
} elsif ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$map.$settings{log_anal_extension}") {
$mapname = "<a
href=\"$settings{log_anal_url}/$map.$settings{log_anal_extension}\">$map</a>
";
} else {
$mapname = $map;
}

if ($settings{hlmaps}) {
$mapimage = "<a href=\"$settings{hlmaps}?map=$map\"><img class=\"map\"
src=\"$settings{imageurl}/$mapimage\" width=\"212\" height=\"160\"
alt=\"Current map is $map.\"></a>";
} elsif ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$map.$settings{log_anal_extension}") {
$mapimage = "<a
href=\"$settings{log_anal_url}/$map.$settings{log_anal_extension}\"><img
class=\"map\" src=\"$settings{imageurl}/$mapimage\" width=\"212\"
height=\"160\" alt=\"Current map is $map.\"></a>";
} else {
$mapimage = "<img class=\"map\" src=\"$settings{imageurl}/$mapimage\"
width=\"212\" height=\"160\" alt=\"Current map is $map.\">";
}

# Build the players list.
# Get the player list.
if (@playerlines) {

while ($_ = shift @playerlines) {
++$count1;
($playername,$frags,$timeonserver) = split(/!@#@!/);

# Sort the player list by frags.
push @playernamelist, $playername;
%playerlist = (
frags => $frags,
time => $timeonserver
);
for my $what (keys %playerlist) {
$player{$playername}{$what} = $playerlist{$what};
}

}

} else {

push @playernamelist, "None connected!";
$player{"None connected!"}{time} = "00:00";
++$count1;

}

sub byfrag {
$player{$b}{frags} <=> $player{$a}{frags};
}

foreach $playername (sort byfrag @playernamelist) {
$frags = $player{$playername}{frags};
$timeonserver = $player{$playername}{time};
($playerstats = $playername) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;

# Limit displayed player names to the maxplayername setting.
$playername =~ s/(^.{$settings{maxplayername}}(?!$))(.*$)/$1.../g;
TagFilter($playername);

# Format the time on server display.
($hours,$minutes,$seconds) = split(/:/,$timeonserver);

if ($hours eq "00") {
$hours = "";
$minutes =~ s/0//;
} else {
$hours = $hours.":";
$hours =~ s/0//;
}

if ($minutes eq "0") {
$minutes = "";
} else {
$minutes = $minutes.":";
}

$playerinfo .= "<tr><td class=\"playerlist\" nowrap><font
size=\"1\">&nbsp;";

# If any admins are present indicate them.
foreach my $admin (split/,/,$settings{admins}) {
$admin =~ s/^\s+//;
$admin =~ s/\s+$//;
TagFilter($admin);
if ($playername eq $admin) {
$playername = "$playername<font class=\"admin\">&#149;</font>";
}
}

# If Log_Anal is defined, link each players name to their personal stats
page. Otherwise, just print their name.
if ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$playerstats.$settings{log_anal_extension}") {
$playerinfo .= "<a
href=\"$settings{log_anal_url}/$playerstats.$settings{log_anal_extension}\">
$playername</a></font></td>";
} else {
$playerinfo .= "$playername</font></td>";
}

$playerinfo .= "<td class=\"playerlist\" align=\"right\"><font
size=\"1\">&nbsp;$frags&nbsp;</font></td>";
$playerinfo .= "<td class=\"playerlist\" align=\"right\" nowrap><font
size=\"1\">&nbsp;$hours$minutes$seconds&nbsp;</font></td></tr>\n";

}

# Show blank lines up to the server's maxplayer setting. Looks nice.
while ($count1 < $maxplayers) {
++$count1;
$playerinfo .= "<tr><td class=\"playerlist\" colspan=\"3\"><font
size=\"1\">&nbsp;</td></tr>\n";
}

# Build the rules list.
# Get and format the rules list.
foreach (sort(split /!@#@!/, $ruleslist)) {
($rule,$value) = split(/=/);
TagFilter($rule);
TagFilter($value);

if ($value eq 0) {
$value = "<font color=\"#303030\">&#149;</font>";
} elsif ($value eq 1) {
$value = "<font color=\"#009900\">&#149;</font>";
}

if ($rule eq "sv_contact") {
$value = "<a href=\"mailto:$value\">$value</a>";
}

if ($rule eq "mp_mapvoteratio") {
$value = $value*100; $value = "$value%";
}

if (($rule eq "gamename") && ($value eq "CounterStrike")) {
$value = "<a href=\"http://www.counter-strike.net\">CounterStrike";
}

if (($rule eq "sv_os") && ($value eq "linux")) {
$value = "<a href=\"http://www.linux.org\">Linux";
} elsif (($rule eq "sv_os") && ($value eq "windows")) {
$value = "<a href=\"http://www.microsoft.com/windows\">Windows";
}

# Defines which rules to show.
if ( /mp_mapvoteratio/ or
/mp_forcechasecam/ or
/mp_tkpunish/ or
/mp_autoteambalance/ or
/mp_limitteams/ or
/mp_autokick/ or
/mp_c4timer/ or
/sv_os/ or
/mp_roundtime/ or
/mp_flashlight/ or
/mp_friendlyfire/ or
/mp_timelimit/ or
/sv_maxrate/ or
/sv_minrate/ or
/sv_cheats/ or
/sv_type/ or
/mp_hostagepenalty/ or
/mp_footsteps/ or
/gamename/ or
/sv_contact/ ) {
++$count2;
$rulesinfo .= "<tr><td class=\"ruleslist\"><font
size=\"1\">&nbsp;$rule</font></td>";
$rulesinfo .= "<td class=\"ruleslist\" align=\"right\" nowrap><font
size=\"1\">$value&nbsp;</font></td></tr>\n";
}

}

# Make the rules list at least as big as the player list if it isn't
already. Looks nice.
while ($count2 < $count1) {
++$count2;
$rulesinfo .= "<tr><td class=\"ruleslist\" colspan=\"3\"><font
size=\"1\">&nbsp;</td></tr>\n";
}

# Build the events list
# Grab the last x events according to what $numevents is set to.
while ($popcount < $settings{numevents}) {
++$popcount;
my $newlogdata = pop @logdata;
push @newlogdata, $newlogdata;
}

# If enabled, reverse the event order so that new events are on top.
if ($settings{reverse_order} == "1") {
@logdata = @newlogdata;
} else {
@logdata = reverse (@newlogdata);
}

# This is where the log file data gets parsed out to HTML.
foreach $_ (@logdata) {

# If debug is on, $eventinfo .= the raw log file message.
if ($settings{debug} == 1) {
++$messagecount;
$eventinfo .= "<tr><td bgcolor=\"#D0D0D0\"></td>";
$eventinfo .= "<td colspan=\"2\" bgcolor=\"#D0D0D0\"><font size=\"1\"
color=\"#303030\">$_</font></td></tr>";
}

# Print player chat messages.
# Updated for New Logging Format.
if (/\>\" say/) {
(undef,$_) = split(/L.*: \"/);
($player,$message) = split(/\" say "/);
@PlayerInfo = split(/\</,$player);
$player = $PlayerInfo[0];
$message =~ s/\"//;
$message =~ s/\s+$//;
TagFilter($player);
TagFilter($message);

# Remove words in the banword list.
foreach my $banword (split/,/,$settings{banwords}) {
$banword =~ s/^\s+//;
$banword =~ s/\s+$//;
$message =~ s/\Q$banword/<font
size="1">&#149;&#149;&#149;&#149;&#149;<\/font>/i;
}

$eventinfo .= "<tr><td class=\"chat\" width=\"16\"><img
src=\"$settings{imageurl}/chat.gif\" width=\"16\" height=\"16\"
alt=\"Message from $player\"></td>";
$eventinfo .= "<td class=\"chat\" width=\"25%\" nowrap><font
size=\"1\">$player&nbsp;&nbsp;</font></td>";
$eventinfo .= "<td class=\"chat\" width=\"75%\" width=\"100%\"><font
size=\"2\">$message</font></td></tr>\n";
}
# If team_messages is set to 1, show them.
# Updated for New Logging Format.
if (/\" say_team/) {
if ($settings{team_messages} == "1") {
(undef,$_) = split(/L.*: \"/);
($player,$message) = split(/\" say_team "/);
@PlayerInfo = split(/\</,$player);
$player = $PlayerInfo[0];
$message =~ s/\"//;
$message =~ s/\s+$//;
TagFilter($player);
TagFilter($message);
# Remove words in the banword list.
foreach my $banword (split/,/,$settings{banwords}) {
$banword =~ s/^\s+//;
$banword =~ s/\s+$//;
$message =~ s/\Q$banword/<font
size="1">&#149;&#149;&#149;&#149;&#149;<\/font>/i;
}

$eventinfo .= "<tr><td class=\"teamchat\" width=\"16\"><img
src=\"$settings{imageurl}/chat.gif\" width=\"16\" height=\"16\"
alt=\"Message from $player\"></td>";
$eventinfo .= "<td class=\"teamchat\" width=\"25%\" nowrap><font
size=\"1\">$player&nbsp;&nbsp;</font></td>";
$eventinfo .= "<td class=\"teamchat\" width=\"75%\" width=\"100%\"><font
size=\"2\">$message</font></td></tr>\n";
}
}

# Print kill messages where another player is the cause.
# Updated for New Logging Format.
if (/\" killed/) {
(undef,$_) = split(/L.*: \"/);
($killer,$_) = split(/\" killed \"/);
($killed,$weapon) = split(/\" with "/);
@KillerInfo = split(/\</, $killer);
@KilledInfo = split(/\</, $killed);
($killerteam,$_) = split(/\>/, $KillerInfo[3]);
($killedteam,$_) = split(/\>/, $KilledInfo[3]);
$killer = $KillerInfo[0];
$killed = $KilledInfo[0];
$weapon =~ s/\s+$//;
$weapon =~ s/\"//;
($killerstats = $killer) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
($killedstats = $killed) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
TagFilter($killer);
TagFilter($killed);

# Seperate out kills against Counter-Terrorists
# Updated for New Logging Format.
if (($killerteam eq "CT") and ($killedteam eq "TERRORIST")) {
$eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
alt=\"$killer killed $killed\"></td>";

# If Log_Anal is defined, link each players name to their personal stats
page. Otherwise, just print their name.
if ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$killerstats.$settings{log_anal_extension}") {
$killer = "<a
href=\"$settings{log_anal_url}/$killerstats.$settings{log_anal_extension}\">
$killer</a>";
}

if ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$killedstats.$settings{log_anal_extension}") {
$killed = "<a
href=\"$settings{log_anal_url}/$killedstats.$settings{log_anal_extension}\">
$killed</a>";
}

$eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
size=\"1\">$killer&nbsp;&nbsp;</font></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
size=\"2\">killed $killed with ";

# If Log_Anal is defined, link the weapon name to the weapon stats.
if ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$weapon.$settings{log_anal_extension}") {
$eventinfo .= "<a
href=\"$settings{log_anal_url}/$weapon.$settings{log_anal_extension}\">$weap
onlist{$weapon}</a></font></td></tr>\n";
} else {
$eventinfo .= "$weaponlist{$weapon}</font></a></td></tr>\n";
}

}

# Seperate out kills against Terrorists
# Updated for new Logging Format.
if (($killerteam eq "TERRORIST") and ($killedteam eq "CT")) {
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
alt=\"$killer killed $killed\"></td>";

# If Log_Anal is defined, link each players name to their personal stats
page. Otherwise, just print their name.
if ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$killerstats.$settings{log_anal_extension}") {
$killer = "<a
href=\"$settings{log_anal_url}/$killerstats.$settings{log_anal_extension}\">
$killer</a>";
}

if ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$killedstats.$settings{log_anal_extension}") {
$killed = "<a
href=\"$settings{log_anal_url}/$killedstats.$settings{log_anal_extension}\">
$killed</a>";
}

$eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
size=\"1\">$killer&nbsp;&nbsp;</font></td>";
$eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">killed
$killed with ";

# If Log_Anal is defined, link the weapon name to the weapon stats.
if ($settings{log_anal_url} and -f
"$settings{log_anal_path}/$weapon.$settings{log_anal_extension}") {
$eventinfo .= "<a
href=\"$settings{log_anal_url}/$weapon.$settings{log_anal_extension}\">$weap
onlist{$weapon}</a></font></td></tr>\n";
} else {
$eventinfo .= "$weaponlist{$weapon}</font></a></td></tr>\n";
}

}
# Seperate out teammate kills
# Added for New Logging Format.
if ($killerteam eq $killedteam){
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/teamkill.gif\" width=\"16\" height=\"16\"
alt=\"$killer killed a teammate\"></td>";
$eventinfo .= "<td class=\"system\" width=\"25%\" nowrap><font
size=\"1\">$killer</font></td>";
$eventinfo .= "<td class=\"system\" width=\"75%\"><font
size=\"2\">Killed a teammate</font></td></tr>\n";
}

}

# Print kill messages where the player kills themself.
# Updated for New Logging Format.
if (/\" committed suicide with/) {
(undef,$_) = split(/L.*: \"/);
($killed,$cause) = split(/\<.*\>\" committed suicide with "/);
$cause =~ s/\s+$//;
$cause =~s/\"//;
TagFilter($killed);
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
alt=\"$killed committed suicide\"></td>";
$eventinfo .= "<td class=\"system\" width=\"25%\" nowrap><font
size=\"1\">$killed</font></td>";
$eventinfo .= "<td class=\"system\" width=\"75%\"><font
size=\"2\">committed suicide with $cause</font></td></tr>\n";
}

# Print hostage touch messages.
# Updated for New Logging Format.
if (/Touched_A_Hostage/) {
(undef,$_) = split(/L.*: \"/);
($groper) = split(/\<.*\>\" triggered/);
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
alt=\"$groper touched a hostage\"></td>";
$eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
size=\"1\">$groper</font></td>";
$eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Touched a
hostage</font></td></tr>\n";
}

# Print hostage rescue messages.
# Updated for New Logging Format.
if (/Rescued_A_Hostage/) {
(undef,$_) = split(/L.*: \"/);
($rescuer) = split(/\<.*\>\" triggered/);
TagFilter($rescuer);
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
alt=\"$rescuer rescued a hostage\"></td>";
$eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
size=\"1\">$rescuer</font></td>";
$eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Rescued a
hostage</font></td></tr>\n";
}

# Print hostage kill messages.
# Updated for New Logging Format.
if (/Killed_A_Hostage/) {
(undef,$_) = split(/L.*: \"/);
($killer) = split(/\<.*\>\" triggered/);
TagFilter($killer);
$eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
alt=\"$killer killed a hostage\"></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
size=\"1\">$killer</font></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
size=\"2\">Killed a hostage</font></td></tr>\n";
}

# Print bomb plant messages.
# Updated for New Logging Format.
if (/Planted_The_Bomb/) {
(undef,$_) = split(/L.*: \"/);
($planter) = split(/\<.*\>\" triggered/);
TagFilter($planter);
$eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
alt=\"$planter planted the bomb\"></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
size=\"1\">$planter</font></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
size=\"2\">Planted the bomb</font></td></tr>\n";
}

# Print bomb defuse messages.
# Updated for New Logging Format.
if (/Defused_The_Bomb/) {
(undef,$_) = split(/L.*: \"/);
($defuser) = split(/\<.*\>\" triggered/);
TagFilter($defuser);
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
alt=\"$defuser defused the bomb\"></td>";
$eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
size=\"1\">$defuser</font></td>";
$eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Defused the
bomb</font></td></tr>\n";
}

# Print all hostages rescued messages.
if (/All_Hostages_Rescued/) {
(undef,$_) = split(/L.*: \"/);
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\" alt=\"All
hostages rescued\"></td>";
$eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
size=\"1\">All hostages rescued</font></td></tr>\n";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\" height=\"1\"></td></tr>";
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Counter-Terrorists Win\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
size=\"1\">Round result: <b>Counter-Terrorists Win</b></font></td></tr>\n";
}

# Print hostages not rescued message.
# Updated for New Logging Format
if (/Hostages_Not_Rescued/) {
(undef,$_) = split(/L.*: /);
@RoundInfo = split(/\(/,$_);
$ctscore = $RoundInfo[1];
$terroristscore = $RoundInfo[2];
$ctscore =~ s/CT//;
$terroristscore =~ s/T//;
$ctscore =~ s/\"//;
$ctscore =~ s/\"//;
$terroristscore =~ s/\"//;
$terroristscore =~ s/\"//;
$ctscore =~ s/\)//;
$terroristscore =~ s/\)//;
$ctscore =~ s/ //;
$ctscore =~ s/ //;
$terroristscore =~ s/\ //;
$terroristscore =~ s/\s+$//;
$eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
alt=\"Hostages not rescued\"></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Hostages not rescued</font></td></tr>\n";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\" height=\"1\"></td></tr>";
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Terrorists Win\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
CTs: $ctscore</b></font></td></tr>\n";
}

# Print target successfully bombed messages.
# Updated for New Logging Format
if (/Target_Bombed/) {
(undef,$_) = split(/L.*: /);
@RoundInfo = split(/\(/,$_);
$ctscore = $RoundInfo[1];
$terroristscore = $RoundInfo[2];
$ctscore =~ s/CT//;
$terroristscore =~ s/T//;
$ctscore =~ s/\"//;
$ctscore =~ s/\"//;
$terroristscore =~ s/\"//;
$terroristscore =~ s/\"//;
$ctscore =~ s/\)//;
$terroristscore =~ s/\)//;
$ctscore =~ s/ //;
$ctscore =~ s/ //;
$terroristscore =~ s/\ //;
$terroristscore =~ s/\s+$//;
$eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\" alt=\"Target
successfully bombed\"></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Target successfully bombed</font></td></tr>\n";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\" height=\"1\"></td></tr>";
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Terrorists Win\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
CTs: $ctscore</b></font></td></tr>\n";
}

# Print bomb sucessfully defused messages.
# Updated for New Logging Format
if (/Bomb_Defused/) {
(undef,$_) = split(/L.*: /);
@RoundInfo = split(/\(/,$_);
$ctscore = $RoundInfo[1];
$terroristscore = $RoundInfo[2];
$ctscore =~ s/CT//;
$terroristscore =~ s/T//;
$ctscore =~ s/\"//;
$ctscore =~ s/\"//;
$terroristscore =~ s/\"//;
$terroristscore =~ s/\"//;
$ctscore =~ s/\)//;
$terroristscore =~ s/\)//;
$ctscore =~ s/ //;
$ctscore =~ s/ //;
$terroristscore =~ s/\ //;
$terroristscore =~ s/\s+$//;
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\" alt=\"Bomb
successfully defused\"></td>";
$eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Bomb successfully defused</font></td></tr>\n";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\" height=\"1\"></td></tr>";
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Counter-Terrorists Win\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
Terrorists: $terroristscore</b></font></td></tr>\n";
}

# Print VIP escape messages.
# Updated for New Logging Format
if (/VIP_Escaped/) {
(undef,$_) = split(/L.*: /);
@RoundInfo = split(/\(/,$_);
$ctscore = $RoundInfo[1];
$terroristscore = $RoundInfo[2];
$ctscore =~ s/CT//;
$terroristscore =~ s/T//;
$ctscore =~ s/\"//;
$ctscore =~ s/\"//;
$terroristscore =~ s/\"//;
$terroristscore =~ s/\"//;
$ctscore =~ s/\)//;
$terroristscore =~ s/\)//;
$ctscore =~ s/ //;
$ctscore =~ s/ //;
$terroristscore =~ s/\ //;
$terroristscore =~ s/\s+$//;
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/vip.gif\" width=\"16\" height=\"16\" alt=\"VIP
Escaped\"></td>";
$eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
size=\"1\">VIP escaped</font></td>";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\" height=\"1\"></td></tr>";
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Counter-Terrorists Win\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
Terrorists: $terroristscore</b></font></td></tr>\n";
}

# Print VIP assassination messages.
# Updated for New Logging Format
if (/VIP_Assasinated/) {
(undef,$_) = split(/L.*: /);
@RoundInfo = split(/\(/,$_);
$ctscore = $RoundInfo[1];
$terroristscore = $RoundInfo[2];
$ctscore =~ s/CT//;
$terroristscore =~ s/T//;
$ctscore =~ s/\"//;
$ctscore =~ s/\"//;
$terroristscore =~ s/\"//;
$terroristscore =~ s/\"//;
$ctscore =~ s/\)//;
$terroristscore =~ s/\)//;
$ctscore =~ s/ //;
$ctscore =~ s/ //;
$terroristscore =~ s/\ //;
$terroristscore =~ s/\s+$//;
$eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
src=\"$settings{imageurl}/vip.gif\" width=\"16\" height=\"16\" alt=\"VIP
Assassinated\"></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"100%\" colspan=\"2\"><font
size=\"1\">VIP assassinated</font></td>";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\" height=\"1\"></td></tr>";
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Terrorists Win\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
CTs: $ctscore</b></font></td></tr>\n";
}

# Print Terrorists Win messages.
# Updated for New Logging Format
if (/Terrorists_Win/) {
(undef,$_) = split(/L.*: /);
@RoundInfo = split(/\(/,$_);
$ctscore = $RoundInfo[1];
$terroristscore = $RoundInfo[2];
$ctscore =~ s/CT//;
$terroristscore =~ s/T//;
$ctscore =~ s/\"//;
$ctscore =~ s/\"//;
$terroristscore =~ s/\"//;
$terroristscore =~ s/\"//;
$ctscore =~ s/\)//;
$terroristscore =~ s/\)//;
$ctscore =~ s/ //;
$ctscore =~ s/ //;
$terroristscore =~ s/\ //;
$terroristscore =~ s/\s+$//;
$eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Terrorists Win\"></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Terrorists Win!</font></td>";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\" height=\"1\"></td></tr>";
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Terrorists Win\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
CTs: $ctscore</b></font></td></tr>\n";
}

# Print CTs Win messages.
if (/CTs_Win/) {
(undef,$_) = split(/L.*: /);
@RoundInfo = split(/\(/,$_);
$ctscore = $RoundInfo[1];
$terroristscore = $RoundInfo[2];
$ctscore =~ s/CT//;
$terroristscore =~ s/T//;
$ctscore =~ s/\"//;
$ctscore =~ s/\"//;
$terroristscore =~ s/\"//;
$terroristscore =~ s/\"//;
$ctscore =~ s/\)//;
$terroristscore =~ s/\)//;
$ctscore =~ s/ //;
$ctscore =~ s/ //;
$terroristscore =~ s/\ //;
$terroristscore =~ s/\s+$//;
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\" alt=\"CT's
Win!\"></td>";
$eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
size=\"1\">CTs Win!</font></td>";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\" height=\"1\"></td></tr>";
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Counter-Terrorists Win\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
Terrorists: $terroristscore</b></font></td></tr>\n";
}
# Print player connect messages.
# Updated for New Logging Format
if (/ connected/) {
(undef,$_) = split(/L.*: \"/);
($player,$_) = split(/connected, /);
@PlayerInfo = split(/\</, $player);
$player = $PlayerInfo[0];
TagFilter($player);
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/conn.gif\" width=\"16\" height=\"16\"
alt=\"$player joined the server\"></td>";
$eventinfo .= "<td class=\"system\" width=\"25%\"><font
size=\"1\">$player</font></td>";
$eventinfo .= "<td class=\"system\" width=\"75%\"><font size=\"2\">joined
the server</font></td></tr>\n";
}

# Print player disconnect messages.
# Updated for new Logging format
if (/\" disconnected/) {
(undef,$_) = split(/L.*: \"/);
($player,$_) = split(/\" disconnected/);
@PlayerInfo = split(/\</,$player);
$player = @PlayerInfo[0];
TagFilter($player);
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/disconn.gif\" width=\"16\" height=\"16\"
alt=\"$player left the server\"></td>";
$eventinfo .= "<td class=\"system\" width=\"25%\"><font
size=\"1\">$player</font></td>";
$eventinfo .= "<td class=\"system\" width=\"75%\"><font size=\"2\">left the
server</font></td></tr>\n";
}

# Print player team join messages.
# Updated for New Logging Format.
if (/ joined team /) {
(undef,$_) = split(/L.*: \"/);
($player,$team) = split(/ joined team /);
@PlayerInfo = split(/\</,$player);
$team =~ s/\s+$//;
$team =~ s/\"//;
$team =~ s/\"//;
$player = $PlayerInfo[0];
TagFilter($player);
if ($team eq "CT") {
$eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"$player joined the Counter-Terrorist team\"></td>";
$eventinfo .= "<td class=\"ct\" width=\"25%\"><font
size=\"1\">$player</font></td>";
$eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">joined the
Counter-Terrorist team</font></td></tr>\n";
}
if ($team eq "TERRORIST") {
$eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"$player joined the Terrorist team\"></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"25%\"><font
size=\"1\">$player</font></td>";
$eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
size=\"2\">joined the Terrorist team</font></td></tr>\n";
}
}

# Print team scores.
# Seperate out Counter-Terrorist wins.
# Updated for New Logging Format
if (/Team "CT" scored/) {
(undef,$_) = split(/L.*: /);
@GameInfo = split(/\"/,$_);
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Counter-Terrorist Wins\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Counter-Terrorist Wins: <b>Scored $GameInfo[3] with $GameInfo[5]
Players</b></font></td></tr>\n";
}

# Seperate out Terrorist wins.
# Updated for New Logging Format
if (/Team "TERRORIST" scored/) {
(undef,$_) = split(/L.*: /);
@GameInfo = split(/\"/,$_);
$eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"Terrorist Wins\"></td>";
$eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
size=\"1\">Terrorist Wins: <b>Scored $GameInfo[3] with $GameInfo[5]
Players</b></font></td></tr>\n";
$eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
src=\"$settings{imageurl}/trans.gif\" width=\"1\"
height=\"1\"></td></tr>"; }
}

# Output to the web browser
print "Content-type: text/html\n\n";
print "<!-- generated by csserverstat -
http://server.counter-strike.net/csserverstat -->\n\n";

open(TEMPLATE,"$settings{template}");

foreach $_ (<TEMPLATE>) {
$_ =~ s/(\$\w+\{\w+\})/$1/eeg;
$_ =~ s/(\$\w+)/$1/eeg;
print $_;
}

close(TEMPLATE);

# End script.
exit;



 
 
Thorbjørn Ravn Ander~ (15-06-2001)
Kommentar
Fra : Thorbjørn Ravn Ander~


Dato : 15-06-01 08:17

Jimmy Marcus Larsen wrote:
>
> Hej!
>
> Jeg har nogle problemer med et Perl-script jeg har hentet fra nettet. Det er
> et script der skal vise hvor mange spillere der er på en Counter Strike
> server.
> Min Linux Apache server kommer med en "Internal Server Error 500" i
> browseren når jeg forsøger at køre scriptet. I Apache's Error Log står der
> "Premature end of script headers". Hvad betyder det?

at der mangler et linieskift inden den begynder at skrive resultatet ud;
så apache tror den stadig er i gang med at skriver script headers ud:

jeg har ikke kigget på koden; men det er det der er galt:

Jimmy Marcus Larsen (17-06-2001)
Kommentar
Fra : Jimmy Marcus Larsen


Dato : 17-06-01 09:55

mange tak!


"Thorbjørn Ravn Andersen" <thunderbear@bigfoot.com> wrote in message
news:3B29B684.8FC6A03C@bigfoot.com...
> Jimmy Marcus Larsen wrote:
> >
> > Hej!
> >
> > Jeg har nogle problemer med et Perl-script jeg har hentet fra nettet.
Det er
> > et script der skal vise hvor mange spillere der er på en Counter Strike
> > server.
> > Min Linux Apache server kommer med en "Internal Server Error 500" i
> > browseren når jeg forsøger at køre scriptet. I Apache's Error Log står
der
> > "Premature end of script headers". Hvad betyder det?
>
> at der mangler et linieskift inden den begynder at skrive resultatet ud;
> så apache tror den stadig er i gang med at skriver script headers ud:
>
> jeg har ikke kigget på koden; men det er det der er galt:



Lars Christiansen (15-06-2001)
Kommentar
Fra : Lars Christiansen


Dato : 15-06-01 08:13

Det skyldes at du ikke har to (2) linieskift efter din Content-Type.

-Lars

Jimmy Marcus Larsen wrote:

> Hej!
>
> Jeg har nogle problemer med et Perl-script jeg har hentet fra nettet. Det
> er et script der skal vise hvor mange spillere der er på en Counter Strike
> server.
> Min Linux Apache server kommer med en "Internal Server Error 500" i
> browseren når jeg forsøger at køre scriptet. I Apache's Error Log står der
> "Premature end of script headers". Hvad betyder det?
> Jeg har et lille script der bare siger "testing 1, 2, 3" som virker fint
> så jeg tror ik det er Apache's mod_perl modul der ik er konfigureret
> korrekt.
>
> Her er scriptet som ik fungerer... Det er lidt langt
>
>
> #!/usr/bin/perl -T
> use POSIX qw(strftime);
> use Net::hostent;
> use Socket;
>
>
############################################################################
> ####
> # csserverstat.pl - A server info and log parser for Half-Life
> Counter-Strike #
> # servers.
> #
>
############################################################################
> ####
> # http://server.counter-strike.net/csserverstat
> #
> # Version 1.06 #
> # Modified 3/24/01 for new CS1.1 Logging format by Neo
> #
>
############################################################################
> ####
>
>
> # Set the path to your configuration file here. Make sure you use forward
> slashes, even if you are running Windows (i.e.
> c:/wwwroot/cgi-bin/csserverstat.conf).
>
> $settings{configfile} = "/var/www/html/csserverstat/csserverstat.conf";
>
>
>
############################################################################
> ####
> # Do not modify anything below this line!
> #
>
############################################################################
> ####
>
> $settings{version} = "1.06";
>
> # Weapon display list.
> %weaponlist = (
> knife => "a Knife",
> glock18 => "a Glock 18 9mm",
> usp => "a H&K USP Tactical .45",
> deagle => "a Desert Eagle .50",
> p228 => "a Sig Sauer P-228 9mm",
> elite => "a Beretta 96G Elite 9mm",
> fiveseven => "a FN Five-Seven 5.7mm",
> m3 => "a Bernelli M3 Super 90 12 gauge",
> xm1014 => "a Bernelli XM1014 12 gauge",
> mp5navy => "a H&K MP5/Navy 9mm",
> tmp => "a Steyr Tactical Machine Pistol 9mm",
> p90 => "a FN P90 5.7mm",
> mac10 => "an Ingram Mac-10 9mm",
> ump45 => "a H&K UMP .45",
> awp => "an Arctic Warfare/Magnum (AWM) .338",
> g3sg1 => "a H&K G3/SG-1 7.62mm",
> scout => "a Steyr Scout 7.62mm",
> aug => "a Steyr Aug 5.56mm",
> m4a1 => "a Colt M4/A1 5.56mm",
> sg550 => "a Sig SG-550 Sniper 5.56mm",
> sg552 => "a Sig SG-552 Commando 5.56mm",
> ak47 => "an AK47 7.62mm",
> m249 => "a FN M-249 PARA 5.56mm",
> grenade => "a High-Explosive Grenade",
> );
>
> # This subrouting will replace any occurance of "<" or ">" with their web
> tag codes of "&#60;" and "&#62;", respectively.
> sub TagFilter {
> $_[0] =~ s/</&#60;/g;
> $_[0] =~ s/>/&#62;/g;
> }
>
> # Get configuration pairs and place them in %settings.
> if (!-f $settings{configfile}) {
> print "Content-type: text/html\n\n<h3>Unable to open configuration file
> \"$settings{configfile}\".<p>Check your server's file and directory
> permissions, as well as your\$configfile setting in
> csserverstat.pl.</h3>";
> exit;
> }
>
> open(CONFIG,"$settings{configfile}");
>
> foreach $_ (<CONFIG>) {
> chop;
> s/^\s+//;
> s/\s+$//;
> next if /^$/;
> next if /^#/;
> s/\s*#.*//;
> (my $setting,my $value) = split(/=/);
> $setting =~ s/^\s+//;
> $setting =~ s/\s+$//;
> $value =~ s/^\s+//;
> $value =~ s/\s+$//;
> $settings{$setting} = $value;
> }
>
> close CONFIG;
>
> # Check to see if all our path settings are ok.
> if (!-f $settings{template}) {
> print "Content-type: text/html\n\n<h3>Unable to open template
> \"$settings{template}\".<p>Check your server's file and directory
> permissions, as well as your \"template\" setting in
> $settings{configfile}.</h3>";
> exit;
> }
>
> if (!-e $settings{logdir} and !-d $settings{logdir}) {
> print "Content-type: text/html\n\n<h3>Unable to open directory
> \"$settings{logdir}\".<p>Check your server's file and directory
> permissions, as well as your \"logdir\" setting in
> $settings{configfile}.</h3>";
> exit;
> }
>
> if (!-e $settings{qstatpath} or !-d $settings{qstatpath}) {
> print "Content-type: text/html\n\n<h3>Unable to locate the QStat
> directory, or \"$settings{qstatpath}\" is not a directory.<p>Check your
> server's file and directory permissions, as well as your \"qstatpath\" in
> $settings{configfile}.</h3>";
> exit;
> }
>
> if ($settings{log_anal_url} and $settings{log_anal_path}) {
>
> if (!-e $settings{log_anal_path} or !-d $settings{log_anal_path}) {
> print "Content-type: text/html\n\n<h3>Unable to open directory
> \"$settings{log_anal_path}\".<p>Check your server's file and directory
> permissions, as well as your \"log_anal_path\" setting in
> $settings{configfile}.</h3>";
> exit;
> }
>
> }
>
> # Get configuration settings that were entered into the URL, if any.
> $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
>
> if ($ENV{'REQUEST_METHOD'} eq "POST") {
> read(STDIN, $in, $ENV{'CONTENT_LENGTH'});
> } else {
> $in = $ENV{'QUERY_STRING'};
> }
>
> my @settings = split(/&/, $in);
>
> foreach my $settings (@settings) {
> (my $setting, my $value) = split(/=/, $settings);
> $setting =~ tr/+/ /;
> $setting =~ s/%(..)/pack("C", hex($1))/eg;
> $value =~ tr/+/ /;
> $value =~ s/%(..)/pack("C", hex($1))/eg;
> TagFilter($setting);
> TagFilter($value);
>
> if ($setting eq "server") {
> ($settings{serverip},$settings{serverport}) = split(/:/,$value);
> }
>
> if ($setting eq "events") {
> $settings{numevents} = $value;
> }
>
> if ($setting eq "refresh") {
> $settings{refresh} = $value;
> }
>
> }
>
> # Get the local time.
> $now = localtime;
>
> $tmp = gethost($settings{serverip});
>
> if ($tmp) {
> $settings{serverip} = inet_ntoa($tmp->addr);
> }
>
> # Determine the current log file.
> opendir(LOGDIR,"$settings{logdir}");
> @logdir = sort (grep (/$settings{serverip}/,readdir(LOGDIR)));
> closedir(LOGDIR);
> $settings{logfile} = pop(@logdir);
>
> # Read the current log file and look for defined events. We assume that
> # the
> file is readable since the script was able to view the directory to figure
> out which file to use.
> open(LOGFILE,"$settings{logdir}/$settings{logfile}");
> @logdata = grep ( /\>\" say/|
> /\" say_team/|
> /\" killed/|
> /\" committed suicide with/|
> /Touched_A_Hostage/|
> /Rescued_A_Hostage/|
> /Killed_A_Hostage/|
> /killed a teammate/|
> /Planted_The_Bomb/|
> /Defused_The_Bomb/|
> /Target_Bombed/|
> /Bomb_Defused/|
> /All_Hostages_Rescued/|
> /Hostages_Not_Rescued/|
> /VIP_Escaped/|
> /VIP_Assasinated/|
> /Terrorists_Win/|
> /CTs_Win/|
> /connected,/|
> /\" disconnected/|
> /Team "CT" scored/|
> /Team "TERRORIST" scored/|
> /joined team /
> ,<LOGFILE>);
> close(LOGFILE);
>
> # Don't go outside our allowable range for refresh and event display.
> if ($settings{refresh} < $settings{minrefresh}) {
> $settings{refresh} = $settings{minrefresh};
> } else {
> $settings{refresh} = $settings{defrefresh} unless $settings{refresh};
> }
>
> if ($settings{numevents} > $settings{maxevents}) {
> $settings{numevents} = $settings{maxevents};
> } else {
> $settings{numevents} = $settings{defevents} unless $settings{numevents};
> }
>
> # The majority of the URL for each event setting change link is the same
> # and
> is defined here for convenience.
> $cgiurl =
>
"refresh=$settings{refresh}&server=$settings{serverip}:$settings{serverport}
> ";
>
> # Get game server, player, and rule information from QStat.
> @qstatoptions = ("-R","-P","-tsw","-raw","!@#@!","-hls");
> my($qstat) = open(QSTAT,"-|");
> die "Couldn't open pipe to subprocess" unless defined($qstat);
>
system("$settings{qstatpath}/qstat",@qstatoptions,"$settings{serverip}:$sett
> ings{serverport}") or die "Couldn't exec qstat" if $qstat == 0;
> @qstat = <QSTAT>;
> close QSTAT;
>
> chomp(@qstat);
> $serverstat = shift(@qstat);
> $ruleslist = shift(@qstat);
> @playerlines = @qstat;
> ($type,$ip,$servername,$map,$maxplayers,$curplayers,$ping,$timeout) =
> split(/!@#@!/,$serverstat);
>
> if (!-e "$settings{imagepath}\/$map.jpg") {
> $mapimage = "default.jpg";
> } else {
> $mapimage = "$map.jpg";
> }
>
> # If debug mode is on, place the %settings hash in $debug.
> if ($settings{debug} == 1) {
> $debug .= "<table cellspacing=\"0\" cellpadding=\"0\"
> width=\"100%\">\n";
>
> foreach $setting (sort (keys %settings)) {
> $debug .= "<tr><td nowrap><font size=\"1\"
> color=\"#808080\">$setting</font></td><td><font size=\"1\"
> color=\"#E0E0E0\">&nbsp;=&nbsp;</font></td><td width=\"100%\"><font
> size=\"1\" color=\"#E0E0E0\">$settings{$setting}</font></td></tr>\n";
> }
>
> $debug .= "</table>\n<hr size=\"1\" width=\"100%\">";
> }
>
> # If HLMaps is defined, link the map name and image to HLMaps. If HLMaps
> # is
> not defined but Log_Anal is, link the map name and image to Log_Anal.
> Otherwise, leave it alone.
> if ($settings{hlmaps}) {
> $mapname = "<a href=\"$settings{hlmaps}?map=$map\">$map</a>";
> } elsif ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$map.$settings{log_anal_extension}") {
> $mapname = "<a
>
href=\"$settings{log_anal_url}/$map.$settings{log_anal_extension}\">$map</a>
> ";
> } else {
> $mapname = $map;
> }
>
> if ($settings{hlmaps}) {
> $mapimage = "<a href=\"$settings{hlmaps}?map=$map\"><img class=\"map\"
> src=\"$settings{imageurl}/$mapimage\" width=\"212\" height=\"160\"
> alt=\"Current map is $map.\"></a>";
> } elsif ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$map.$settings{log_anal_extension}") {
> $mapimage = "<a
> href=\"$settings{log_anal_url}/$map.$settings{log_anal_extension}\"><img
> class=\"map\" src=\"$settings{imageurl}/$mapimage\" width=\"212\"
> height=\"160\" alt=\"Current map is $map.\"></a>";
> } else {
> $mapimage = "<img class=\"map\" src=\"$settings{imageurl}/$mapimage\"
> width=\"212\" height=\"160\" alt=\"Current map is $map.\">";
> }
>
> # Build the players list.
> # Get the player list.
> if (@playerlines) {
>
> while ($_ = shift @playerlines) {
> ++$count1;
> ($playername,$frags,$timeonserver) = split(/!@#@!/);
>
> # Sort the player list by frags.
> push @playernamelist, $playername;
> %playerlist = (
> frags => $frags,
> time => $timeonserver
> );
> for my $what (keys %playerlist) {
> $player{$playername}{$what} = $playerlist{$what};
> }
>
> }
>
> } else {
>
> push @playernamelist, "None connected!";
> $player{"None connected!"}{time} = "00:00";
> ++$count1;
>
> }
>
> sub byfrag {
> $player{$b}{frags} <=> $player{$a}{frags};
> }
>
> foreach $playername (sort byfrag @playernamelist) {
> $frags = $player{$playername}{frags};
> $timeonserver = $player{$playername}{time};
> ($playerstats = $playername) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
>
> # Limit displayed player names to the maxplayername setting.
> $playername =~ s/(^.{$settings{maxplayername}}(?!$))(.*$)/$1.../g;
> TagFilter($playername);
>
> # Format the time on server display.
> ($hours,$minutes,$seconds) = split(/:/,$timeonserver);
>
> if ($hours eq "00") {
> $hours = "";
> $minutes =~ s/0//;
> } else {
> $hours = $hours.":";
> $hours =~ s/0//;
> }
>
> if ($minutes eq "0") {
> $minutes = "";
> } else {
> $minutes = $minutes.":";
> }
>
> $playerinfo .= "<tr><td class=\"playerlist\" nowrap><font
> size=\"1\">&nbsp;";
>
> # If any admins are present indicate them.
> foreach my $admin (split/,/,$settings{admins}) {
> $admin =~ s/^\s+//;
> $admin =~ s/\s+$//;
> TagFilter($admin);
> if ($playername eq $admin) {
> $playername = "$playername<font class=\"admin\">&#149;</font>";
> }
> }
>
> # If Log_Anal is defined, link each players name to their personal stats
> page. Otherwise, just print their name.
> if ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$playerstats.$settings{log_anal_extension}") {
> $playerinfo .= "<a
>
href=\"$settings{log_anal_url}/$playerstats.$settings{log_anal_extension}\">
> $playername</a></font></td>";
> } else {
> $playerinfo .= "$playername</font></td>";
> }
>
> $playerinfo .= "<td class=\"playerlist\" align=\"right\"><font
> size=\"1\">&nbsp;$frags&nbsp;</font></td>";
> $playerinfo .= "<td class=\"playerlist\" align=\"right\" nowrap><font
> size=\"1\">&nbsp;$hours$minutes$seconds&nbsp;</font></td></tr>\n";
>
> }
>
> # Show blank lines up to the server's maxplayer setting. Looks nice.
> while ($count1 < $maxplayers) {
> ++$count1;
> $playerinfo .= "<tr><td class=\"playerlist\" colspan=\"3\"><font
> size=\"1\">&nbsp;</td></tr>\n";
> }
>
> # Build the rules list.
> # Get and format the rules list.
> foreach (sort(split /!@#@!/, $ruleslist)) {
> ($rule,$value) = split(/=/);
> TagFilter($rule);
> TagFilter($value);
>
> if ($value eq 0) {
> $value = "<font color=\"#303030\">&#149;</font>";
> } elsif ($value eq 1) {
> $value = "<font color=\"#009900\">&#149;</font>";
> }
>
> if ($rule eq "sv_contact") {
> $value = "<a href=\"mailto:$value\">$value</a>";
> }
>
> if ($rule eq "mp_mapvoteratio") {
> $value = $value*100; $value = "$value%";
> }
>
> if (($rule eq "gamename") && ($value eq "CounterStrike")) {
> $value = "<a href=\"http://www.counter-strike.net\">CounterStrike";
> }
>
> if (($rule eq "sv_os") && ($value eq "linux")) {
> $value = "<a href=\"http://www.linux.org\">Linux";
> } elsif (($rule eq "sv_os") && ($value eq "windows")) {
> $value = "<a href=\"http://www.microsoft.com/windows\">Windows";
> }
>
> # Defines which rules to show.
> if ( /mp_mapvoteratio/ or
> /mp_forcechasecam/ or
> /mp_tkpunish/ or
> /mp_autoteambalance/ or
> /mp_limitteams/ or
> /mp_autokick/ or
> /mp_c4timer/ or
> /sv_os/ or
> /mp_roundtime/ or
> /mp_flashlight/ or
> /mp_friendlyfire/ or
> /mp_timelimit/ or
> /sv_maxrate/ or
> /sv_minrate/ or
> /sv_cheats/ or
> /sv_type/ or
> /mp_hostagepenalty/ or
> /mp_footsteps/ or
> /gamename/ or
> /sv_contact/ ) {
> ++$count2;
> $rulesinfo .= "<tr><td class=\"ruleslist\"><font
> size=\"1\">&nbsp;$rule</font></td>";
> $rulesinfo .= "<td class=\"ruleslist\" align=\"right\" nowrap><font
> size=\"1\">$value&nbsp;</font></td></tr>\n";
> }
>
> }
>
> # Make the rules list at least as big as the player list if it isn't
> already. Looks nice.
> while ($count2 < $count1) {
> ++$count2;
> $rulesinfo .= "<tr><td class=\"ruleslist\" colspan=\"3\"><font
> size=\"1\">&nbsp;</td></tr>\n";
> }
>
> # Build the events list
> # Grab the last x events according to what $numevents is set to.
> while ($popcount < $settings{numevents}) {
> ++$popcount;
> my $newlogdata = pop @logdata;
> push @newlogdata, $newlogdata;
> }
>
> # If enabled, reverse the event order so that new events are on top.
> if ($settings{reverse_order} == "1") {
> @logdata = @newlogdata;
> } else {
> @logdata = reverse (@newlogdata);
> }
>
> # This is where the log file data gets parsed out to HTML.
> foreach $_ (@logdata) {
>
> # If debug is on, $eventinfo .= the raw log file message.
> if ($settings{debug} == 1) {
> ++$messagecount;
> $eventinfo .= "<tr><td bgcolor=\"#D0D0D0\"></td>";
> $eventinfo .= "<td colspan=\"2\" bgcolor=\"#D0D0D0\"><font size=\"1\"
> color=\"#303030\">$_</font></td></tr>";
> }
>
> # Print player chat messages.
> # Updated for New Logging Format.
> if (/\>\" say/) {
> (undef,$_) = split(/L.*: \"/);
> ($player,$message) = split(/\" say "/);
> @PlayerInfo = split(/\</,$player);
> $player = $PlayerInfo[0];
> $message =~ s/\"//;
> $message =~ s/\s+$//;
> TagFilter($player);
> TagFilter($message);
>
> # Remove words in the banword list.
> foreach my $banword (split/,/,$settings{banwords}) {
> $banword =~ s/^\s+//;
> $banword =~ s/\s+$//;
> $message =~ s/\Q$banword/<font
> size="1">&#149;&#149;&#149;&#149;&#149;<\/font>/i;
> }
>
> $eventinfo .= "<tr><td class=\"chat\" width=\"16\"><img
> src=\"$settings{imageurl}/chat.gif\" width=\"16\" height=\"16\"
> alt=\"Message from $player\"></td>";
> $eventinfo .= "<td class=\"chat\" width=\"25%\" nowrap><font
> size=\"1\">$player&nbsp;&nbsp;</font></td>";
> $eventinfo .= "<td class=\"chat\" width=\"75%\" width=\"100%\"><font
> size=\"2\">$message</font></td></tr>\n";
> }
> # If team_messages is set to 1, show them.
> # Updated for New Logging Format.
> if (/\" say_team/) {
> if ($settings{team_messages} == "1") {
> (undef,$_) = split(/L.*: \"/);
> ($player,$message) = split(/\" say_team "/);
> @PlayerInfo = split(/\</,$player);
> $player = $PlayerInfo[0];
> $message =~ s/\"//;
> $message =~ s/\s+$//;
> TagFilter($player);
> TagFilter($message);
> # Remove words in the banword list.
> foreach my $banword (split/,/,$settings{banwords}) {
> $banword =~ s/^\s+//;
> $banword =~ s/\s+$//;
> $message =~ s/\Q$banword/<font
> size="1">&#149;&#149;&#149;&#149;&#149;<\/font>/i;
> }
>
> $eventinfo .= "<tr><td class=\"teamchat\" width=\"16\"><img
> src=\"$settings{imageurl}/chat.gif\" width=\"16\" height=\"16\"
> alt=\"Message from $player\"></td>";
> $eventinfo .= "<td class=\"teamchat\" width=\"25%\" nowrap><font
> size=\"1\">$player&nbsp;&nbsp;</font></td>";
> $eventinfo .= "<td class=\"teamchat\" width=\"75%\" width=\"100%\"><font
> size=\"2\">$message</font></td></tr>\n";
> }
> }
>
> # Print kill messages where another player is the cause.
> # Updated for New Logging Format.
> if (/\" killed/) {
> (undef,$_) = split(/L.*: \"/);
> ($killer,$_) = split(/\" killed \"/);
> ($killed,$weapon) = split(/\" with "/);
> @KillerInfo = split(/\</, $killer);
> @KilledInfo = split(/\</, $killed);
> ($killerteam,$_) = split(/\>/, $KillerInfo[3]);
> ($killedteam,$_) = split(/\>/, $KilledInfo[3]);
> $killer = $KillerInfo[0];
> $killed = $KilledInfo[0];
> $weapon =~ s/\s+$//;
> $weapon =~ s/\"//;
> ($killerstats = $killer) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
> ($killedstats = $killed) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
> TagFilter($killer);
> TagFilter($killed);
>
> # Seperate out kills against Counter-Terrorists
> # Updated for New Logging Format.
> if (($killerteam eq "CT") and ($killedteam eq "TERRORIST")) {
> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
> alt=\"$killer killed $killed\"></td>";
>
> # If Log_Anal is defined, link each players name to their personal stats
> page. Otherwise, just print their name.
> if ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$killerstats.$settings{log_anal_extension}") {
> $killer = "<a
>
href=\"$settings{log_anal_url}/$killerstats.$settings{log_anal_extension}\">
> $killer</a>";
> }
>
> if ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$killedstats.$settings{log_anal_extension}") {
> $killed = "<a
>
href=\"$settings{log_anal_url}/$killedstats.$settings{log_anal_extension}\">
> $killed</a>";
> }
>
> $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
> size=\"1\">$killer&nbsp;&nbsp;</font></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
> size=\"2\">killed $killed with ";
>
> # If Log_Anal is defined, link the weapon name to the weapon stats.
> if ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$weapon.$settings{log_anal_extension}") {
> $eventinfo .= "<a
>
href=\"$settings{log_anal_url}/$weapon.$settings{log_anal_extension}\">$weap
> onlist{$weapon}</a></font></td></tr>\n";
> } else {
> $eventinfo .= "$weaponlist{$weapon}</font></a></td></tr>\n";
> }
>
> }
>
> # Seperate out kills against Terrorists
> # Updated for new Logging Format.
> if (($killerteam eq "TERRORIST") and ($killedteam eq "CT")) {
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
> alt=\"$killer killed $killed\"></td>";
>
> # If Log_Anal is defined, link each players name to their personal stats
> page. Otherwise, just print their name.
> if ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$killerstats.$settings{log_anal_extension}") {
> $killer = "<a
>
href=\"$settings{log_anal_url}/$killerstats.$settings{log_anal_extension}\">
> $killer</a>";
> }
>
> if ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$killedstats.$settings{log_anal_extension}") {
> $killed = "<a
>
href=\"$settings{log_anal_url}/$killedstats.$settings{log_anal_extension}\">
> $killed</a>";
> }
>
> $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
> size=\"1\">$killer&nbsp;&nbsp;</font></td>";
> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">killed
> $killed with ";
>
> # If Log_Anal is defined, link the weapon name to the weapon stats.
> if ($settings{log_anal_url} and -f
> "$settings{log_anal_path}/$weapon.$settings{log_anal_extension}") {
> $eventinfo .= "<a
>
href=\"$settings{log_anal_url}/$weapon.$settings{log_anal_extension}\">$weap
> onlist{$weapon}</a></font></td></tr>\n";
> } else {
> $eventinfo .= "$weaponlist{$weapon}</font></a></td></tr>\n";
> }
>
> }
> # Seperate out teammate kills
> # Added for New Logging Format.
> if ($killerteam eq $killedteam){
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/teamkill.gif\" width=\"16\" height=\"16\"
> alt=\"$killer killed a teammate\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"25%\" nowrap><font
> size=\"1\">$killer</font></td>";
> $eventinfo .= "<td class=\"system\" width=\"75%\"><font
> size=\"2\">Killed a teammate</font></td></tr>\n";
> }
>
> }
>
> # Print kill messages where the player kills themself.
> # Updated for New Logging Format.
> if (/\" committed suicide with/) {
> (undef,$_) = split(/L.*: \"/);
> ($killed,$cause) = split(/\<.*\>\" committed suicide with "/);
> $cause =~ s/\s+$//;
> $cause =~s/\"//;
> TagFilter($killed);
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
> alt=\"$killed committed suicide\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"25%\" nowrap><font
> size=\"1\">$killed</font></td>";
> $eventinfo .= "<td class=\"system\" width=\"75%\"><font
> size=\"2\">committed suicide with $cause</font></td></tr>\n";
> }
>
> # Print hostage touch messages.
> # Updated for New Logging Format.
> if (/Touched_A_Hostage/) {
> (undef,$_) = split(/L.*: \"/);
> ($groper) = split(/\<.*\>\" triggered/);
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> alt=\"$groper touched a hostage\"></td>";
> $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
> size=\"1\">$groper</font></td>";
> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Touched a
> hostage</font></td></tr>\n";
> }
>
> # Print hostage rescue messages.
> # Updated for New Logging Format.
> if (/Rescued_A_Hostage/) {
> (undef,$_) = split(/L.*: \"/);
> ($rescuer) = split(/\<.*\>\" triggered/);
> TagFilter($rescuer);
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> alt=\"$rescuer rescued a hostage\"></td>";
> $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
> size=\"1\">$rescuer</font></td>";
> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Rescued a
> hostage</font></td></tr>\n";
> }
>
> # Print hostage kill messages.
> # Updated for New Logging Format.
> if (/Killed_A_Hostage/) {
> (undef,$_) = split(/L.*: \"/);
> ($killer) = split(/\<.*\>\" triggered/);
> TagFilter($killer);
> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> alt=\"$killer killed a hostage\"></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
> size=\"1\">$killer</font></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
> size=\"2\">Killed a hostage</font></td></tr>\n";
> }
>
> # Print bomb plant messages.
> # Updated for New Logging Format.
> if (/Planted_The_Bomb/) {
> (undef,$_) = split(/L.*: \"/);
> ($planter) = split(/\<.*\>\" triggered/);
> TagFilter($planter);
> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
> alt=\"$planter planted the bomb\"></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
> size=\"1\">$planter</font></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
> size=\"2\">Planted the bomb</font></td></tr>\n";
> }
>
> # Print bomb defuse messages.
> # Updated for New Logging Format.
> if (/Defused_The_Bomb/) {
> (undef,$_) = split(/L.*: \"/);
> ($defuser) = split(/\<.*\>\" triggered/);
> TagFilter($defuser);
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
> alt=\"$defuser defused the bomb\"></td>";
> $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
> size=\"1\">$defuser</font></td>";
> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Defused
> the
> bomb</font></td></tr>\n";
> }
>
> # Print all hostages rescued messages.
> if (/All_Hostages_Rescued/) {
> (undef,$_) = split(/L.*: \"/);
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> alt=\"All hostages rescued\"></td>";
> $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">All hostages rescued</font></td></tr>\n";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>";
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Counter-Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
> size=\"1\">Round result: <b>Counter-Terrorists
> Win</b></font></td></tr>\n";
> }
>
> # Print hostages not rescued message.
> # Updated for New Logging Format
> if (/Hostages_Not_Rescued/) {
> (undef,$_) = split(/L.*: /);
> @RoundInfo = split(/\(/,$_);
> $ctscore = $RoundInfo[1];
> $terroristscore = $RoundInfo[2];
> $ctscore =~ s/CT//;
> $terroristscore =~ s/T//;
> $ctscore =~ s/\"//;
> $ctscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $ctscore =~ s/\)//;
> $terroristscore =~ s/\)//;
> $ctscore =~ s/ //;
> $ctscore =~ s/ //;
> $terroristscore =~ s/\ //;
> $terroristscore =~ s/\s+$//;
> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> alt=\"Hostages not rescued\"></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Hostages not rescued</font></td></tr>\n";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>";
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
> size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
> CTs: $ctscore</b></font></td></tr>\n";
> }
>
> # Print target successfully bombed messages.
> # Updated for New Logging Format
> if (/Target_Bombed/) {
> (undef,$_) = split(/L.*: /);
> @RoundInfo = split(/\(/,$_);
> $ctscore = $RoundInfo[1];
> $terroristscore = $RoundInfo[2];
> $ctscore =~ s/CT//;
> $terroristscore =~ s/T//;
> $ctscore =~ s/\"//;
> $ctscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $ctscore =~ s/\)//;
> $terroristscore =~ s/\)//;
> $ctscore =~ s/ //;
> $ctscore =~ s/ //;
> $terroristscore =~ s/\ //;
> $terroristscore =~ s/\s+$//;
> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
> alt=\"Target successfully bombed\"></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Target successfully bombed</font></td></tr>\n";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>";
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
> size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
> CTs: $ctscore</b></font></td></tr>\n";
> }
>
> # Print bomb sucessfully defused messages.
> # Updated for New Logging Format
> if (/Bomb_Defused/) {
> (undef,$_) = split(/L.*: /);
> @RoundInfo = split(/\(/,$_);
> $ctscore = $RoundInfo[1];
> $terroristscore = $RoundInfo[2];
> $ctscore =~ s/CT//;
> $terroristscore =~ s/T//;
> $ctscore =~ s/\"//;
> $ctscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $ctscore =~ s/\)//;
> $terroristscore =~ s/\)//;
> $ctscore =~ s/ //;
> $ctscore =~ s/ //;
> $terroristscore =~ s/\ //;
> $terroristscore =~ s/\s+$//;
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\" alt=\"Bomb
> successfully defused\"></td>";
> $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Bomb successfully defused</font></td></tr>\n";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>";
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Counter-Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
> Terrorists: $terroristscore</b></font></td></tr>\n";
> }
>
> # Print VIP escape messages.
> # Updated for New Logging Format
> if (/VIP_Escaped/) {
> (undef,$_) = split(/L.*: /);
> @RoundInfo = split(/\(/,$_);
> $ctscore = $RoundInfo[1];
> $terroristscore = $RoundInfo[2];
> $ctscore =~ s/CT//;
> $terroristscore =~ s/T//;
> $ctscore =~ s/\"//;
> $ctscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $ctscore =~ s/\)//;
> $terroristscore =~ s/\)//;
> $ctscore =~ s/ //;
> $ctscore =~ s/ //;
> $terroristscore =~ s/\ //;
> $terroristscore =~ s/\s+$//;
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/vip.gif\" width=\"16\" height=\"16\" alt=\"VIP
> Escaped\"></td>";
> $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">VIP escaped</font></td>";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>";
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Counter-Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
> Terrorists: $terroristscore</b></font></td></tr>\n";
> }
>
> # Print VIP assassination messages.
> # Updated for New Logging Format
> if (/VIP_Assasinated/) {
> (undef,$_) = split(/L.*: /);
> @RoundInfo = split(/\(/,$_);
> $ctscore = $RoundInfo[1];
> $terroristscore = $RoundInfo[2];
> $ctscore =~ s/CT//;
> $terroristscore =~ s/T//;
> $ctscore =~ s/\"//;
> $ctscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $ctscore =~ s/\)//;
> $terroristscore =~ s/\)//;
> $ctscore =~ s/ //;
> $ctscore =~ s/ //;
> $terroristscore =~ s/\ //;
> $terroristscore =~ s/\s+$//;
> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> src=\"$settings{imageurl}/vip.gif\" width=\"16\" height=\"16\" alt=\"VIP
> Assassinated\"></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">VIP assassinated</font></td>";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>";
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
> CTs: $ctscore</b></font></td></tr>\n";
> }
>
> # Print Terrorists Win messages.
> # Updated for New Logging Format
> if (/Terrorists_Win/) {
> (undef,$_) = split(/L.*: /);
> @RoundInfo = split(/\(/,$_);
> $ctscore = $RoundInfo[1];
> $terroristscore = $RoundInfo[2];
> $ctscore =~ s/CT//;
> $terroristscore =~ s/T//;
> $ctscore =~ s/\"//;
> $ctscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $ctscore =~ s/\)//;
> $terroristscore =~ s/\)//;
> $ctscore =~ s/ //;
> $ctscore =~ s/ //;
> $terroristscore =~ s/\ //;
> $terroristscore =~ s/\s+$//;
> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Terrorists Win!</font></td>";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>";
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
> CTs: $ctscore</b></font></td></tr>\n";
> }
>
> # Print CTs Win messages.
> if (/CTs_Win/) {
> (undef,$_) = split(/L.*: /);
> @RoundInfo = split(/\(/,$_);
> $ctscore = $RoundInfo[1];
> $terroristscore = $RoundInfo[2];
> $ctscore =~ s/CT//;
> $terroristscore =~ s/T//;
> $ctscore =~ s/\"//;
> $ctscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $terroristscore =~ s/\"//;
> $ctscore =~ s/\)//;
> $terroristscore =~ s/\)//;
> $ctscore =~ s/ //;
> $ctscore =~ s/ //;
> $terroristscore =~ s/\ //;
> $terroristscore =~ s/\s+$//;
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\" alt=\"CT's
> Win!\"></td>";
> $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">CTs Win!</font></td>";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>";
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Counter-Terrorists Win\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
> Terrorists: $terroristscore</b></font></td></tr>\n";
> }
> # Print player connect messages.
> # Updated for New Logging Format
> if (/ connected/) {
> (undef,$_) = split(/L.*: \"/);
> ($player,$_) = split(/connected, /);
> @PlayerInfo = split(/\</, $player);
> $player = $PlayerInfo[0];
> TagFilter($player);
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/conn.gif\" width=\"16\" height=\"16\"
> alt=\"$player joined the server\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"25%\"><font
> size=\"1\">$player</font></td>";
> $eventinfo .= "<td class=\"system\" width=\"75%\"><font size=\"2\">joined
> the server</font></td></tr>\n";
> }
>
> # Print player disconnect messages.
> # Updated for new Logging format
> if (/\" disconnected/) {
> (undef,$_) = split(/L.*: \"/);
> ($player,$_) = split(/\" disconnected/);
> @PlayerInfo = split(/\</,$player);
> $player = @PlayerInfo[0];
> TagFilter($player);
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/disconn.gif\" width=\"16\" height=\"16\"
> alt=\"$player left the server\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"25%\"><font
> size=\"1\">$player</font></td>";
> $eventinfo .= "<td class=\"system\" width=\"75%\"><font size=\"2\">left
> the
> server</font></td></tr>\n";
> }
>
> # Print player team join messages.
> # Updated for New Logging Format.
> if (/ joined team /) {
> (undef,$_) = split(/L.*: \"/);
> ($player,$team) = split(/ joined team /);
> @PlayerInfo = split(/\</,$player);
> $team =~ s/\s+$//;
> $team =~ s/\"//;
> $team =~ s/\"//;
> $player = $PlayerInfo[0];
> TagFilter($player);
> if ($team eq "CT") {
> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"$player joined the Counter-Terrorist team\"></td>";
> $eventinfo .= "<td class=\"ct\" width=\"25%\"><font
> size=\"1\">$player</font></td>";
> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">joined
> the
> Counter-Terrorist team</font></td></tr>\n";
> }
> if ($team eq "TERRORIST") {
> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"$player joined the Terrorist team\"></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"25%\"><font
> size=\"1\">$player</font></td>";
> $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
> size=\"2\">joined the Terrorist team</font></td></tr>\n";
> }
> }
>
> # Print team scores.
> # Seperate out Counter-Terrorist wins.
> # Updated for New Logging Format
> if (/Team "CT" scored/) {
> (undef,$_) = split(/L.*: /);
> @GameInfo = split(/\"/,$_);
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Counter-Terrorist Wins\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Counter-Terrorist Wins: <b>Scored $GameInfo[3] with
> $GameInfo[5] Players</b></font></td></tr>\n";
> }
>
> # Seperate out Terrorist wins.
> # Updated for New Logging Format
> if (/Team "TERRORIST" scored/) {
> (undef,$_) = split(/L.*: /);
> @GameInfo = split(/\"/,$_);
> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> alt=\"Terrorist Wins\"></td>";
> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> size=\"1\">Terrorist Wins: <b>Scored $GameInfo[3] with $GameInfo[5]
> Players</b></font></td></tr>\n";
> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> height=\"1\"></td></tr>"; }
> }
>
> # Output to the web browser
> print "Content-type: text/html\n\n";
> print "<!-- generated by csserverstat -
> http://server.counter-strike.net/csserverstat -->\n\n";
>
> open(TEMPLATE,"$settings{template}");
>
> foreach $_ (<TEMPLATE>) {
> $_ =~ s/(\$\w+\{\w+\})/$1/eeg;
> $_ =~ s/(\$\w+)/$1/eeg;
> print $_;
> }
>
> close(TEMPLATE);
>
> # End script.
> exit;
>
>
>


Lars Christiansen (15-06-2001)
Kommentar
Fra : Lars Christiansen


Dato : 15-06-01 08:15

ups... det er stadig tildligt :) jeg så ikke ordentligt efter =P

Hvad står der i din ErrorLog fra Apache?

rs Christiansen wrote:

> Det skyldes at du ikke har to (2) linieskift efter din Content-Type.
>
> -Lars
>
> Jimmy Marcus Larsen wrote:
>
>> Hej!
>>
>> Jeg har nogle problemer med et Perl-script jeg har hentet fra nettet. Det
>> er et script der skal vise hvor mange spillere der er på en Counter
>> Strike server.
>> Min Linux Apache server kommer med en "Internal Server Error 500" i
>> browseren når jeg forsøger at køre scriptet. I Apache's Error Log står
>> der "Premature end of script headers". Hvad betyder det?
>> Jeg har et lille script der bare siger "testing 1, 2, 3" som virker fint
>> så jeg tror ik det er Apache's mod_perl modul der ik er konfigureret
>> korrekt.
>>
>> Her er scriptet som ik fungerer... Det er lidt langt
>>
>>
>> #!/usr/bin/perl -T
>> use POSIX qw(strftime);
>> use Net::hostent;
>> use Socket;
>>
>>
>
############################################################################
>> ####
>> # csserverstat.pl - A server info and log parser for Half-Life
>> Counter-Strike #
>> # servers.
>> #
>>
>
############################################################################
>> ####
>> # http://server.counter-strike.net/csserverstat
>> #
>> # Version 1.06 #
>> # Modified 3/24/01 for new CS1.1 Logging format by Neo
>> #
>>
>
############################################################################
>> ####
>>
>>
>> # Set the path to your configuration file here. Make sure you use forward
>> slashes, even if you are running Windows (i.e.
>> c:/wwwroot/cgi-bin/csserverstat.conf).
>>
>> $settings{configfile} = "/var/www/html/csserverstat/csserverstat.conf";
>>
>>
>>
>
############################################################################
>> ####
>> # Do not modify anything below this line!
>> #
>>
>
############################################################################
>> ####
>>
>> $settings{version} = "1.06";
>>
>> # Weapon display list.
>> %weaponlist = (
>> knife => "a Knife",
>> glock18 => "a Glock 18 9mm",
>> usp => "a H&K USP Tactical .45",
>> deagle => "a Desert Eagle .50",
>> p228 => "a Sig Sauer P-228 9mm",
>> elite => "a Beretta 96G Elite 9mm",
>> fiveseven => "a FN Five-Seven 5.7mm",
>> m3 => "a Bernelli M3 Super 90 12 gauge",
>> xm1014 => "a Bernelli XM1014 12 gauge",
>> mp5navy => "a H&K MP5/Navy 9mm",
>> tmp => "a Steyr Tactical Machine Pistol 9mm",
>> p90 => "a FN P90 5.7mm",
>> mac10 => "an Ingram Mac-10 9mm",
>> ump45 => "a H&K UMP .45",
>> awp => "an Arctic Warfare/Magnum (AWM) .338",
>> g3sg1 => "a H&K G3/SG-1 7.62mm",
>> scout => "a Steyr Scout 7.62mm",
>> aug => "a Steyr Aug 5.56mm",
>> m4a1 => "a Colt M4/A1 5.56mm",
>> sg550 => "a Sig SG-550 Sniper 5.56mm",
>> sg552 => "a Sig SG-552 Commando 5.56mm",
>> ak47 => "an AK47 7.62mm",
>> m249 => "a FN M-249 PARA 5.56mm",
>> grenade => "a High-Explosive Grenade",
>> );
>>
>> # This subrouting will replace any occurance of "<" or ">" with their web
>> tag codes of "&#60;" and "&#62;", respectively.
>> sub TagFilter {
>> $_[0] =~ s/</&#60;/g;
>> $_[0] =~ s/>/&#62;/g;
>> }
>>
>> # Get configuration pairs and place them in %settings.
>> if (!-f $settings{configfile}) {
>> print "Content-type: text/html\n\n<h3>Unable to open configuration file
>> \"$settings{configfile}\".<p>Check your server's file and directory
>> permissions, as well as your\$configfile setting in
>> csserverstat.pl.</h3>";
>> exit;
>> }
>>
>> open(CONFIG,"$settings{configfile}");
>>
>> foreach $_ (<CONFIG>) {
>> chop;
>> s/^\s+//;
>> s/\s+$//;
>> next if /^$/;
>> next if /^#/;
>> s/\s*#.*//;
>> (my $setting,my $value) = split(/=/);
>> $setting =~ s/^\s+//;
>> $setting =~ s/\s+$//;
>> $value =~ s/^\s+//;
>> $value =~ s/\s+$//;
>> $settings{$setting} = $value;
>> }
>>
>> close CONFIG;
>>
>> # Check to see if all our path settings are ok.
>> if (!-f $settings{template}) {
>> print "Content-type: text/html\n\n<h3>Unable to open template
>> \"$settings{template}\".<p>Check your server's file and directory
>> permissions, as well as your \"template\" setting in
>> $settings{configfile}.</h3>";
>> exit;
>> }
>>
>> if (!-e $settings{logdir} and !-d $settings{logdir}) {
>> print "Content-type: text/html\n\n<h3>Unable to open directory
>> \"$settings{logdir}\".<p>Check your server's file and directory
>> permissions, as well as your \"logdir\" setting in
>> $settings{configfile}.</h3>";
>> exit;
>> }
>>
>> if (!-e $settings{qstatpath} or !-d $settings{qstatpath}) {
>> print "Content-type: text/html\n\n<h3>Unable to locate the QStat
>> directory, or \"$settings{qstatpath}\" is not a directory.<p>Check your
>> server's file and directory permissions, as well as your \"qstatpath\" in
>> $settings{configfile}.</h3>";
>> exit;
>> }
>>
>> if ($settings{log_anal_url} and $settings{log_anal_path}) {
>>
>> if (!-e $settings{log_anal_path} or !-d $settings{log_anal_path}) {
>> print "Content-type: text/html\n\n<h3>Unable to open directory
>> \"$settings{log_anal_path}\".<p>Check your server's file and directory
>> permissions, as well as your \"log_anal_path\" setting in
>> $settings{configfile}.</h3>";
>> exit;
>> }
>>
>> }
>>
>> # Get configuration settings that were entered into the URL, if any.
>> $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
>>
>> if ($ENV{'REQUEST_METHOD'} eq "POST") {
>> read(STDIN, $in, $ENV{'CONTENT_LENGTH'});
>> } else {
>> $in = $ENV{'QUERY_STRING'};
>> }
>>
>> my @settings = split(/&/, $in);
>>
>> foreach my $settings (@settings) {
>> (my $setting, my $value) = split(/=/, $settings);
>> $setting =~ tr/+/ /;
>> $setting =~ s/%(..)/pack("C", hex($1))/eg;
>> $value =~ tr/+/ /;
>> $value =~ s/%(..)/pack("C", hex($1))/eg;
>> TagFilter($setting);
>> TagFilter($value);
>>
>> if ($setting eq "server") {
>> ($settings{serverip},$settings{serverport}) = split(/:/,$value);
>> }
>>
>> if ($setting eq "events") {
>> $settings{numevents} = $value;
>> }
>>
>> if ($setting eq "refresh") {
>> $settings{refresh} = $value;
>> }
>>
>> }
>>
>> # Get the local time.
>> $now = localtime;
>>
>> $tmp = gethost($settings{serverip});
>>
>> if ($tmp) {
>> $settings{serverip} = inet_ntoa($tmp->addr);
>> }
>>
>> # Determine the current log file.
>> opendir(LOGDIR,"$settings{logdir}");
>> @logdir = sort (grep (/$settings{serverip}/,readdir(LOGDIR)));
>> closedir(LOGDIR);
>> $settings{logfile} = pop(@logdir);
>>
>> # Read the current log file and look for defined events. We assume that
>> # the
>> file is readable since the script was able to view the directory to
>> figure out which file to use.
>> open(LOGFILE,"$settings{logdir}/$settings{logfile}");
>> @logdata = grep ( /\>\" say/|
>> /\" say_team/|
>> /\" killed/|
>> /\" committed suicide with/|
>> /Touched_A_Hostage/|
>> /Rescued_A_Hostage/|
>> /Killed_A_Hostage/|
>> /killed a teammate/|
>> /Planted_The_Bomb/|
>> /Defused_The_Bomb/|
>> /Target_Bombed/|
>> /Bomb_Defused/|
>> /All_Hostages_Rescued/|
>> /Hostages_Not_Rescued/|
>> /VIP_Escaped/|
>> /VIP_Assasinated/|
>> /Terrorists_Win/|
>> /CTs_Win/|
>> /connected,/|
>> /\" disconnected/|
>> /Team "CT" scored/|
>> /Team "TERRORIST" scored/|
>> /joined team /
>> ,<LOGFILE>);
>> close(LOGFILE);
>>
>> # Don't go outside our allowable range for refresh and event display.
>> if ($settings{refresh} < $settings{minrefresh}) {
>> $settings{refresh} = $settings{minrefresh};
>> } else {
>> $settings{refresh} = $settings{defrefresh} unless $settings{refresh};
>> }
>>
>> if ($settings{numevents} > $settings{maxevents}) {
>> $settings{numevents} = $settings{maxevents};
>> } else {
>> $settings{numevents} = $settings{defevents} unless
>> $settings{numevents};
>> }
>>
>> # The majority of the URL for each event setting change link is the same
>> # and
>> is defined here for convenience.
>> $cgiurl =
>>
>
"refresh=$settings{refresh}&server=$settings{serverip}:$settings{serverport}
>> ";
>>
>> # Get game server, player, and rule information from QStat.
>> @qstatoptions = ("-R","-P","-tsw","-raw","!@#@!","-hls");
>> my($qstat) = open(QSTAT,"-|");
>> die "Couldn't open pipe to subprocess" unless defined($qstat);
>>
>
system("$settings{qstatpath}/qstat",@qstatoptions,"$settings{serverip}:$sett
>> ings{serverport}") or die "Couldn't exec qstat" if $qstat == 0;
>> @qstat = <QSTAT>;
>> close QSTAT;
>>
>> chomp(@qstat);
>> $serverstat = shift(@qstat);
>> $ruleslist = shift(@qstat);
>> @playerlines = @qstat;
>> ($type,$ip,$servername,$map,$maxplayers,$curplayers,$ping,$timeout) =
>> split(/!@#@!/,$serverstat);
>>
>> if (!-e "$settings{imagepath}\/$map.jpg") {
>> $mapimage = "default.jpg";
>> } else {
>> $mapimage = "$map.jpg";
>> }
>>
>> # If debug mode is on, place the %settings hash in $debug.
>> if ($settings{debug} == 1) {
>> $debug .= "<table cellspacing=\"0\" cellpadding=\"0\"
>> width=\"100%\">\n";
>>
>> foreach $setting (sort (keys %settings)) {
>> $debug .= "<tr><td nowrap><font size=\"1\"
>> color=\"#808080\">$setting</font></td><td><font size=\"1\"
>> color=\"#E0E0E0\">&nbsp;=&nbsp;</font></td><td width=\"100%\"><font
>> size=\"1\" color=\"#E0E0E0\">$settings{$setting}</font></td></tr>\n";
>> }
>>
>> $debug .= "</table>\n<hr size=\"1\" width=\"100%\">";
>> }
>>
>> # If HLMaps is defined, link the map name and image to HLMaps. If HLMaps
>> # is
>> not defined but Log_Anal is, link the map name and image to Log_Anal.
>> Otherwise, leave it alone.
>> if ($settings{hlmaps}) {
>> $mapname = "<a href=\"$settings{hlmaps}?map=$map\">$map</a>";
>> } elsif ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$map.$settings{log_anal_extension}") {
>> $mapname = "<a
>>
>
href=\"$settings{log_anal_url}/$map.$settings{log_anal_extension}\">$map</a>
>> ";
>> } else {
>> $mapname = $map;
>> }
>>
>> if ($settings{hlmaps}) {
>> $mapimage = "<a href=\"$settings{hlmaps}?map=$map\"><img class=\"map\"
>> src=\"$settings{imageurl}/$mapimage\" width=\"212\" height=\"160\"
>> alt=\"Current map is $map.\"></a>";
>> } elsif ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$map.$settings{log_anal_extension}") {
>> $mapimage = "<a
>> href=\"$settings{log_anal_url}/$map.$settings{log_anal_extension}\"><img
>> class=\"map\" src=\"$settings{imageurl}/$mapimage\" width=\"212\"
>> height=\"160\" alt=\"Current map is $map.\"></a>";
>> } else {
>> $mapimage = "<img class=\"map\" src=\"$settings{imageurl}/$mapimage\"
>> width=\"212\" height=\"160\" alt=\"Current map is $map.\">";
>> }
>>
>> # Build the players list.
>> # Get the player list.
>> if (@playerlines) {
>>
>> while ($_ = shift @playerlines) {
>> ++$count1;
>> ($playername,$frags,$timeonserver) = split(/!@#@!/);
>>
>> # Sort the player list by frags.
>> push @playernamelist, $playername;
>> %playerlist = (
>> frags => $frags,
>> time => $timeonserver
>> );
>> for my $what (keys %playerlist) {
>> $player{$playername}{$what} = $playerlist{$what};
>> }
>>
>> }
>>
>> } else {
>>
>> push @playernamelist, "None connected!";
>> $player{"None connected!"}{time} = "00:00";
>> ++$count1;
>>
>> }
>>
>> sub byfrag {
>> $player{$b}{frags} <=> $player{$a}{frags};
>> }
>>
>> foreach $playername (sort byfrag @playernamelist) {
>> $frags = $player{$playername}{frags};
>> $timeonserver = $player{$playername}{time};
>> ($playerstats = $playername) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
>>
>> # Limit displayed player names to the maxplayername setting.
>> $playername =~ s/(^.{$settings{maxplayername}}(?!$))(.*$)/$1.../g;
>> TagFilter($playername);
>>
>> # Format the time on server display.
>> ($hours,$minutes,$seconds) = split(/:/,$timeonserver);
>>
>> if ($hours eq "00") {
>> $hours = "";
>> $minutes =~ s/0//;
>> } else {
>> $hours = $hours.":";
>> $hours =~ s/0//;
>> }
>>
>> if ($minutes eq "0") {
>> $minutes = "";
>> } else {
>> $minutes = $minutes.":";
>> }
>>
>> $playerinfo .= "<tr><td class=\"playerlist\" nowrap><font
>> size=\"1\">&nbsp;";
>>
>> # If any admins are present indicate them.
>> foreach my $admin (split/,/,$settings{admins}) {
>> $admin =~ s/^\s+//;
>> $admin =~ s/\s+$//;
>> TagFilter($admin);
>> if ($playername eq $admin) {
>> $playername = "$playername<font class=\"admin\">&#149;</font>";
>> }
>> }
>>
>> # If Log_Anal is defined, link each players name to their personal stats
>> page. Otherwise, just print their name.
>> if ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$playerstats.$settings{log_anal_extension}") {
>> $playerinfo .= "<a
>>
>
href=\"$settings{log_anal_url}/$playerstats.$settings{log_anal_extension}\">
>> $playername</a></font></td>";
>> } else {
>> $playerinfo .= "$playername</font></td>";
>> }
>>
>> $playerinfo .= "<td class=\"playerlist\" align=\"right\"><font
>> size=\"1\">&nbsp;$frags&nbsp;</font></td>";
>> $playerinfo .= "<td class=\"playerlist\" align=\"right\" nowrap><font
>> size=\"1\">&nbsp;$hours$minutes$seconds&nbsp;</font></td></tr>\n";
>>
>> }
>>
>> # Show blank lines up to the server's maxplayer setting. Looks nice.
>> while ($count1 < $maxplayers) {
>> ++$count1;
>> $playerinfo .= "<tr><td class=\"playerlist\" colspan=\"3\"><font
>> size=\"1\">&nbsp;</td></tr>\n";
>> }
>>
>> # Build the rules list.
>> # Get and format the rules list.
>> foreach (sort(split /!@#@!/, $ruleslist)) {
>> ($rule,$value) = split(/=/);
>> TagFilter($rule);
>> TagFilter($value);
>>
>> if ($value eq 0) {
>> $value = "<font color=\"#303030\">&#149;</font>";
>> } elsif ($value eq 1) {
>> $value = "<font color=\"#009900\">&#149;</font>";
>> }
>>
>> if ($rule eq "sv_contact") {
>> $value = "<a href=\"mailto:$value\">$value</a>";
>> }
>>
>> if ($rule eq "mp_mapvoteratio") {
>> $value = $value*100; $value = "$value%";
>> }
>>
>> if (($rule eq "gamename") && ($value eq "CounterStrike")) {
>> $value = "<a href=\"http://www.counter-strike.net\">CounterStrike";
>> }
>>
>> if (($rule eq "sv_os") && ($value eq "linux")) {
>> $value = "<a href=\"http://www.linux.org\">Linux";
>> } elsif (($rule eq "sv_os") && ($value eq "windows")) {
>> $value = "<a href=\"http://www.microsoft.com/windows\">Windows";
>> }
>>
>> # Defines which rules to show.
>> if ( /mp_mapvoteratio/ or
>> /mp_forcechasecam/ or
>> /mp_tkpunish/ or
>> /mp_autoteambalance/ or
>> /mp_limitteams/ or
>> /mp_autokick/ or
>> /mp_c4timer/ or
>> /sv_os/ or
>> /mp_roundtime/ or
>> /mp_flashlight/ or
>> /mp_friendlyfire/ or
>> /mp_timelimit/ or
>> /sv_maxrate/ or
>> /sv_minrate/ or
>> /sv_cheats/ or
>> /sv_type/ or
>> /mp_hostagepenalty/ or
>> /mp_footsteps/ or
>> /gamename/ or
>> /sv_contact/ ) {
>> ++$count2;
>> $rulesinfo .= "<tr><td class=\"ruleslist\"><font
>> size=\"1\">&nbsp;$rule</font></td>";
>> $rulesinfo .= "<td class=\"ruleslist\" align=\"right\" nowrap><font
>> size=\"1\">$value&nbsp;</font></td></tr>\n";
>> }
>>
>> }
>>
>> # Make the rules list at least as big as the player list if it isn't
>> already. Looks nice.
>> while ($count2 < $count1) {
>> ++$count2;
>> $rulesinfo .= "<tr><td class=\"ruleslist\" colspan=\"3\"><font
>> size=\"1\">&nbsp;</td></tr>\n";
>> }
>>
>> # Build the events list
>> # Grab the last x events according to what $numevents is set to.
>> while ($popcount < $settings{numevents}) {
>> ++$popcount;
>> my $newlogdata = pop @logdata;
>> push @newlogdata, $newlogdata;
>> }
>>
>> # If enabled, reverse the event order so that new events are on top.
>> if ($settings{reverse_order} == "1") {
>> @logdata = @newlogdata;
>> } else {
>> @logdata = reverse (@newlogdata);
>> }
>>
>> # This is where the log file data gets parsed out to HTML.
>> foreach $_ (@logdata) {
>>
>> # If debug is on, $eventinfo .= the raw log file message.
>> if ($settings{debug} == 1) {
>> ++$messagecount;
>> $eventinfo .= "<tr><td bgcolor=\"#D0D0D0\"></td>";
>> $eventinfo .= "<td colspan=\"2\" bgcolor=\"#D0D0D0\"><font size=\"1\"
>> color=\"#303030\">$_</font></td></tr>";
>> }
>>
>> # Print player chat messages.
>> # Updated for New Logging Format.
>> if (/\>\" say/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($player,$message) = split(/\" say "/);
>> @PlayerInfo = split(/\</,$player);
>> $player = $PlayerInfo[0];
>> $message =~ s/\"//;
>> $message =~ s/\s+$//;
>> TagFilter($player);
>> TagFilter($message);
>>
>> # Remove words in the banword list.
>> foreach my $banword (split/,/,$settings{banwords}) {
>> $banword =~ s/^\s+//;
>> $banword =~ s/\s+$//;
>> $message =~ s/\Q$banword/<font
>> size="1">&#149;&#149;&#149;&#149;&#149;<\/font>/i;
>> }
>>
>> $eventinfo .= "<tr><td class=\"chat\" width=\"16\"><img
>> src=\"$settings{imageurl}/chat.gif\" width=\"16\" height=\"16\"
>> alt=\"Message from $player\"></td>";
>> $eventinfo .= "<td class=\"chat\" width=\"25%\" nowrap><font
>> size=\"1\">$player&nbsp;&nbsp;</font></td>";
>> $eventinfo .= "<td class=\"chat\" width=\"75%\" width=\"100%\"><font
>> size=\"2\">$message</font></td></tr>\n";
>> }
>> # If team_messages is set to 1, show them.
>> # Updated for New Logging Format.
>> if (/\" say_team/) {
>> if ($settings{team_messages} == "1") {
>> (undef,$_) = split(/L.*: \"/);
>> ($player,$message) = split(/\" say_team "/);
>> @PlayerInfo = split(/\</,$player);
>> $player = $PlayerInfo[0];
>> $message =~ s/\"//;
>> $message =~ s/\s+$//;
>> TagFilter($player);
>> TagFilter($message);
>> # Remove words in the banword list.
>> foreach my $banword (split/,/,$settings{banwords}) {
>> $banword =~ s/^\s+//;
>> $banword =~ s/\s+$//;
>> $message =~ s/\Q$banword/<font
>> size="1">&#149;&#149;&#149;&#149;&#149;<\/font>/i;
>> }
>>
>> $eventinfo .= "<tr><td class=\"teamchat\" width=\"16\"><img
>> src=\"$settings{imageurl}/chat.gif\" width=\"16\" height=\"16\"
>> alt=\"Message from $player\"></td>";
>> $eventinfo .= "<td class=\"teamchat\" width=\"25%\" nowrap><font
>> size=\"1\">$player&nbsp;&nbsp;</font></td>";
>> $eventinfo .= "<td class=\"teamchat\" width=\"75%\" width=\"100%\"><font
>> size=\"2\">$message</font></td></tr>\n";
>> }
>> }
>>
>> # Print kill messages where another player is the cause.
>> # Updated for New Logging Format.
>> if (/\" killed/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($killer,$_) = split(/\" killed \"/);
>> ($killed,$weapon) = split(/\" with "/);
>> @KillerInfo = split(/\</, $killer);
>> @KilledInfo = split(/\</, $killed);
>> ($killerteam,$_) = split(/\>/, $KillerInfo[3]);
>> ($killedteam,$_) = split(/\>/, $KilledInfo[3]);
>> $killer = $KillerInfo[0];
>> $killed = $KilledInfo[0];
>> $weapon =~ s/\s+$//;
>> $weapon =~ s/\"//;
>> ($killerstats = $killer) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
>> ($killedstats = $killed) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
>> TagFilter($killer);
>> TagFilter($killed);
>>
>> # Seperate out kills against Counter-Terrorists
>> # Updated for New Logging Format.
>> if (($killerteam eq "CT") and ($killedteam eq "TERRORIST")) {
>> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
>> src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
>> alt=\"$killer killed $killed\"></td>";
>>
>> # If Log_Anal is defined, link each players name to their personal stats
>> page. Otherwise, just print their name.
>> if ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$killerstats.$settings{log_anal_extension}") {
>> $killer = "<a
>>
>
href=\"$settings{log_anal_url}/$killerstats.$settings{log_anal_extension}\">
>> $killer</a>";
>> }
>>
>> if ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$killedstats.$settings{log_anal_extension}") {
>> $killed = "<a
>>
>
href=\"$settings{log_anal_url}/$killedstats.$settings{log_anal_extension}\">
>> $killed</a>";
>> }
>>
>> $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
>> size=\"1\">$killer&nbsp;&nbsp;</font></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
>> size=\"2\">killed $killed with ";
>>
>> # If Log_Anal is defined, link the weapon name to the weapon stats.
>> if ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$weapon.$settings{log_anal_extension}") {
>> $eventinfo .= "<a
>>
>
href=\"$settings{log_anal_url}/$weapon.$settings{log_anal_extension}\">$weap
>> onlist{$weapon}</a></font></td></tr>\n";
>> } else {
>> $eventinfo .= "$weaponlist{$weapon}</font></a></td></tr>\n";
>> }
>>
>> }
>>
>> # Seperate out kills against Terrorists
>> # Updated for new Logging Format.
>> if (($killerteam eq "TERRORIST") and ($killedteam eq "CT")) {
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
>> alt=\"$killer killed $killed\"></td>";
>>
>> # If Log_Anal is defined, link each players name to their personal stats
>> page. Otherwise, just print their name.
>> if ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$killerstats.$settings{log_anal_extension}") {
>> $killer = "<a
>>
>
href=\"$settings{log_anal_url}/$killerstats.$settings{log_anal_extension}\">
>> $killer</a>";
>> }
>>
>> if ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$killedstats.$settings{log_anal_extension}") {
>> $killed = "<a
>>
>
href=\"$settings{log_anal_url}/$killedstats.$settings{log_anal_extension}\">
>> $killed</a>";
>> }
>>
>> $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
>> size=\"1\">$killer&nbsp;&nbsp;</font></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">killed
>> $killed with ";
>>
>> # If Log_Anal is defined, link the weapon name to the weapon stats.
>> if ($settings{log_anal_url} and -f
>> "$settings{log_anal_path}/$weapon.$settings{log_anal_extension}") {
>> $eventinfo .= "<a
>>
>
href=\"$settings{log_anal_url}/$weapon.$settings{log_anal_extension}\">$weap
>> onlist{$weapon}</a></font></td></tr>\n";
>> } else {
>> $eventinfo .= "$weaponlist{$weapon}</font></a></td></tr>\n";
>> }
>>
>> }
>> # Seperate out teammate kills
>> # Added for New Logging Format.
>> if ($killerteam eq $killedteam){
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/teamkill.gif\" width=\"16\" height=\"16\"
>> alt=\"$killer killed a teammate\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"25%\" nowrap><font
>> size=\"1\">$killer</font></td>";
>> $eventinfo .= "<td class=\"system\" width=\"75%\"><font
>> size=\"2\">Killed a teammate</font></td></tr>\n";
>> }
>>
>> }
>>
>> # Print kill messages where the player kills themself.
>> # Updated for New Logging Format.
>> if (/\" committed suicide with/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($killed,$cause) = split(/\<.*\>\" committed suicide with "/);
>> $cause =~ s/\s+$//;
>> $cause =~s/\"//;
>> TagFilter($killed);
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
>> alt=\"$killed committed suicide\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"25%\" nowrap><font
>> size=\"1\">$killed</font></td>";
>> $eventinfo .= "<td class=\"system\" width=\"75%\"><font
>> size=\"2\">committed suicide with $cause</font></td></tr>\n";
>> }
>>
>> # Print hostage touch messages.
>> # Updated for New Logging Format.
>> if (/Touched_A_Hostage/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($groper) = split(/\<.*\>\" triggered/);
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
>> alt=\"$groper touched a hostage\"></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
>> size=\"1\">$groper</font></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Touched a
>> hostage</font></td></tr>\n";
>> }
>>
>> # Print hostage rescue messages.
>> # Updated for New Logging Format.
>> if (/Rescued_A_Hostage/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($rescuer) = split(/\<.*\>\" triggered/);
>> TagFilter($rescuer);
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
>> alt=\"$rescuer rescued a hostage\"></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
>> size=\"1\">$rescuer</font></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Rescued a
>> hostage</font></td></tr>\n";
>> }
>>
>> # Print hostage kill messages.
>> # Updated for New Logging Format.
>> if (/Killed_A_Hostage/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($killer) = split(/\<.*\>\" triggered/);
>> TagFilter($killer);
>> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
>> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
>> alt=\"$killer killed a hostage\"></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
>> size=\"1\">$killer</font></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
>> size=\"2\">Killed a hostage</font></td></tr>\n";
>> }
>>
>> # Print bomb plant messages.
>> # Updated for New Logging Format.
>> if (/Planted_The_Bomb/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($planter) = split(/\<.*\>\" triggered/);
>> TagFilter($planter);
>> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
>> src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
>> alt=\"$planter planted the bomb\"></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
>> size=\"1\">$planter</font></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
>> size=\"2\">Planted the bomb</font></td></tr>\n";
>> }
>>
>> # Print bomb defuse messages.
>> # Updated for New Logging Format.
>> if (/Defused_The_Bomb/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($defuser) = split(/\<.*\>\" triggered/);
>> TagFilter($defuser);
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
>> alt=\"$defuser defused the bomb\"></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
>> size=\"1\">$defuser</font></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Defused
>> the
>> bomb</font></td></tr>\n";
>> }
>>
>> # Print all hostages rescued messages.
>> if (/All_Hostages_Rescued/) {
>> (undef,$_) = split(/L.*: \"/);
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
>> alt=\"All hostages rescued\"></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">All hostages rescued</font></td></tr>\n";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>";
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Counter-Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
>> size=\"1\">Round result: <b>Counter-Terrorists
>> Win</b></font></td></tr>\n";
>> }
>>
>> # Print hostages not rescued message.
>> # Updated for New Logging Format
>> if (/Hostages_Not_Rescued/) {
>> (undef,$_) = split(/L.*: /);
>> @RoundInfo = split(/\(/,$_);
>> $ctscore = $RoundInfo[1];
>> $terroristscore = $RoundInfo[2];
>> $ctscore =~ s/CT//;
>> $terroristscore =~ s/T//;
>> $ctscore =~ s/\"//;
>> $ctscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $ctscore =~ s/\)//;
>> $terroristscore =~ s/\)//;
>> $ctscore =~ s/ //;
>> $ctscore =~ s/ //;
>> $terroristscore =~ s/\ //;
>> $terroristscore =~ s/\s+$//;
>> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
>> src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
>> alt=\"Hostages not rescued\"></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"100%\"
>> colspan=\"2\"><font
>> size=\"1\">Hostages not rescued</font></td></tr>\n";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>";
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
>> size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
>> CTs: $ctscore</b></font></td></tr>\n";
>> }
>>
>> # Print target successfully bombed messages.
>> # Updated for New Logging Format
>> if (/Target_Bombed/) {
>> (undef,$_) = split(/L.*: /);
>> @RoundInfo = split(/\(/,$_);
>> $ctscore = $RoundInfo[1];
>> $terroristscore = $RoundInfo[2];
>> $ctscore =~ s/CT//;
>> $terroristscore =~ s/T//;
>> $ctscore =~ s/\"//;
>> $ctscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $ctscore =~ s/\)//;
>> $terroristscore =~ s/\)//;
>> $ctscore =~ s/ //;
>> $ctscore =~ s/ //;
>> $terroristscore =~ s/\ //;
>> $terroristscore =~ s/\s+$//;
>> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
>> src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
>> alt=\"Target successfully bombed\"></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"100%\"
>> colspan=\"2\"><font
>> size=\"1\">Target successfully bombed</font></td></tr>\n";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>";
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
>> size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
>> CTs: $ctscore</b></font></td></tr>\n";
>> }
>>
>> # Print bomb sucessfully defused messages.
>> # Updated for New Logging Format
>> if (/Bomb_Defused/) {
>> (undef,$_) = split(/L.*: /);
>> @RoundInfo = split(/\(/,$_);
>> $ctscore = $RoundInfo[1];
>> $terroristscore = $RoundInfo[2];
>> $ctscore =~ s/CT//;
>> $terroristscore =~ s/T//;
>> $ctscore =~ s/\"//;
>> $ctscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $ctscore =~ s/\)//;
>> $terroristscore =~ s/\)//;
>> $ctscore =~ s/ //;
>> $ctscore =~ s/ //;
>> $terroristscore =~ s/\ //;
>> $terroristscore =~ s/\s+$//;
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
>> alt=\"Bomb successfully defused\"></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">Bomb successfully defused</font></td></tr>\n";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>";
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Counter-Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
>> Terrorists: $terroristscore</b></font></td></tr>\n";
>> }
>>
>> # Print VIP escape messages.
>> # Updated for New Logging Format
>> if (/VIP_Escaped/) {
>> (undef,$_) = split(/L.*: /);
>> @RoundInfo = split(/\(/,$_);
>> $ctscore = $RoundInfo[1];
>> $terroristscore = $RoundInfo[2];
>> $ctscore =~ s/CT//;
>> $terroristscore =~ s/T//;
>> $ctscore =~ s/\"//;
>> $ctscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $ctscore =~ s/\)//;
>> $terroristscore =~ s/\)//;
>> $ctscore =~ s/ //;
>> $ctscore =~ s/ //;
>> $terroristscore =~ s/\ //;
>> $terroristscore =~ s/\s+$//;
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/vip.gif\" width=\"16\" height=\"16\" alt=\"VIP
>> Escaped\"></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">VIP escaped</font></td>";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>";
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Counter-Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
>> Terrorists: $terroristscore</b></font></td></tr>\n";
>> }
>>
>> # Print VIP assassination messages.
>> # Updated for New Logging Format
>> if (/VIP_Assasinated/) {
>> (undef,$_) = split(/L.*: /);
>> @RoundInfo = split(/\(/,$_);
>> $ctscore = $RoundInfo[1];
>> $terroristscore = $RoundInfo[2];
>> $ctscore =~ s/CT//;
>> $terroristscore =~ s/T//;
>> $ctscore =~ s/\"//;
>> $ctscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $ctscore =~ s/\)//;
>> $terroristscore =~ s/\)//;
>> $ctscore =~ s/ //;
>> $ctscore =~ s/ //;
>> $terroristscore =~ s/\ //;
>> $terroristscore =~ s/\s+$//;
>> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
>> src=\"$settings{imageurl}/vip.gif\" width=\"16\" height=\"16\" alt=\"VIP
>> Assassinated\"></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"100%\"
>> colspan=\"2\"><font
>> size=\"1\">VIP assassinated</font></td>";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>";
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
>> CTs: $ctscore</b></font></td></tr>\n";
>> }
>>
>> # Print Terrorists Win messages.
>> # Updated for New Logging Format
>> if (/Terrorists_Win/) {
>> (undef,$_) = split(/L.*: /);
>> @RoundInfo = split(/\(/,$_);
>> $ctscore = $RoundInfo[1];
>> $terroristscore = $RoundInfo[2];
>> $ctscore =~ s/CT//;
>> $terroristscore =~ s/T//;
>> $ctscore =~ s/\"//;
>> $ctscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $ctscore =~ s/\)//;
>> $terroristscore =~ s/\)//;
>> $ctscore =~ s/ //;
>> $ctscore =~ s/ //;
>> $terroristscore =~ s/\ //;
>> $terroristscore =~ s/\s+$//;
>> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"100%\"
>> colspan=\"2\"><font
>> size=\"1\">Terrorists Win!</font></td>";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>";
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
>> CTs: $ctscore</b></font></td></tr>\n";
>> }
>>
>> # Print CTs Win messages.
>> if (/CTs_Win/) {
>> (undef,$_) = split(/L.*: /);
>> @RoundInfo = split(/\(/,$_);
>> $ctscore = $RoundInfo[1];
>> $terroristscore = $RoundInfo[2];
>> $ctscore =~ s/CT//;
>> $terroristscore =~ s/T//;
>> $ctscore =~ s/\"//;
>> $ctscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $terroristscore =~ s/\"//;
>> $ctscore =~ s/\)//;
>> $terroristscore =~ s/\)//;
>> $ctscore =~ s/ //;
>> $ctscore =~ s/ //;
>> $terroristscore =~ s/\ //;
>> $terroristscore =~ s/\s+$//;
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"CT's Win!\"></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">CTs Win!</font></td>";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>";
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Counter-Terrorists Win\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
>> Terrorists: $terroristscore</b></font></td></tr>\n";
>> }
>> # Print player connect messages.
>> # Updated for New Logging Format
>> if (/ connected/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($player,$_) = split(/connected, /);
>> @PlayerInfo = split(/\</, $player);
>> $player = $PlayerInfo[0];
>> TagFilter($player);
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/conn.gif\" width=\"16\" height=\"16\"
>> alt=\"$player joined the server\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"25%\"><font
>> size=\"1\">$player</font></td>";
>> $eventinfo .= "<td class=\"system\" width=\"75%\"><font
>> size=\"2\">joined
>> the server</font></td></tr>\n";
>> }
>>
>> # Print player disconnect messages.
>> # Updated for new Logging format
>> if (/\" disconnected/) {
>> (undef,$_) = split(/L.*: \"/);
>> ($player,$_) = split(/\" disconnected/);
>> @PlayerInfo = split(/\</,$player);
>> $player = @PlayerInfo[0];
>> TagFilter($player);
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/disconn.gif\" width=\"16\" height=\"16\"
>> alt=\"$player left the server\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"25%\"><font
>> size=\"1\">$player</font></td>";
>> $eventinfo .= "<td class=\"system\" width=\"75%\"><font size=\"2\">left
>> the
>> server</font></td></tr>\n";
>> }
>>
>> # Print player team join messages.
>> # Updated for New Logging Format.
>> if (/ joined team /) {
>> (undef,$_) = split(/L.*: \"/);
>> ($player,$team) = split(/ joined team /);
>> @PlayerInfo = split(/\</,$player);
>> $team =~ s/\s+$//;
>> $team =~ s/\"//;
>> $team =~ s/\"//;
>> $player = $PlayerInfo[0];
>> TagFilter($player);
>> if ($team eq "CT") {
>> $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"$player joined the Counter-Terrorist team\"></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"25%\"><font
>> size=\"1\">$player</font></td>";
>> $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">joined
>> the
>> Counter-Terrorist team</font></td></tr>\n";
>> }
>> if ($team eq "TERRORIST") {
>> $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"$player joined the Terrorist team\"></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"25%\"><font
>> size=\"1\">$player</font></td>";
>> $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
>> size=\"2\">joined the Terrorist team</font></td></tr>\n";
>> }
>> }
>>
>> # Print team scores.
>> # Seperate out Counter-Terrorist wins.
>> # Updated for New Logging Format
>> if (/Team "CT" scored/) {
>> (undef,$_) = split(/L.*: /);
>> @GameInfo = split(/\"/,$_);
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Counter-Terrorist Wins\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">Counter-Terrorist Wins: <b>Scored $GameInfo[3] with
>> $GameInfo[5] Players</b></font></td></tr>\n";
>> }
>>
>> # Seperate out Terrorist wins.
>> # Updated for New Logging Format
>> if (/Team "TERRORIST" scored/) {
>> (undef,$_) = split(/L.*: /);
>> @GameInfo = split(/\"/,$_);
>> $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
>> src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
>> alt=\"Terrorist Wins\"></td>";
>> $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
>> size=\"1\">Terrorist Wins: <b>Scored $GameInfo[3] with $GameInfo[5]
>> Players</b></font></td></tr>\n";
>> $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
>> src=\"$settings{imageurl}/trans.gif\" width=\"1\"
>> height=\"1\"></td></tr>"; }
>> }
>>
>> # Output to the web browser
>> print "Content-type: text/html\n\n";
>> print "<!-- generated by csserverstat -
>> http://server.counter-strike.net/csserverstat -->\n\n";
>>
>> open(TEMPLATE,"$settings{template}");
>>
>> foreach $_ (<TEMPLATE>) {
>> $_ =~ s/(\$\w+\{\w+\})/$1/eeg;
>> $_ =~ s/(\$\w+)/$1/eeg;
>> print $_;
>> }
>>
>> close(TEMPLATE);
>>
>> # End script.
>> exit;
>>
>>
>>
>
>


Lars Balker Rasmusse~ (15-06-2001)
Kommentar
Fra : Lars Balker Rasmusse~


Dato : 15-06-01 08:32

Lars Christiansen <lc@nospam.dixa.net> writes:
[KLIP]

Gider du lige læse http://www.usenet.dk/netikette/quote.html ?
--
Lars Balker Rasmussen "Woo hoo!?"

Lars Christiansen (15-06-2001)
Kommentar
Fra : Lars Christiansen


Dato : 15-06-01 08:50

[SNIP]
>
> Gider du lige læse http://www.usenet.dk/netikette/quote.html ?

Er du glad nu =)? Jeg ved det godt, men som sagt så var det jo lige lidt
tidligt =)

-Lars

Jimmy Marcus Larsen (17-06-2001)
Kommentar
Fra : Jimmy Marcus Larsen


Dato : 17-06-01 09:54

Mange tak! Nu virker det som det skal!


"Lars Christiansen" <lc@nospam.dixa.net> wrote in message
news:3b29b5aa$0$210$4d4eb98e@read.news.dk.uu.net...
> Det skyldes at du ikke har to (2) linieskift efter din Content-Type.
>
> -Lars
>
> Jimmy Marcus Larsen wrote:
>
> > Hej!
> >
> > Jeg har nogle problemer med et Perl-script jeg har hentet fra nettet.
Det
> > er et script der skal vise hvor mange spillere der er på en Counter
Strike
> > server.
> > Min Linux Apache server kommer med en "Internal Server Error 500" i
> > browseren når jeg forsøger at køre scriptet. I Apache's Error Log står
der
> > "Premature end of script headers". Hvad betyder det?
> > Jeg har et lille script der bare siger "testing 1, 2, 3" som virker fint
> > så jeg tror ik det er Apache's mod_perl modul der ik er konfigureret
> > korrekt.
> >
> > Her er scriptet som ik fungerer... Det er lidt langt
> >
> >
> > #!/usr/bin/perl -T
> > use POSIX qw(strftime);
> > use Net::hostent;
> > use Socket;
> >
> >
>
############################################################################
> > ####
> > # csserverstat.pl - A server info and log parser for Half-Life
> > Counter-Strike #
> > # servers.
> > #
> >
>
############################################################################
> > ####
> > # http://server.counter-strike.net/csserverstat
> > #
> > # Version 1.06 #
> > # Modified 3/24/01 for new CS1.1 Logging format by Neo
> > #
> >
>
############################################################################
> > ####
> >
> >
> > # Set the path to your configuration file here. Make sure you use
forward
> > slashes, even if you are running Windows (i.e.
> > c:/wwwroot/cgi-bin/csserverstat.conf).
> >
> > $settings{configfile} = "/var/www/html/csserverstat/csserverstat.conf";
> >
> >
> >
>
############################################################################
> > ####
> > # Do not modify anything below this line!
> > #
> >
>
############################################################################
> > ####
> >
> > $settings{version} = "1.06";
> >
> > # Weapon display list.
> > %weaponlist = (
> > knife => "a Knife",
> > glock18 => "a Glock 18 9mm",
> > usp => "a H&K USP Tactical .45",
> > deagle => "a Desert Eagle .50",
> > p228 => "a Sig Sauer P-228 9mm",
> > elite => "a Beretta 96G Elite 9mm",
> > fiveseven => "a FN Five-Seven 5.7mm",
> > m3 => "a Bernelli M3 Super 90 12 gauge",
> > xm1014 => "a Bernelli XM1014 12 gauge",
> > mp5navy => "a H&K MP5/Navy 9mm",
> > tmp => "a Steyr Tactical Machine Pistol 9mm",
> > p90 => "a FN P90 5.7mm",
> > mac10 => "an Ingram Mac-10 9mm",
> > ump45 => "a H&K UMP .45",
> > awp => "an Arctic Warfare/Magnum (AWM) .338",
> > g3sg1 => "a H&K G3/SG-1 7.62mm",
> > scout => "a Steyr Scout 7.62mm",
> > aug => "a Steyr Aug 5.56mm",
> > m4a1 => "a Colt M4/A1 5.56mm",
> > sg550 => "a Sig SG-550 Sniper 5.56mm",
> > sg552 => "a Sig SG-552 Commando 5.56mm",
> > ak47 => "an AK47 7.62mm",
> > m249 => "a FN M-249 PARA 5.56mm",
> > grenade => "a High-Explosive Grenade",
> > );
> >
> > # This subrouting will replace any occurance of "<" or ">" with their
web
> > tag codes of "&#60;" and "&#62;", respectively.
> > sub TagFilter {
> > $_[0] =~ s/</&#60;/g;
> > $_[0] =~ s/>/&#62;/g;
> > }
> >
> > # Get configuration pairs and place them in %settings.
> > if (!-f $settings{configfile}) {
> > print "Content-type: text/html\n\n<h3>Unable to open configuration
file
> > \"$settings{configfile}\".<p>Check your server's file and directory
> > permissions, as well as your\$configfile setting in
> > csserverstat.pl.</h3>";
> > exit;
> > }
> >
> > open(CONFIG,"$settings{configfile}");
> >
> > foreach $_ (<CONFIG>) {
> > chop;
> > s/^\s+//;
> > s/\s+$//;
> > next if /^$/;
> > next if /^#/;
> > s/\s*#.*//;
> > (my $setting,my $value) = split(/=/);
> > $setting =~ s/^\s+//;
> > $setting =~ s/\s+$//;
> > $value =~ s/^\s+//;
> > $value =~ s/\s+$//;
> > $settings{$setting} = $value;
> > }
> >
> > close CONFIG;
> >
> > # Check to see if all our path settings are ok.
> > if (!-f $settings{template}) {
> > print "Content-type: text/html\n\n<h3>Unable to open template
> > \"$settings{template}\".<p>Check your server's file and directory
> > permissions, as well as your \"template\" setting in
> > $settings{configfile}.</h3>";
> > exit;
> > }
> >
> > if (!-e $settings{logdir} and !-d $settings{logdir}) {
> > print "Content-type: text/html\n\n<h3>Unable to open directory
> > \"$settings{logdir}\".<p>Check your server's file and directory
> > permissions, as well as your \"logdir\" setting in
> > $settings{configfile}.</h3>";
> > exit;
> > }
> >
> > if (!-e $settings{qstatpath} or !-d $settings{qstatpath}) {
> > print "Content-type: text/html\n\n<h3>Unable to locate the QStat
> > directory, or \"$settings{qstatpath}\" is not a directory.<p>Check your
> > server's file and directory permissions, as well as your \"qstatpath\"
in
> > $settings{configfile}.</h3>";
> > exit;
> > }
> >
> > if ($settings{log_anal_url} and $settings{log_anal_path}) {
> >
> > if (!-e $settings{log_anal_path} or !-d $settings{log_anal_path}) {
> > print "Content-type: text/html\n\n<h3>Unable to open directory
> > \"$settings{log_anal_path}\".<p>Check your server's file and directory
> > permissions, as well as your \"log_anal_path\" setting in
> > $settings{configfile}.</h3>";
> > exit;
> > }
> >
> > }
> >
> > # Get configuration settings that were entered into the URL, if any.
> > $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
> >
> > if ($ENV{'REQUEST_METHOD'} eq "POST") {
> > read(STDIN, $in, $ENV{'CONTENT_LENGTH'});
> > } else {
> > $in = $ENV{'QUERY_STRING'};
> > }
> >
> > my @settings = split(/&/, $in);
> >
> > foreach my $settings (@settings) {
> > (my $setting, my $value) = split(/=/, $settings);
> > $setting =~ tr/+/ /;
> > $setting =~ s/%(..)/pack("C", hex($1))/eg;
> > $value =~ tr/+/ /;
> > $value =~ s/%(..)/pack("C", hex($1))/eg;
> > TagFilter($setting);
> > TagFilter($value);
> >
> > if ($setting eq "server") {
> > ($settings{serverip},$settings{serverport}) = split(/:/,$value);
> > }
> >
> > if ($setting eq "events") {
> > $settings{numevents} = $value;
> > }
> >
> > if ($setting eq "refresh") {
> > $settings{refresh} = $value;
> > }
> >
> > }
> >
> > # Get the local time.
> > $now = localtime;
> >
> > $tmp = gethost($settings{serverip});
> >
> > if ($tmp) {
> > $settings{serverip} = inet_ntoa($tmp->addr);
> > }
> >
> > # Determine the current log file.
> > opendir(LOGDIR,"$settings{logdir}");
> > @logdir = sort (grep (/$settings{serverip}/,readdir(LOGDIR)));
> > closedir(LOGDIR);
> > $settings{logfile} = pop(@logdir);
> >
> > # Read the current log file and look for defined events. We assume that
> > # the
> > file is readable since the script was able to view the directory to
figure
> > out which file to use.
> > open(LOGFILE,"$settings{logdir}/$settings{logfile}");
> > @logdata = grep ( /\>\" say/|
> > /\" say_team/|
> > /\" killed/|
> > /\" committed suicide with/|
> > /Touched_A_Hostage/|
> > /Rescued_A_Hostage/|
> > /Killed_A_Hostage/|
> > /killed a teammate/|
> > /Planted_The_Bomb/|
> > /Defused_The_Bomb/|
> > /Target_Bombed/|
> > /Bomb_Defused/|
> > /All_Hostages_Rescued/|
> > /Hostages_Not_Rescued/|
> > /VIP_Escaped/|
> > /VIP_Assasinated/|
> > /Terrorists_Win/|
> > /CTs_Win/|
> > /connected,/|
> > /\" disconnected/|
> > /Team "CT" scored/|
> > /Team "TERRORIST" scored/|
> > /joined team /
> > ,<LOGFILE>);
> > close(LOGFILE);
> >
> > # Don't go outside our allowable range for refresh and event display.
> > if ($settings{refresh} < $settings{minrefresh}) {
> > $settings{refresh} = $settings{minrefresh};
> > } else {
> > $settings{refresh} = $settings{defrefresh} unless $settings{refresh};
> > }
> >
> > if ($settings{numevents} > $settings{maxevents}) {
> > $settings{numevents} = $settings{maxevents};
> > } else {
> > $settings{numevents} = $settings{defevents} unless
$settings{numevents};
> > }
> >
> > # The majority of the URL for each event setting change link is the same
> > # and
> > is defined here for convenience.
> > $cgiurl =
> >
>
"refresh=$settings{refresh}&server=$settings{serverip}:$settings{serverport}
> > ";
> >
> > # Get game server, player, and rule information from QStat.
> > @qstatoptions = ("-R","-P","-tsw","-raw","!@#@!","-hls");
> > my($qstat) = open(QSTAT,"-|");
> > die "Couldn't open pipe to subprocess" unless defined($qstat);
> >
>
system("$settings{qstatpath}/qstat",@qstatoptions,"$settings{serverip}:$sett
> > ings{serverport}") or die "Couldn't exec qstat" if $qstat == 0;
> > @qstat = <QSTAT>;
> > close QSTAT;
> >
> > chomp(@qstat);
> > $serverstat = shift(@qstat);
> > $ruleslist = shift(@qstat);
> > @playerlines = @qstat;
> > ($type,$ip,$servername,$map,$maxplayers,$curplayers,$ping,$timeout) =
> > split(/!@#@!/,$serverstat);
> >
> > if (!-e "$settings{imagepath}\/$map.jpg") {
> > $mapimage = "default.jpg";
> > } else {
> > $mapimage = "$map.jpg";
> > }
> >
> > # If debug mode is on, place the %settings hash in $debug.
> > if ($settings{debug} == 1) {
> > $debug .= "<table cellspacing=\"0\" cellpadding=\"0\"
> > width=\"100%\">\n";
> >
> > foreach $setting (sort (keys %settings)) {
> > $debug .= "<tr><td nowrap><font size=\"1\"
> > color=\"#808080\">$setting</font></td><td><font size=\"1\"
> > color=\"#E0E0E0\">&nbsp;=&nbsp;</font></td><td width=\"100%\"><font
> > size=\"1\" color=\"#E0E0E0\">$settings{$setting}</font></td></tr>\n";
> > }
> >
> > $debug .= "</table>\n<hr size=\"1\" width=\"100%\">";
> > }
> >
> > # If HLMaps is defined, link the map name and image to HLMaps. If HLMaps
> > # is
> > not defined but Log_Anal is, link the map name and image to Log_Anal.
> > Otherwise, leave it alone.
> > if ($settings{hlmaps}) {
> > $mapname = "<a href=\"$settings{hlmaps}?map=$map\">$map</a>";
> > } elsif ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$map.$settings{log_anal_extension}") {
> > $mapname = "<a
> >
>
href=\"$settings{log_anal_url}/$map.$settings{log_anal_extension}\">$map</a>
> > ";
> > } else {
> > $mapname = $map;
> > }
> >
> > if ($settings{hlmaps}) {
> > $mapimage = "<a href=\"$settings{hlmaps}?map=$map\"><img class=\"map\"
> > src=\"$settings{imageurl}/$mapimage\" width=\"212\" height=\"160\"
> > alt=\"Current map is $map.\"></a>";
> > } elsif ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$map.$settings{log_anal_extension}") {
> > $mapimage = "<a
> > href=\"$settings{log_anal_url}/$map.$settings{log_anal_extension}\"><img
> > class=\"map\" src=\"$settings{imageurl}/$mapimage\" width=\"212\"
> > height=\"160\" alt=\"Current map is $map.\"></a>";
> > } else {
> > $mapimage = "<img class=\"map\" src=\"$settings{imageurl}/$mapimage\"
> > width=\"212\" height=\"160\" alt=\"Current map is $map.\">";
> > }
> >
> > # Build the players list.
> > # Get the player list.
> > if (@playerlines) {
> >
> > while ($_ = shift @playerlines) {
> > ++$count1;
> > ($playername,$frags,$timeonserver) = split(/!@#@!/);
> >
> > # Sort the player list by frags.
> > push @playernamelist, $playername;
> > %playerlist = (
> > frags => $frags,
> > time => $timeonserver
> > );
> > for my $what (keys %playerlist) {
> > $player{$playername}{$what} = $playerlist{$what};
> > }
> >
> > }
> >
> > } else {
> >
> > push @playernamelist, "None connected!";
> > $player{"None connected!"}{time} = "00:00";
> > ++$count1;
> >
> > }
> >
> > sub byfrag {
> > $player{$b}{frags} <=> $player{$a}{frags};
> > }
> >
> > foreach $playername (sort byfrag @playernamelist) {
> > $frags = $player{$playername}{frags};
> > $timeonserver = $player{$playername}{time};
> > ($playerstats = $playername) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
> >
> > # Limit displayed player names to the maxplayername setting.
> > $playername =~ s/(^.{$settings{maxplayername}}(?!$))(.*$)/$1.../g;
> > TagFilter($playername);
> >
> > # Format the time on server display.
> > ($hours,$minutes,$seconds) = split(/:/,$timeonserver);
> >
> > if ($hours eq "00") {
> > $hours = "";
> > $minutes =~ s/0//;
> > } else {
> > $hours = $hours.":";
> > $hours =~ s/0//;
> > }
> >
> > if ($minutes eq "0") {
> > $minutes = "";
> > } else {
> > $minutes = $minutes.":";
> > }
> >
> > $playerinfo .= "<tr><td class=\"playerlist\" nowrap><font
> > size=\"1\">&nbsp;";
> >
> > # If any admins are present indicate them.
> > foreach my $admin (split/,/,$settings{admins}) {
> > $admin =~ s/^\s+//;
> > $admin =~ s/\s+$//;
> > TagFilter($admin);
> > if ($playername eq $admin) {
> > $playername = "$playername<font class=\"admin\">&#149;</font>";
> > }
> > }
> >
> > # If Log_Anal is defined, link each players name to their personal stats
> > page. Otherwise, just print their name.
> > if ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$playerstats.$settings{log_anal_extension}") {
> > $playerinfo .= "<a
> >
>
href=\"$settings{log_anal_url}/$playerstats.$settings{log_anal_extension}\">
> > $playername</a></font></td>";
> > } else {
> > $playerinfo .= "$playername</font></td>";
> > }
> >
> > $playerinfo .= "<td class=\"playerlist\" align=\"right\"><font
> > size=\"1\">&nbsp;$frags&nbsp;</font></td>";
> > $playerinfo .= "<td class=\"playerlist\" align=\"right\" nowrap><font
> > size=\"1\">&nbsp;$hours$minutes$seconds&nbsp;</font></td></tr>\n";
> >
> > }
> >
> > # Show blank lines up to the server's maxplayer setting. Looks nice.
> > while ($count1 < $maxplayers) {
> > ++$count1;
> > $playerinfo .= "<tr><td class=\"playerlist\" colspan=\"3\"><font
> > size=\"1\">&nbsp;</td></tr>\n";
> > }
> >
> > # Build the rules list.
> > # Get and format the rules list.
> > foreach (sort(split /!@#@!/, $ruleslist)) {
> > ($rule,$value) = split(/=/);
> > TagFilter($rule);
> > TagFilter($value);
> >
> > if ($value eq 0) {
> > $value = "<font color=\"#303030\">&#149;</font>";
> > } elsif ($value eq 1) {
> > $value = "<font color=\"#009900\">&#149;</font>";
> > }
> >
> > if ($rule eq "sv_contact") {
> > $value = "<a href=\"mailto:$value\">$value</a>";
> > }
> >
> > if ($rule eq "mp_mapvoteratio") {
> > $value = $value*100; $value = "$value%";
> > }
> >
> > if (($rule eq "gamename") && ($value eq "CounterStrike")) {
> > $value = "<a href=\"http://www.counter-strike.net\">CounterStrike";
> > }
> >
> > if (($rule eq "sv_os") && ($value eq "linux")) {
> > $value = "<a href=\"http://www.linux.org\">Linux";
> > } elsif (($rule eq "sv_os") && ($value eq "windows")) {
> > $value = "<a href=\"http://www.microsoft.com/windows\">Windows";
> > }
> >
> > # Defines which rules to show.
> > if ( /mp_mapvoteratio/ or
> > /mp_forcechasecam/ or
> > /mp_tkpunish/ or
> > /mp_autoteambalance/ or
> > /mp_limitteams/ or
> > /mp_autokick/ or
> > /mp_c4timer/ or
> > /sv_os/ or
> > /mp_roundtime/ or
> > /mp_flashlight/ or
> > /mp_friendlyfire/ or
> > /mp_timelimit/ or
> > /sv_maxrate/ or
> > /sv_minrate/ or
> > /sv_cheats/ or
> > /sv_type/ or
> > /mp_hostagepenalty/ or
> > /mp_footsteps/ or
> > /gamename/ or
> > /sv_contact/ ) {
> > ++$count2;
> > $rulesinfo .= "<tr><td class=\"ruleslist\"><font
> > size=\"1\">&nbsp;$rule</font></td>";
> > $rulesinfo .= "<td class=\"ruleslist\" align=\"right\" nowrap><font
> > size=\"1\">$value&nbsp;</font></td></tr>\n";
> > }
> >
> > }
> >
> > # Make the rules list at least as big as the player list if it isn't
> > already. Looks nice.
> > while ($count2 < $count1) {
> > ++$count2;
> > $rulesinfo .= "<tr><td class=\"ruleslist\" colspan=\"3\"><font
> > size=\"1\">&nbsp;</td></tr>\n";
> > }
> >
> > # Build the events list
> > # Grab the last x events according to what $numevents is set to.
> > while ($popcount < $settings{numevents}) {
> > ++$popcount;
> > my $newlogdata = pop @logdata;
> > push @newlogdata, $newlogdata;
> > }
> >
> > # If enabled, reverse the event order so that new events are on top.
> > if ($settings{reverse_order} == "1") {
> > @logdata = @newlogdata;
> > } else {
> > @logdata = reverse (@newlogdata);
> > }
> >
> > # This is where the log file data gets parsed out to HTML.
> > foreach $_ (@logdata) {
> >
> > # If debug is on, $eventinfo .= the raw log file message.
> > if ($settings{debug} == 1) {
> > ++$messagecount;
> > $eventinfo .= "<tr><td bgcolor=\"#D0D0D0\"></td>";
> > $eventinfo .= "<td colspan=\"2\" bgcolor=\"#D0D0D0\"><font size=\"1\"
> > color=\"#303030\">$_</font></td></tr>";
> > }
> >
> > # Print player chat messages.
> > # Updated for New Logging Format.
> > if (/\>\" say/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($player,$message) = split(/\" say "/);
> > @PlayerInfo = split(/\</,$player);
> > $player = $PlayerInfo[0];
> > $message =~ s/\"//;
> > $message =~ s/\s+$//;
> > TagFilter($player);
> > TagFilter($message);
> >
> > # Remove words in the banword list.
> > foreach my $banword (split/,/,$settings{banwords}) {
> > $banword =~ s/^\s+//;
> > $banword =~ s/\s+$//;
> > $message =~ s/\Q$banword/<font
> > size="1">&#149;&#149;&#149;&#149;&#149;<\/font>/i;
> > }
> >
> > $eventinfo .= "<tr><td class=\"chat\" width=\"16\"><img
> > src=\"$settings{imageurl}/chat.gif\" width=\"16\" height=\"16\"
> > alt=\"Message from $player\"></td>";
> > $eventinfo .= "<td class=\"chat\" width=\"25%\" nowrap><font
> > size=\"1\">$player&nbsp;&nbsp;</font></td>";
> > $eventinfo .= "<td class=\"chat\" width=\"75%\" width=\"100%\"><font
> > size=\"2\">$message</font></td></tr>\n";
> > }
> > # If team_messages is set to 1, show them.
> > # Updated for New Logging Format.
> > if (/\" say_team/) {
> > if ($settings{team_messages} == "1") {
> > (undef,$_) = split(/L.*: \"/);
> > ($player,$message) = split(/\" say_team "/);
> > @PlayerInfo = split(/\</,$player);
> > $player = $PlayerInfo[0];
> > $message =~ s/\"//;
> > $message =~ s/\s+$//;
> > TagFilter($player);
> > TagFilter($message);
> > # Remove words in the banword list.
> > foreach my $banword (split/,/,$settings{banwords}) {
> > $banword =~ s/^\s+//;
> > $banword =~ s/\s+$//;
> > $message =~ s/\Q$banword/<font
> > size="1">&#149;&#149;&#149;&#149;&#149;<\/font>/i;
> > }
> >
> > $eventinfo .= "<tr><td class=\"teamchat\" width=\"16\"><img
> > src=\"$settings{imageurl}/chat.gif\" width=\"16\" height=\"16\"
> > alt=\"Message from $player\"></td>";
> > $eventinfo .= "<td class=\"teamchat\" width=\"25%\" nowrap><font
> > size=\"1\">$player&nbsp;&nbsp;</font></td>";
> > $eventinfo .= "<td class=\"teamchat\" width=\"75%\"
width=\"100%\"><font
> > size=\"2\">$message</font></td></tr>\n";
> > }
> > }
> >
> > # Print kill messages where another player is the cause.
> > # Updated for New Logging Format.
> > if (/\" killed/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($killer,$_) = split(/\" killed \"/);
> > ($killed,$weapon) = split(/\" with "/);
> > @KillerInfo = split(/\</, $killer);
> > @KilledInfo = split(/\</, $killed);
> > ($killerteam,$_) = split(/\>/, $KillerInfo[3]);
> > ($killedteam,$_) = split(/\>/, $KilledInfo[3]);
> > $killer = $KillerInfo[0];
> > $killed = $KilledInfo[0];
> > $weapon =~ s/\s+$//;
> > $weapon =~ s/\"//;
> > ($killerstats = $killer) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
> > ($killedstats = $killed) =~ tr/\\\/\:\* \"\?\<\>\|\./_/;
> > TagFilter($killer);
> > TagFilter($killed);
> >
> > # Seperate out kills against Counter-Terrorists
> > # Updated for New Logging Format.
> > if (($killerteam eq "CT") and ($killedteam eq "TERRORIST")) {
> > $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> > src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
> > alt=\"$killer killed $killed\"></td>";
> >
> > # If Log_Anal is defined, link each players name to their personal stats
> > page. Otherwise, just print their name.
> > if ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$killerstats.$settings{log_anal_extension}") {
> > $killer = "<a
> >
>
href=\"$settings{log_anal_url}/$killerstats.$settings{log_anal_extension}\">
> > $killer</a>";
> > }
> >
> > if ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$killedstats.$settings{log_anal_extension}") {
> > $killed = "<a
> >
>
href=\"$settings{log_anal_url}/$killedstats.$settings{log_anal_extension}\">
> > $killed</a>";
> > }
> >
> > $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
> > size=\"1\">$killer&nbsp;&nbsp;</font></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
> > size=\"2\">killed $killed with ";
> >
> > # If Log_Anal is defined, link the weapon name to the weapon stats.
> > if ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$weapon.$settings{log_anal_extension}") {
> > $eventinfo .= "<a
> >
>
href=\"$settings{log_anal_url}/$weapon.$settings{log_anal_extension}\">$weap
> > onlist{$weapon}</a></font></td></tr>\n";
> > } else {
> > $eventinfo .= "$weaponlist{$weapon}</font></a></td></tr>\n";
> > }
> >
> > }
> >
> > # Seperate out kills against Terrorists
> > # Updated for new Logging Format.
> > if (($killerteam eq "TERRORIST") and ($killedteam eq "CT")) {
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
> > alt=\"$killer killed $killed\"></td>";
> >
> > # If Log_Anal is defined, link each players name to their personal stats
> > page. Otherwise, just print their name.
> > if ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$killerstats.$settings{log_anal_extension}") {
> > $killer = "<a
> >
>
href=\"$settings{log_anal_url}/$killerstats.$settings{log_anal_extension}\">
> > $killer</a>";
> > }
> >
> > if ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$killedstats.$settings{log_anal_extension}") {
> > $killed = "<a
> >
>
href=\"$settings{log_anal_url}/$killedstats.$settings{log_anal_extension}\">
> > $killed</a>";
> > }
> >
> > $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
> > size=\"1\">$killer&nbsp;&nbsp;</font></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">killed
> > $killed with ";
> >
> > # If Log_Anal is defined, link the weapon name to the weapon stats.
> > if ($settings{log_anal_url} and -f
> > "$settings{log_anal_path}/$weapon.$settings{log_anal_extension}") {
> > $eventinfo .= "<a
> >
>
href=\"$settings{log_anal_url}/$weapon.$settings{log_anal_extension}\">$weap
> > onlist{$weapon}</a></font></td></tr>\n";
> > } else {
> > $eventinfo .= "$weaponlist{$weapon}</font></a></td></tr>\n";
> > }
> >
> > }
> > # Seperate out teammate kills
> > # Added for New Logging Format.
> > if ($killerteam eq $killedteam){
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/teamkill.gif\" width=\"16\" height=\"16\"
> > alt=\"$killer killed a teammate\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"25%\" nowrap><font
> > size=\"1\">$killer</font></td>";
> > $eventinfo .= "<td class=\"system\" width=\"75%\"><font
> > size=\"2\">Killed a teammate</font></td></tr>\n";
> > }
> >
> > }
> >
> > # Print kill messages where the player kills themself.
> > # Updated for New Logging Format.
> > if (/\" committed suicide with/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($killed,$cause) = split(/\<.*\>\" committed suicide with "/);
> > $cause =~ s/\s+$//;
> > $cause =~s/\"//;
> > TagFilter($killed);
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/kill.gif\" width=\"16\" height=\"16\"
> > alt=\"$killed committed suicide\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"25%\" nowrap><font
> > size=\"1\">$killed</font></td>";
> > $eventinfo .= "<td class=\"system\" width=\"75%\"><font
> > size=\"2\">committed suicide with $cause</font></td></tr>\n";
> > }
> >
> > # Print hostage touch messages.
> > # Updated for New Logging Format.
> > if (/Touched_A_Hostage/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($groper) = split(/\<.*\>\" triggered/);
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> > alt=\"$groper touched a hostage\"></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
> > size=\"1\">$groper</font></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Touched
a
> > hostage</font></td></tr>\n";
> > }
> >
> > # Print hostage rescue messages.
> > # Updated for New Logging Format.
> > if (/Rescued_A_Hostage/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($rescuer) = split(/\<.*\>\" triggered/);
> > TagFilter($rescuer);
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> > alt=\"$rescuer rescued a hostage\"></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
> > size=\"1\">$rescuer</font></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Rescued
a
> > hostage</font></td></tr>\n";
> > }
> >
> > # Print hostage kill messages.
> > # Updated for New Logging Format.
> > if (/Killed_A_Hostage/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($killer) = split(/\<.*\>\" triggered/);
> > TagFilter($killer);
> > $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> > src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> > alt=\"$killer killed a hostage\"></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
> > size=\"1\">$killer</font></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
> > size=\"2\">Killed a hostage</font></td></tr>\n";
> > }
> >
> > # Print bomb plant messages.
> > # Updated for New Logging Format.
> > if (/Planted_The_Bomb/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($planter) = split(/\<.*\>\" triggered/);
> > TagFilter($planter);
> > $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> > src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
> > alt=\"$planter planted the bomb\"></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"25%\" nowrap><font
> > size=\"1\">$planter</font></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
> > size=\"2\">Planted the bomb</font></td></tr>\n";
> > }
> >
> > # Print bomb defuse messages.
> > # Updated for New Logging Format.
> > if (/Defused_The_Bomb/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($defuser) = split(/\<.*\>\" triggered/);
> > TagFilter($defuser);
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
> > alt=\"$defuser defused the bomb\"></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"25%\" nowrap><font
> > size=\"1\">$defuser</font></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">Defused
> > the
> > bomb</font></td></tr>\n";
> > }
> >
> > # Print all hostages rescued messages.
> > if (/All_Hostages_Rescued/) {
> > (undef,$_) = split(/L.*: \"/);
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> > alt=\"All hostages rescued\"></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">All hostages rescued</font></td></tr>\n";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>";
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Counter-Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
> > size=\"1\">Round result: <b>Counter-Terrorists
> > Win</b></font></td></tr>\n";
> > }
> >
> > # Print hostages not rescued message.
> > # Updated for New Logging Format
> > if (/Hostages_Not_Rescued/) {
> > (undef,$_) = split(/L.*: /);
> > @RoundInfo = split(/\(/,$_);
> > $ctscore = $RoundInfo[1];
> > $terroristscore = $RoundInfo[2];
> > $ctscore =~ s/CT//;
> > $terroristscore =~ s/T//;
> > $ctscore =~ s/\"//;
> > $ctscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $ctscore =~ s/\)//;
> > $terroristscore =~ s/\)//;
> > $ctscore =~ s/ //;
> > $ctscore =~ s/ //;
> > $terroristscore =~ s/\ //;
> > $terroristscore =~ s/\s+$//;
> > $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> > src=\"$settings{imageurl}/hostage.gif\" width=\"16\" height=\"16\"
> > alt=\"Hostages not rescued\"></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"100%\"
colspan=\"2\"><font
> > size=\"1\">Hostages not rescued</font></td></tr>\n";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>";
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
> > size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
> > CTs: $ctscore</b></font></td></tr>\n";
> > }
> >
> > # Print target successfully bombed messages.
> > # Updated for New Logging Format
> > if (/Target_Bombed/) {
> > (undef,$_) = split(/L.*: /);
> > @RoundInfo = split(/\(/,$_);
> > $ctscore = $RoundInfo[1];
> > $terroristscore = $RoundInfo[2];
> > $ctscore =~ s/CT//;
> > $terroristscore =~ s/T//;
> > $ctscore =~ s/\"//;
> > $ctscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $ctscore =~ s/\)//;
> > $terroristscore =~ s/\)//;
> > $ctscore =~ s/ //;
> > $ctscore =~ s/ //;
> > $terroristscore =~ s/\ //;
> > $terroristscore =~ s/\s+$//;
> > $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> > src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
> > alt=\"Target successfully bombed\"></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"100%\"
colspan=\"2\"><font
> > size=\"1\">Target successfully bombed</font></td></tr>\n";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>";
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"3\"><font
> > size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
> > CTs: $ctscore</b></font></td></tr>\n";
> > }
> >
> > # Print bomb sucessfully defused messages.
> > # Updated for New Logging Format
> > if (/Bomb_Defused/) {
> > (undef,$_) = split(/L.*: /);
> > @RoundInfo = split(/\(/,$_);
> > $ctscore = $RoundInfo[1];
> > $terroristscore = $RoundInfo[2];
> > $ctscore =~ s/CT//;
> > $terroristscore =~ s/T//;
> > $ctscore =~ s/\"//;
> > $ctscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $ctscore =~ s/\)//;
> > $terroristscore =~ s/\)//;
> > $ctscore =~ s/ //;
> > $ctscore =~ s/ //;
> > $terroristscore =~ s/\ //;
> > $terroristscore =~ s/\s+$//;
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/bomb.gif\" width=\"16\" height=\"16\"
alt=\"Bomb
> > successfully defused\"></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">Bomb successfully defused</font></td></tr>\n";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>";
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Counter-Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
> > Terrorists: $terroristscore</b></font></td></tr>\n";
> > }
> >
> > # Print VIP escape messages.
> > # Updated for New Logging Format
> > if (/VIP_Escaped/) {
> > (undef,$_) = split(/L.*: /);
> > @RoundInfo = split(/\(/,$_);
> > $ctscore = $RoundInfo[1];
> > $terroristscore = $RoundInfo[2];
> > $ctscore =~ s/CT//;
> > $terroristscore =~ s/T//;
> > $ctscore =~ s/\"//;
> > $ctscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $ctscore =~ s/\)//;
> > $terroristscore =~ s/\)//;
> > $ctscore =~ s/ //;
> > $ctscore =~ s/ //;
> > $terroristscore =~ s/\ //;
> > $terroristscore =~ s/\s+$//;
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/vip.gif\" width=\"16\" height=\"16\" alt=\"VIP
> > Escaped\"></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">VIP escaped</font></td>";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>";
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Counter-Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
> > Terrorists: $terroristscore</b></font></td></tr>\n";
> > }
> >
> > # Print VIP assassination messages.
> > # Updated for New Logging Format
> > if (/VIP_Assasinated/) {
> > (undef,$_) = split(/L.*: /);
> > @RoundInfo = split(/\(/,$_);
> > $ctscore = $RoundInfo[1];
> > $terroristscore = $RoundInfo[2];
> > $ctscore =~ s/CT//;
> > $terroristscore =~ s/T//;
> > $ctscore =~ s/\"//;
> > $ctscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $ctscore =~ s/\)//;
> > $terroristscore =~ s/\)//;
> > $ctscore =~ s/ //;
> > $ctscore =~ s/ //;
> > $terroristscore =~ s/\ //;
> > $terroristscore =~ s/\s+$//;
> > $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> > src=\"$settings{imageurl}/vip.gif\" width=\"16\" height=\"16\" alt=\"VIP
> > Assassinated\"></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"100%\"
colspan=\"2\"><font
> > size=\"1\">VIP assassinated</font></td>";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>";
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
> > CTs: $ctscore</b></font></td></tr>\n";
> > }
> >
> > # Print Terrorists Win messages.
> > # Updated for New Logging Format
> > if (/Terrorists_Win/) {
> > (undef,$_) = split(/L.*: /);
> > @RoundInfo = split(/\(/,$_);
> > $ctscore = $RoundInfo[1];
> > $terroristscore = $RoundInfo[2];
> > $ctscore =~ s/CT//;
> > $terroristscore =~ s/T//;
> > $ctscore =~ s/\"//;
> > $ctscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $ctscore =~ s/\)//;
> > $terroristscore =~ s/\)//;
> > $ctscore =~ s/ //;
> > $ctscore =~ s/ //;
> > $terroristscore =~ s/\ //;
> > $terroristscore =~ s/\s+$//;
> > $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"100%\"
colspan=\"2\"><font
> > size=\"1\">Terrorists Win!</font></td>";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>";
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">Round result: <b>Terrorists Win! Terrorists: $terroristscore
> > CTs: $ctscore</b></font></td></tr>\n";
> > }
> >
> > # Print CTs Win messages.
> > if (/CTs_Win/) {
> > (undef,$_) = split(/L.*: /);
> > @RoundInfo = split(/\(/,$_);
> > $ctscore = $RoundInfo[1];
> > $terroristscore = $RoundInfo[2];
> > $ctscore =~ s/CT//;
> > $terroristscore =~ s/T//;
> > $ctscore =~ s/\"//;
> > $ctscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $terroristscore =~ s/\"//;
> > $ctscore =~ s/\)//;
> > $terroristscore =~ s/\)//;
> > $ctscore =~ s/ //;
> > $ctscore =~ s/ //;
> > $terroristscore =~ s/\ //;
> > $terroristscore =~ s/\s+$//;
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
alt=\"CT's
> > Win!\"></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">CTs Win!</font></td>";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>";
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Counter-Terrorists Win\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">Round result: <b>Counter-Terrorists Win! CTs: $ctscore
> > Terrorists: $terroristscore</b></font></td></tr>\n";
> > }
> > # Print player connect messages.
> > # Updated for New Logging Format
> > if (/ connected/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($player,$_) = split(/connected, /);
> > @PlayerInfo = split(/\</, $player);
> > $player = $PlayerInfo[0];
> > TagFilter($player);
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/conn.gif\" width=\"16\" height=\"16\"
> > alt=\"$player joined the server\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"25%\"><font
> > size=\"1\">$player</font></td>";
> > $eventinfo .= "<td class=\"system\" width=\"75%\"><font
size=\"2\">joined
> > the server</font></td></tr>\n";
> > }
> >
> > # Print player disconnect messages.
> > # Updated for new Logging format
> > if (/\" disconnected/) {
> > (undef,$_) = split(/L.*: \"/);
> > ($player,$_) = split(/\" disconnected/);
> > @PlayerInfo = split(/\</,$player);
> > $player = @PlayerInfo[0];
> > TagFilter($player);
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/disconn.gif\" width=\"16\" height=\"16\"
> > alt=\"$player left the server\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"25%\"><font
> > size=\"1\">$player</font></td>";
> > $eventinfo .= "<td class=\"system\" width=\"75%\"><font size=\"2\">left
> > the
> > server</font></td></tr>\n";
> > }
> >
> > # Print player team join messages.
> > # Updated for New Logging Format.
> > if (/ joined team /) {
> > (undef,$_) = split(/L.*: \"/);
> > ($player,$team) = split(/ joined team /);
> > @PlayerInfo = split(/\</,$player);
> > $team =~ s/\s+$//;
> > $team =~ s/\"//;
> > $team =~ s/\"//;
> > $player = $PlayerInfo[0];
> > TagFilter($player);
> > if ($team eq "CT") {
> > $eventinfo .= "<tr><td class=\"ct\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"$player joined the Counter-Terrorist team\"></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"25%\"><font
> > size=\"1\">$player</font></td>";
> > $eventinfo .= "<td class=\"ct\" width=\"75%\"><font size=\"2\">joined
> > the
> > Counter-Terrorist team</font></td></tr>\n";
> > }
> > if ($team eq "TERRORIST") {
> > $eventinfo .= "<tr><td class=\"terrorist\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"$player joined the Terrorist team\"></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"25%\"><font
> > size=\"1\">$player</font></td>";
> > $eventinfo .= "<td class=\"terrorist\" width=\"75%\"><font
> > size=\"2\">joined the Terrorist team</font></td></tr>\n";
> > }
> > }
> >
> > # Print team scores.
> > # Seperate out Counter-Terrorist wins.
> > # Updated for New Logging Format
> > if (/Team "CT" scored/) {
> > (undef,$_) = split(/L.*: /);
> > @GameInfo = split(/\"/,$_);
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Counter-Terrorist Wins\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">Counter-Terrorist Wins: <b>Scored $GameInfo[3] with
> > $GameInfo[5] Players</b></font></td></tr>\n";
> > }
> >
> > # Seperate out Terrorist wins.
> > # Updated for New Logging Format
> > if (/Team "TERRORIST" scored/) {
> > (undef,$_) = split(/L.*: /);
> > @GameInfo = split(/\"/,$_);
> > $eventinfo .= "<tr><td class=\"system\" width=\"16\"><img
> > src=\"$settings{imageurl}/info.gif\" width=\"16\" height=\"16\"
> > alt=\"Terrorist Wins\"></td>";
> > $eventinfo .= "<td class=\"system\" width=\"100%\" colspan=\"2\"><font
> > size=\"1\">Terrorist Wins: <b>Scored $GameInfo[3] with $GameInfo[5]
> > Players</b></font></td></tr>\n";
> > $eventinfo .= "<tr><td width=\"100%\" colspan=\"3\"><img
> > src=\"$settings{imageurl}/trans.gif\" width=\"1\"
> > height=\"1\"></td></tr>"; }
> > }
> >
> > # Output to the web browser
> > print "Content-type: text/html\n\n";
> > print "<!-- generated by csserverstat -
> > http://server.counter-strike.net/csserverstat -->\n\n";
> >
> > open(TEMPLATE,"$settings{template}");
> >
> > foreach $_ (<TEMPLATE>) {
> > $_ =~ s/(\$\w+\{\w+\})/$1/eeg;
> > $_ =~ s/(\$\w+)/$1/eeg;
> > print $_;
> > }
> >
> > close(TEMPLATE);
> >
> > # End script.
> > exit;
> >
> >
> >
>



J. Martin Petersen (17-06-2001)
Kommentar
Fra : J. Martin Petersen


Dato : 17-06-01 10:54

On Sun, 17 Jun 2001 10:54:22 +0200, "Jimmy Marcus Larsen"
<wario@obel.auc.dk> wrote:

>Mange tak! Nu virker det som det skal!

[KLIP!]

Har du ikke også lige lyst til at læse
http://www.usenet.dk/netikette/quote.html ?

--
J. Martin Petersen "Atter springer gnuerne ud i vandet..."

Jimmy Marcus Larsen (17-06-2001)
Kommentar
Fra : Jimmy Marcus Larsen


Dato : 17-06-01 17:44

Luk nu røven! Jeg er sikker på at ham jeg svarede forstod jeg takkede!!!


"J. Martin Petersen" <jmp@cool.dk> wrote in message
news:bgvoitogjprk4l1492892cjpskegcphga8@4ax.com...
> On Sun, 17 Jun 2001 10:54:22 +0200, "Jimmy Marcus Larsen"
> <wario@obel.auc.dk> wrote:
>
> >Mange tak! Nu virker det som det skal!
>
> [KLIP!]
>
> Har du ikke også lige lyst til at læse
> http://www.usenet.dk/netikette/quote.html ?
>
> --
> J. Martin Petersen "Atter springer gnuerne ud i vandet..."



Adam Sjøgren (17-06-2001)
Kommentar
Fra : Adam Sjøgren


Dato : 17-06-01 18:23

On Sun, 17 Jun 2001 18:44:18 +0200, Jimmy Marcus Larsen wrote:

> Luk nu røven! Jeg er sikker på at ham jeg svarede forstod jeg
> takkede!!!

Det er da ikke september endnu?

*PLONK*


H.

--
"Reggi is good too... also SKA!!!!!! & rokabili!!!!" Adam Sjøgren
asjo@koldfront.dk

Peter Makholm (17-06-2001)
Kommentar
Fra : Peter Makholm


Dato : 17-06-01 18:34

asjo@koldfront.dk (Adam Sjøgren) writes:

> Det er da ikke september endnu?

xyzzy% date
2847 Sep 1993 19:33:53 +0200
Xyzzy%

Joohhhh.

--
hash-bang-slash-bin-slash-bash

Adam Sjøgren (17-06-2001)
Kommentar
Fra : Adam Sjøgren


Dato : 17-06-01 18:43

On 17 Jun 2001 19:34:29 +0200, Peter Makholm wrote:

> xyzzy% date
> 2847 Sep 1993 19:33:53 +0200

<*griiiiin*>


Tak! ,

--
"Mercurychrome.. - Waitin', when the wound's scraped raw Adam Sjøgren
Bones... - The biggest stitches that you ever wore" asjo@koldfront.dk

Thorbjørn Ravn Ander~ (18-06-2001)
Kommentar
Fra : Thorbjørn Ravn Ander~


Dato : 18-06-01 00:53

Jimmy Marcus Larsen wrote:
>
> Luk nu røven! Jeg er sikker på at ham jeg svarede forstod jeg takkede!!!

Fingeren i jorden, unge mand. Høvisk tale, tak...

--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear

Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408925
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste