Added settings.async-workers to tune the amount of AsyncTask workers

This commit is contained in:
Shoghi Cervantes
2014-06-22 12:55:08 +02:00
parent 7f795bc041
commit bf49cafeae
4 changed files with 9 additions and 8 deletions

View File

@ -1322,7 +1322,6 @@ class Server{
$this->banByIP = new BanList($this->dataPath . "banned-ips.txt");
$this->banByIP->load();
$this->scheduler = new ServerScheduler();
$this->console = new CommandReader();
$version = new VersionString($this->getPocketMineVersion());
@ -1359,6 +1358,10 @@ class Server{
"auto-save" => true,
));
ServerScheduler::$WORKERS = $this->getProperty("settings.async-workers", ServerScheduler::$WORKERS);
$this->scheduler = new ServerScheduler();
if($this->getConfigBoolean("enable-rcon", false) === true){
$this->rcon = new RCON($this->getConfigString("rcon.password", ""), $this->getConfigInt("rcon.port", $this->getPort()), ($ip = $this->getIp()) != "" ? $ip : "0.0.0.0", $this->getConfigInt("rcon.threads", 1), $this->getConfigInt("rcon.clients-per-thread", 50));
}
@ -1679,7 +1682,7 @@ class Server{
$this->logger->info("Default game type: " . self::getGamemodeString($this->getGamemode())); //TODO: string name
$this->logger->info("Done (" . round(microtime(true) - \pocketmine\START_TIME, 3) . 's)! For help, type "help" or "?"');
$this->scheduler->scheduleAsyncTask(new ExampleTask());
if(Utils::getOS() === "win"){ //Workaround less usleep() waste
$this->tickProcessorWindows();
}else{