mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Added settings.async-workers to tune the amount of AsyncTask workers
This commit is contained in:
@ -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{
|
||||
|
Reference in New Issue
Block a user