} // Loop through the channels in the config and join them foreach (Config::$channels as $channel) { $server->join($channel); } // Loop-edy-loop $cntUpd = 0; while ($server->connected()) { $line = $server->getNextLine(); $line = new ReceivedLine($line); $line->parse(); if ($line->isCommand()) { $command = new Command($line); $command->execute(); } if ($line->isMappedEvent()) { $event = new Event($line); $event->execute(); } if ($line->isMappedTrigger()) { $trigger = new Trigger($line); $trigger->execute(); } $cntUpd++; if ($cntUpd > 1000) { $db->updateDatabase(); $cntUpd = 0; } } // Disconnected, Give the server 2 seconds before we attempt a reconnect sleep(2);