Fixed server not stopping after a fatal error

This commit is contained in:
Shoghi Cervantes 2014-11-01 03:07:47 +01:00
parent 4569a73f3d
commit d5012f6fcf
2 changed files with 8 additions and 10 deletions

View File

@ -2004,9 +2004,6 @@ class Server{
global $lastExceptionError, $lastError;
$lastExceptionError = $lastError;
$this->crashDump();
$this->forceShutdown();
kill(getmypid());
exit(1);
}
public function crashDump(){
@ -2051,6 +2048,9 @@ class Server{
//$this->checkMemory();
//$dump .= "Memory Usage Tracking: \r\n" . chunk_split(base64_encode(gzdeflate(implode(";", $this->memoryStats), 9))) . "\r\n";
$this->forceShutdown();
kill(getmypid());
exit(1);
}
public function __debugInfo(){

View File

@ -1724,7 +1724,7 @@ class Level implements ChunkManager, Metadatable{
}
foreach($this->chunkSendQueue[$index] as $player){
/** @var Player $player */
if(isset($player->usedChunks[$index])){
if($player->isConnected() and isset($player->usedChunks[$index])){
$player->sendChunk($x, $z, $payload);
}
}
@ -1929,15 +1929,13 @@ class Level implements ChunkManager, Metadatable{
$spawn = $this->getSpawnLocation();
}
if($spawn instanceof Vector3){
$x = Math::floorFloat($spawn->x);
$y = Math::floorFloat($spawn->y);
$z = Math::floorFloat($spawn->z);
$v = new Vector3($x, $y, $z);
for(; $v->y > 0; --$v->y){
$b = $this->getBlock($v->getSide(0));
$v = $spawn->floor();
for(; $v->y > 0; $v->y -= 2){
$b = $this->getBlock($v);
if($b === null){
return $spawn;
}elseif(!($b instanceof Air)){
$v->y += 1;
break;
}
}