]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
new feature: dp_timinglog, write a log file of all timing reports
authorRudolf Polzer <divverent@alientrap.org>
Fri, 24 Feb 2012 12:29:37 +0000 (13:29 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 24 Feb 2012 12:29:37 +0000 (13:29 +0100)
server/rcon2irc/rcon2irc-example.conf
server/rcon2irc/rcon2irc.pl

index 7a5379913537e86401063a3daeb5286c827da8eb..aa0b947cfe07e3e1f80bafc4ce744b16322a8e46 100644 (file)
@@ -43,6 +43,7 @@ irc_channel = #Xonotic-Pwayers
 #dp_listen_from_server =
 #dp_status_delay = 30
 #dp_utf8_enable = 1
+#dp_timinglog = timing.log
 #irc_reconnect_delay = 300
 #irc_admin_timeout = 3600
 #irc_admin_quote_re =
index 8f7ba04957ac445201e173619c8a92d23b1835a5..312e36404771eb422cc0576be5fc1566f2305c24 100755 (executable)
@@ -752,6 +752,7 @@ our %config = (
        dp_server_from_wan => "",
        dp_listen_from_server => "", 
        dp_utf8_enable => $color_utf8_enable,
+       dp_timinglog => "",
        irc_local => "",
 
        irc_admin_password => "",
@@ -1728,6 +1729,15 @@ sub cond($)
                my ($all, $cpu, $lost, $avg, $max, $sdev) = @_;
                return 0 # don't complain when just on the voting screen
                        if !$store{playing};
+               if(length $config{dp_timinglog})
+               {
+                       open my $fh, '>>', $config{dp_timinglog}
+                               or warn "open >> $config{dp_timinglog}: $!";
+                       print $fh "@{[time]} $cpu $lost $avg $max $sdev\n"
+                               or warn "print >> $config{dp_timinglog}: $!";
+                       close $fh
+                               or warn "close >> $config{dp_timinglog}: $!";
+               }
                return 0 # don't complain if it was less than 0.5%
                        if $lost < 0.5;
                return 0 # don't complain if nobody is looking