do not send chunk updates on chunk generation

This commit is contained in:
Shoghi Cervantes 2014-02-13 01:53:30 +01:00
parent bd73cced6e
commit 4523b15991
2 changed files with 20 additions and 10 deletions

View File

@ -186,12 +186,19 @@ class PMFLevel extends PMF{
if(!file_exists(dirname($path))){
@mkdir(dirname($path), 0755);
}
$this->isGenerating = true;
$this->initCleanChunk($X, $Z);
$ret = $this->level->generateChunk($X, $Z);
$ret = $ret and $this->level->populateChunk($X, $Z);
$this->saveChunk($X, $Z);
$this->isGenerating = false;
if($this->isGenerating === false){
$this->isGenerating = true;
$this->initCleanChunk($X, $Z);
$ret = $this->level->generateChunk($X, $Z);
$ret = $ret and $this->level->populateChunk($X, $Z);
$this->saveChunk($X, $Z);
$this->isGenerating = false;
}else{
$this->initCleanChunk($X, $Z);
$ret = $this->level->generateChunk($X, $Z);
$ret = $ret and $this->level->populateChunk($X, $Z);
$this->saveChunk($X, $Z);
}
return $ret;
}
@ -213,9 +220,13 @@ class PMFLevel extends PMF{
}
if($this->isGenerating === false and !$this->isPopulated($X, $Z)){
$this->isGenerating = true;
$ret = $this->level->populateChunk($X, $Z);
$this->isGenerating = false;
if($this->isGenerating === false){
$this->isGenerating = true;
$this->level->populateChunk($X, $Z);
$this->isGenerating = false;
}else{
$this->level->populateChunk($X, $Z);
}
}
$chunk = @gzopen($path, "rb");

View File

@ -107,7 +107,6 @@ class Level{
if($this->level->isGenerating === false and count($this->changedCount) > 0){
arsort($this->changedCount);
$resendChunks = array();
foreach($this->changedCount as $index => $count){
if($count < 582){//Optimal value, calculated using the relation between minichunks and single packets
break;