--- projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java 2001/03/06 02:33:55 1.17 +++ projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java 2001/03/08 13:43:54 1.18 @@ -18,8 +18,8 @@ import java.text.*; * Clean shutdown could be achieved by stopping the run() method in the * IRCBot inner class. * - * @author $Author: ajm $ - * @version $Id: IRC__Alerter.java,v 1.17 2001/03/06 02:33:55 ajm Exp $ + * @author $Author: tdb $ + * @version $Id: IRC__Alerter.java,v 1.18 2001/03/08 13:43:54 tdb Exp $ */ public class IRC__Alerter implements PluginAlerter { @@ -28,7 +28,7 @@ public class IRC__Alerter implements PluginAlerter { /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.17 $"; + public final String REVISION = "$Revision: 1.18 $"; /** * A description of this alerter @@ -106,6 +106,9 @@ public class IRC__Alerter implements PluginAlerter { _alertCount ++; } } + else { + _ignoredCount ++; + } } /** @@ -172,9 +175,14 @@ public class IRC__Alerter implements PluginAlerter { /** * Number of alerts sent */ - private long _alertCount = 0; + private int _alertCount = 0; /** + * Number of alerts ignored when in "stopped" mode + */ + private int _ignoredCount = 0; + + /** * Time of IRCBot startup */ private long _startTime; @@ -555,12 +563,15 @@ public class IRC__Alerter implements PluginAlerter { sendPrivMsg(getMsgSender(line), helpCommand); } else if(message.indexOf(statCommand)!=-1) { - sendMsg(getMsgSender(line)+", I have sent a total of "+_alertCount+" alerts!"); + sendMsg(getMsgSender(line)+", I have sent a total of "+_alertCount+" alerts, and ignored a total of "+_ignoredCount+"!"); } else if(message.indexOf(uptimeCommand)!=-1) { long uptime = (System.currentTimeMillis() - _startTime) / 1000; String uptimeText = DateUtils.formatTime(uptime, "%DAYS% days, %HOURS% hours, %MINS% mins, and %SECS% secs"); sendMsg(getMsgSender(line)+", I have been running for "+uptimeText); + } + else if(message.indexOf("ping")!=-1) { + sendMsg("pong"); } else if(message.indexOf("do a jibble dance")!=-1) { // little joke :)