mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-10 20:08:01 +00:00
Async thread remove on NO_THREADS
This commit is contained in:
parent
b8594ab48f
commit
549ad5eff1
@ -66,7 +66,9 @@ class PocketMinecraftServer{
|
|||||||
$this->reloadConfig();
|
$this->reloadConfig();
|
||||||
$this->stop = false;
|
$this->stop = false;
|
||||||
$this->ticks = 0;
|
$this->ticks = 0;
|
||||||
$this->asyncThread = new AsyncMultipleQueue();
|
if(!defined("NO_THREADS")){
|
||||||
|
$this->asyncThread = new AsyncMultipleQueue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function __construct($name, $gamemode = SURVIVAL, $seed = false, $port = 19132, $serverip = "0.0.0.0"){
|
function __construct($name, $gamemode = SURVIVAL, $seed = false, $port = 19132, $serverip = "0.0.0.0"){
|
||||||
@ -188,7 +190,10 @@ class PocketMinecraftServer{
|
|||||||
$this->stop = true;
|
$this->stop = true;
|
||||||
$this->trigger("server.close", $reason);
|
$this->trigger("server.close", $reason);
|
||||||
$this->interface->close();
|
$this->interface->close();
|
||||||
@$this->asyncThread->stop = true;
|
|
||||||
|
if(!defined("NO_THREADS")){
|
||||||
|
@$this->asyncThread->stop = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,6 +211,9 @@ class PocketMinecraftServer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function asyncOperation($type, array $data, callable $callable = null){
|
public function asyncOperation($type, array $data, callable $callable = null){
|
||||||
|
if(defined("NO_THREADS")){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$d = "";
|
$d = "";
|
||||||
$type = (int) $type;
|
$type = (int) $type;
|
||||||
switch($type){
|
switch($type){
|
||||||
@ -229,6 +237,9 @@ class PocketMinecraftServer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function asyncOperationChecker(){
|
public function asyncOperationChecker(){
|
||||||
|
if(defined("NO_THREADS")){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(isset($this->asyncThread->output{5})){
|
if(isset($this->asyncThread->output{5})){
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
$ID = Utils::readInt(substr($this->asyncThread->output, $offset, 4));
|
$ID = Utils::readInt(substr($this->asyncThread->output, $offset, 4));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user