Пример #1
0
 public function quitCommand($command, $params, IrcDataObject $data)
 {
     $auth = $this->parent->getModule('Auth');
     if (!$auth->nicknameIsTrusted($data->getMessage()['nick'])) {
         return;
     }
     $message = empty($params) ? 'WildPHP shutting down...' : $params;
     $this->parent->write($this->parent->getGenerator()->ircQuit($message));
 }
 /**
  * @param IrcDataObject $data
  */
 public function receiveServerConfig(IrcDataObject $data)
 {
     $values = $data->getParams()['iterable'];
     $configuration = $this->parent->getModule('Configuration');
     $logger = $this->parent->getModule('Logger');
     foreach ($values as $value) {
         $parts = explode('=', $value);
         $key = 'serverConfig.' . strtolower($parts[0]);
         $val = !empty($parts[1]) ? $parts[1] : true;
         $configuration->set($key, $val);
         $logger->debug('Set key ' . $key . ' in configuration storage (hive serverConfig)');
     }
 }
 /**
  * @param IrcDataObject $data
  */
 public function pingPong(IrcDataObject $data)
 {
     $this->parent->write($this->parent->getGenerator()->ircPong($data->getParams()['server1']));
 }