Server: remove useless function

This commit is contained in:
Dylan K. Taylor 2019-03-22 19:38:33 +00:00
parent 712e077bc1
commit afbd016611

View File

@ -1311,7 +1311,37 @@ class Server{
$this->enablePlugins(PluginLoadOrder::POSTWORLD);
$this->start();
if($this->getConfigBool("enable-query", true)){
$this->queryHandler = new QueryHandler();
}
foreach($this->getIPBans()->getEntries() as $entry){
$this->network->blockAddress($entry->getName(), -1);
}
if($this->getProperty("settings.send-usage", true)){
$this->sendUsageTicker = 6000;
$this->sendUsage(SendUsageTask::TYPE_OPEN);
}
if($this->getProperty("network.upnp-forwarding", false)){
$this->logger->info("[UPnP] Trying to port forward...");
try{
UPnP::PortForward($this->getPort());
}catch(\RuntimeException $e){
$this->logger->alert("UPnP portforward failed: " . $e->getMessage());
}
}
$this->tickCounter = 0;
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.defaultGameMode", [GameMode::toTranslation($this->getGamemode())]));
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.startFinished", [round(microtime(true) - \pocketmine\START_TIME, 3)]));
$this->tickProcessor();
$this->forceShutdown();
}catch(\Throwable $e){
$this->exceptionHandler($e);
}
@ -1653,43 +1683,6 @@ class Server{
return $this->queryRegenerateTask;
}
/**
* Starts the PocketMine-MP server and starts processing ticks and packets
*/
private function start() : void{
if($this->getConfigBool("enable-query", true)){
$this->queryHandler = new QueryHandler();
}
foreach($this->getIPBans()->getEntries() as $entry){
$this->network->blockAddress($entry->getName(), -1);
}
if($this->getProperty("settings.send-usage", true)){
$this->sendUsageTicker = 6000;
$this->sendUsage(SendUsageTask::TYPE_OPEN);
}
if($this->getProperty("network.upnp-forwarding", false)){
$this->logger->info("[UPnP] Trying to port forward...");
try{
UPnP::PortForward($this->getPort());
}catch(\RuntimeException $e){
$this->logger->alert("UPnP portforward failed: " . $e->getMessage());
}
}
$this->tickCounter = 0;
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.defaultGameMode", [GameMode::toTranslation($this->getGamemode())]));
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.startFinished", [round(microtime(true) - \pocketmine\START_TIME, 3)]));
$this->tickProcessor();
$this->forceShutdown();
}
/**
* @param \Throwable $e
* @param array|null $trace