<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -56,7 +56,7 @@ module Kookaburra
     def run!
       begin
         EventMachine::run do
-          EventMachine::add_periodic_timer(60) do
+          EventMachine::add_periodic_timer(15) do
             Kookaburra::IRC::Server.ping_all
           end
           EventMachine::start_server &quot;0.0.0.0&quot;, Kookaburra::Settings.port, Kookaburra::IRC::Server</diff>
      <filename>lib/kookaburra/base_extension.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ module Kookaburra
 
         def handle_nick(s)
           Kookaburra.logger.info &quot;Attemping to set nick to #{s}&quot;
-          if Kookaburra::Stores.users[s].nil?
+          if !s.blank? &amp;&amp; Kookaburra::Stores.users[s].nil?
             userlist = {}
             if @nick.nil?
               handle_newconnect(s)
@@ -28,26 +28,27 @@ module Kookaburra
               userlist[s] = self if self.nick != s
               Kookaburra::Stores.users.delete(@nick)
               @nick = s
-              Kookaburra::Stores.users[self.nick] = self
-              #send the info to the world
-              #get unique users.
-              @channels.each  do |c|
-                Kookaburra::Stores.channels[c].each_user do |u|
-                  userlist[u.nick] = u
-                end
-              end
-              userlist.values.each do |user|
-                user.reply :nick, s
-              end
-              @usermsg = &quot;:#{@nick}!~#{@user}@#{@peername}&quot;
-              Kookaburra.message_server.unviewed_for(self.nick).each do |message|
-                reply :privmsg, &quot;:#{message.from}!~unknown@cockatoo-server-queue&quot;, self.nick, message.content
+            end
+            Kookaburra::Stores.users[self.nick] = self
+            #send the info to the world
+            #get unique users.
+            @channels.each  do |c|
+              Kookaburra::Stores.channels[c].each_user do |u|
+                userlist[u.nick] = u
               end
-              Kookaburra.message_server.mark_as_viewed!(self.nick)
             end
+            userlist.values.each do |user|
+              user.reply :nick, s
+            end
+            @usermsg = &quot;:#{@nick}!~#{@user}@#{@peername}&quot;
+            Kookaburra.message_server.unviewed_for(self.nick).each do |message|
+              reply :privmsg, &quot;:#{message.from}!~unknown@cockatoo-server-queue&quot;, self.nick, message.content
+            end
+            Kookaburra.message_server.mark_as_viewed!(self.nick)
           else
             #check if we are just nicking ourselves.
             unless Kookaburra::Stores.users[s] == self
+              Kookaburra.logger.info &quot;Nick #{s} is taken, responding.&quot;
               reply :numeric, Replies::ERR_NICKNAMEINUSE, &quot;* #{s} &quot;,&quot;Nickname is already in use.&quot;
               @nick_tries += 1
               if @nick_tries &gt; Kookaburra::Settings.max_nick_tries
@@ -69,6 +70,7 @@ module Kookaburra
         end
         
         def handle_join(channels)
+          #return if @nick.blank?
           channels.split(/,/).each do |ch|
             c = ch.strip
             if c !~ CHANNEL
@@ -95,11 +97,12 @@ module Kookaburra
           Kookaburra.logger.info &quot;Got pong: #{srv}&quot;
           # If we have more than one outstanding ping,
           # We decrease the outstanding count.
-          #Kookaburra::Stores.pings[self.nick] -= 1 if Kookaburra::Stores.pings[self.nick] &gt; 0
+          Kookaburra::Stores.pings[self.nick] -= 1 if Kookaburra::Stores.pings[self.nick] &gt; 0
           Kookaburra.logger.info &quot;Ping count for #{self.nick} - #{Kookaburra::Stores.pings[self.nick]}&quot;
         end
 
         def handle_privmsg(target, msg)
+          #return if @nick.blank?
           viewed = true
           case target.strip
           when &quot;#all&quot;
@@ -130,6 +133,7 @@ module Kookaburra
         end
 
         def handle_notice(target, msg)
+          #return if @nick.blank?
           case target.strip
           when CHANNEL
             channel= Kookaburra::Stores.channels[target]
@@ -173,6 +177,7 @@ module Kookaburra
         end
 
         def handle_topic(channel, topic)
+          #return if @nick.blank?
           Kookaburra.logger.info  &quot;handle topic for #{channel}: #{topic}&quot;
           if topic.nil? or topic =~ /^ *$/
             send_topic(channel)
@@ -261,10 +266,10 @@ module Kookaburra
 
         def handle_userhost(nicks)
           info = []
-          nicks.split(/,/).each {|nick|
+          nicks.split(/,/).each do |nick|
             user = Kookaburra::Stores.users[nick]
             info &lt;&lt; user.nick + '=-' + user.nick + '@' + user.peer
-          }
+          end
           reply :numeric, Replies::RPL_USERHOST,&quot;&quot;, info.join(' ')
         end
 
@@ -292,7 +297,6 @@ module Kookaburra
           reply :raw, &quot;NOTICE AUTH :Kookaburra v#{Kookaburra::VERSION} initialized, welcome.&quot;
         end
         
-        
       end
     end
   end</diff>
      <filename>lib/kookaburra/irc/client_extensions/handle_mixin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,6 +55,7 @@ module Kookaburra
         def send_ping
           if Kookaburra::Stores.pings[self.nick] &gt; Kookaburra::Settings.max_pings
             Kookaburra.logger.fatal &quot;#{self.nick} hasn't responded to pings.&quot;
+            Kookaburra::Stores.pings[self.nick] = 0
             self.server.close_connection
           else
             Kookaburra::Stores.pings[self.nick] += 1</diff>
      <filename>lib/kookaburra/irc/client_extensions/send_mixin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -106,8 +106,9 @@ module Kookaburra
       end
 
       def self.ping_all
-        Kookaburra.logger.info &quot;Pinging all users&quot;
+        Kookaburra.logger.info &quot;Pinging all users - #{Kookaburra::Stores.users.nicks.join(&quot;,&quot;)}&quot;
         Kookaburra::Stores.users.each_user do |client|
+          Kookaburra.logger.info &quot;Pinging #{client.nick}&quot;
           client.send_ping
         end
       end</diff>
      <filename>lib/kookaburra/irc/server.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a8279a260ad1864367d0bcca581f3725c4436be0</id>
    </parent>
  </parents>
  <author>
    <name>Darcy Laycock</name>
    <email>sutto@sutto.net</email>
  </author>
  <url>http://github.com/Sutto/kookaburra-server/commit/396e8ae08734af0b91c4a9f37466289af1a18784</url>
  <id>396e8ae08734af0b91c4a9f37466289af1a18784</id>
  <committed-date>2008-11-08T04:27:25-08:00</committed-date>
  <authored-date>2008-11-08T04:27:25-08:00</authored-date>
  <message>More work to make the server robust</message>
  <tree>bd67ac44e7e0258c3bed5a9e40c1416318e75881</tree>
  <committer>
    <name>Darcy Laycock</name>
    <email>sutto@sutto.net</email>
  </committer>
</commit>
