/**
* Starts the PocketMine-MP server and starts processing ticks and packets
*/
public function start()
{
if ($this->getConfigBoolean("enable-query", true) === true) {
$this->queryHandler = new QueryHandler();
}
foreach ($this->getIPBans()->getEntries() as $entry) {
$this->network->blockAddress($entry->getName(), -1);
}
if ($this->getProperty("settings.send-usage", true) !== false) {
$this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask([$this, "sendUsage"]), 6000, 6000);
$this->sendUsage();
}
if ($this->getProperty("settings.upnp-forwarding", false) == true) {
$this->logger->info("[UPnP] Trying to port forward...");
UPnP::PortForward($this->getPort());
}
$this->tickCounter = 0;
if (function_exists("pcntl_signal")) {
pcntl_signal(SIGTERM, [$this, "handleSignal"]);
pcntl_signal(SIGINT, [$this, "handleSignal"]);
pcntl_signal(SIGHUP, [$this, "handleSignal"]);
$this->getScheduler()->scheduleRepeatingTask(new CallbackTask("pcntl_signal_dispatch"), 5);
}
$this->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this, "checkTicks"]), 20 * 5);
$this->logger->info("Default game type: " . self::getGamemodeString($this->getGamemode()));
Effect::init();
$this->logger->info("Done (" . round(microtime(true) - \pocketmine\START_TIME, 3) . 's)! For help, type "help" or "?"');
$this->tickProcessor();
$this->forceShutdown();
\gc_collect_cycles();
}