ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java (file contents):
Revision 1.17 by ajm, Tue Mar 6 02:33:55 2001 UTC vs.
Revision 1.19 by tdb, Tue Mar 13 02:19:43 2001 UTC

# Line 52 | Line 52 | public class IRC__Alerter implements PluginAlerter {
52                          
53          // connect to the IRC server
54          _ircbot = new IRCBot();
55 +        // set it's name and start it
56 +        _ircbot.setName("client.IRC__Alerter$IRCBot");
57          _ircbot.start();
58          _startTime = System.currentTimeMillis();
59          
# Line 106 | Line 108 | public class IRC__Alerter implements PluginAlerter {
108                  _alertCount ++;
109              }
110          }
111 +        else {
112 +            _ignoredCount ++;
113 +        }
114      }
115  
116      /**
# Line 172 | Line 177 | public class IRC__Alerter implements PluginAlerter {
177      /**
178       * Number of alerts sent
179       */
180 <    private long _alertCount = 0;
180 >    private int _alertCount = 0;
181      
182      /**
183 +     * Number of alerts ignored when in "stopped" mode
184 +     */
185 +    private int _ignoredCount = 0;
186 +    
187 +    /**
188       * Time of IRCBot startup
189       */
190      private long _startTime;
# Line 555 | Line 565 | public class IRC__Alerter implements PluginAlerter {
565                      sendPrivMsg(getMsgSender(line), helpCommand);
566                  }
567                  else if(message.indexOf(statCommand)!=-1) {
568 <                    sendMsg(getMsgSender(line)+", I have sent a total of "+_alertCount+" alerts!");
568 >                    sendMsg(getMsgSender(line)+", I have sent a total of "+_alertCount+" alerts, and ignored a total of "+_ignoredCount+"!");
569                  }
570                  else if(message.indexOf(uptimeCommand)!=-1) {
571                      long uptime = (System.currentTimeMillis() - _startTime) / 1000;
572                      String uptimeText = DateUtils.formatTime(uptime, "%DAYS% days, %HOURS% hours, %MINS% mins, and %SECS% secs");
573                      sendMsg(getMsgSender(line)+", I have been running for "+uptimeText);
574 +                }
575 +                else if(message.indexOf("ping")!=-1) {
576 +                    sendMsg("pong");
577                  }
578                  else if(message.indexOf("do a jibble dance")!=-1) {
579                      // little joke :)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines