sugracane & cactus fixed, fixed sigsegv too early

This commit is contained in:
GameHerobrine 2024-05-25 13:30:14 +03:00
parent b52e050f8c
commit 2ad06e202f
3 changed files with 14 additions and 12 deletions

View file

@ -194,12 +194,11 @@ class PocketMinecraftServer{
console("[WARNING] Can't keep up! Is the server overloaded?");
}
}
private static $_tmp;
/**
* @param string $reason
*/
public function close($reason = "server stop"){
usleep(2);
$this->onShutdown();
if($this->stop !== true){
if(is_int($reason)){
@ -208,13 +207,12 @@ class PocketMinecraftServer{
if(($this->api instanceof ServerAPI) === true){
if(($this->api->chat instanceof ChatAPI) === true){
$this->api->chat->send(false, "Stopping server...");
new StopMessageThread($this, "[INFO] Stopping server..."); //broadcast didnt want to send message to discord for some reason
self::$_tmp = new StopMessageThread($this, "[INFO] Stopping server..."); //broadcast didnt want to send message to discord for some reason
}
}
$this->stop = true;
$this->trigger("server.close", $reason);
$this->interface->close();
if(!defined("NO_THREADS")){
$this->asyncThread->synchronized(function ($t){
$t->stop = true;