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

View File

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