Beispiel #1
0
 private function main()
 {
     while (1) {
         $data = trim(str_replace([chr(9), chr(10), chr(11), chr(13), chr(0)], '', $this->connection->getData()));
         $this->checkStatus($data);
         if (!empty($this->buffer)) {
             $this->flushBuffer();
         }
         if (empty($data) || !$this->chat->setIncommingData((string) $data)) {
             if ($this->channelList) {
                 Module::executeListener();
             }
             sleep(1);
             continue;
         }
         foreach ($this->module as $module) {
             $module->execute();
             if (strpos($this->getMessage(), Config::$commandPrefix) === 0) {
                 $module->executeCommand();
             }
         }
     }
 }