Check connection status on batch, check sleep when players leave a level

This commit is contained in:
Shoghi Cervantes
2015-05-10 14:58:07 +02:00
parent 925b0c1b07
commit 13906b32b8
4 changed files with 11 additions and 6 deletions

View File

@ -659,6 +659,10 @@ class Level implements ChunkManager, Metadatable{
}
public function checkSleep(){
if(count($this->players) === 0){
return;
}
$resetTime = true;
foreach($this->getPlayers() as $p){
if(!$p->isSleeping()){
@ -2078,7 +2082,7 @@ class Level implements ChunkManager, Metadatable{
if($entity instanceof Player){
unset($this->players[$entity->getId()]);
//$this->everyoneSleeping();
$this->checkSleep();
}else{
$entity->kill();
}