Example #1
0
 /**
  * Checks if ping timed out.
  * @param Timer $e The timer.
  */
 public function pingTimer($e)
 {
     if ($this->lastActivity + self::TIMEOUT < time()) {
         // Ping timed out. Reconnecting time!
         $this->bot->log('Ping timeout detected. Attempting to reconnect.', array(), LogLevels::WARNING);
         $this->bot->reconnect();
     }
     // Check back in another round.
     $e->extend(self::TIMEOUT);
 }
 /**
  * Flushes queues. Called by timer.
  * @param Timer $e The timer that called this method.
  */
 public function flush(Timer $e)
 {
     $e->extend(5);
 }