r3653 - trunk/Docs/server/rcon2irc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri May 23 10:02:55 EDT 2008


Author: div0
Date: 2008-05-23 10:02:54 -0400 (Fri, 23 May 2008)
New Revision: 3653

Modified:
   trunk/Docs/server/rcon2irc/rbiserver.pl
   trunk/Docs/server/rcon2irc/rcon2irc.pl
Log:
move "timing problems" feature from rbiserver.pl to rcon2irc.pl


Modified: trunk/Docs/server/rcon2irc/rbiserver.pl
===================================================================
--- trunk/Docs/server/rcon2irc/rbiserver.pl	2008-05-23 13:14:04 UTC (rev 3652)
+++ trunk/Docs/server/rcon2irc/rbiserver.pl	2008-05-23 14:02:54 UTC (rev 3653)
@@ -87,26 +87,3 @@
 	$store{rbi_totalvotes} = $totalvotes;
 	return 0;
 } ],
-
-# retrieve system load data
-[ dp => q{timing:   (([0-9.]*)% CPU, ([0-9.]*)% lost, offset avg ([0-9.]*)ms, max ([0-9.]*)ms, sdev ([0-9.]*)ms)} => sub {
-	my ($all, $cpu, $lost, $avg, $max, $sdev) = @_;
-	return 0 # don't complain when just on the voting screen
-		if !$store{playing};
-	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
-		if $store{slots_active} == 0;
-	return 0 # don't complain in the first two minutes
-		if time() - $store{map_starttime} < 120;
-	return 0 # don't complain if it was already at least half as bad in this round
-		if $store{map_starttime} == $store{timingerror_map_starttime} and $lost <= 2 * $store{timingerror_lost};
-	$store{timingerror_map_starttime} = $store{map_starttime};
-	$store{timingerror_lost} = $lost;
-	out dp => 0, 'rcon2irc_say_as server "There are currently some severe system load problems. A log file has been written."';
-	#my $subj = "slow $lost% on $store{slots_active}p $store{map} @{[int(time() - $store{map_starttime})]}s on $config{dp_server}";
-	#system "{ echo '$subj'; echo '$cpu% CPU, $lost% lost, offset ms: $avg max $max sdev $sdev'; top -b -n 1; } | mail -s 'Nexuiz: $subj' divVerent\@alientrap.org";
-	out irc => 1, "PRIVMSG $config{irc_channel} :\001ACTION has big trouble on $store{map} after @{[int(time() - $store{map_starttime})]}s: $all\001";
-	out irc => 1, "PRIVMSG OpBaI :\001ACTION has big trouble on $store{map} after @{[int(time() - $store{map_starttime})]}s: $all\001";
-	return 0;
-} ],

Modified: trunk/Docs/server/rcon2irc/rcon2irc.pl
===================================================================
--- trunk/Docs/server/rcon2irc/rcon2irc.pl	2008-05-23 13:14:04 UTC (rev 3652)
+++ trunk/Docs/server/rcon2irc/rcon2irc.pl	2008-05-23 14:02:54 UTC (rev 3653)
@@ -1115,6 +1115,27 @@
 		out irc => 0, "PRIVMSG $config{irc_channel} :\001ACTION would have LIKED to put the scores here, but they wouldn't fit :(\001";
 		return 0;
 	} ],
+
+	# complain when system load gets too high
+	[ dp => q{timing:   (([0-9.]*)% CPU, ([0-9.]*)% lost, offset avg ([0-9.]*)ms, max ([0-9.]*)ms, sdev ([0-9.]*)ms)} => sub {
+		my ($all, $cpu, $lost, $avg, $max, $sdev) = @_;
+		return 0 # don't complain when just on the voting screen
+			if !$store{playing};
+		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
+			if $store{slots_active} == 0;
+		return 0 # don't complain in the first two minutes
+			if time() - $store{map_starttime} < 120;
+		return 0 # don't complain if it was already at least half as bad in this round
+			if $store{map_starttime} == $store{timingerror_map_starttime} and $lost <= 2 * $store{timingerror_lost};
+		$store{timingerror_map_starttime} = $store{map_starttime};
+		$store{timingerror_lost} = $lost;
+		out dp => 0, 'rcon2irc_say_as server "There are currently some severe system load problems. The admins have been notified."';
+		out irc => 1, "PRIVMSG $config{irc_channel} :\001ACTION has big trouble on $store{map} after @{[int(time() - $store{map_starttime})]}s: $all\001";
+		#out irc => 1, "PRIVMSG OpBaI :\001ACTION has big trouble on $store{map} after @{[int(time() - $store{map_starttime})]}s: $all\001";
+		return 0;
+	} ],
 );
 
 




More information about the nexuiz-commits mailing list