mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49:53 +00:00
Fixed Chunk max upload
This commit is contained in:
parent
5e231c846c
commit
68f0a91d56
@ -153,12 +153,12 @@ class Player{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->chunkCount as $i => $count){
|
foreach($this->chunkCount as $count => $t){
|
||||||
if(isset($this->recoveryQueue[$count])){
|
if(isset($this->recoveryQueue[$count]) or isset($this->resendQueue[$count])){
|
||||||
$this->server->schedule(MAX_CHUNK_RATE, array($this, "getNextChunk"));
|
$this->server->schedule(MAX_CHUNK_RATE, array($this, "getNextChunk"));
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
unset($this->chunkCount[$i]);
|
unset($this->chunkCount[$count]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,11 +186,15 @@ class Player{
|
|||||||
$Yndex |= 1 << $iY;
|
$Yndex |= 1 << $iY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->chunkCount = $this->dataPacket(MC_CHUNK_DATA, array(
|
$cnt = $this->dataPacket(MC_CHUNK_DATA, array(
|
||||||
"x" => $X,
|
"x" => $X,
|
||||||
"z" => $Z,
|
"z" => $Z,
|
||||||
"data" => $this->level->getOrderedChunk($X, $Z, $Yndex),
|
"data" => $this->level->getOrderedChunk($X, $Z, $Yndex),
|
||||||
));
|
));
|
||||||
|
$this->chunkCount = array();
|
||||||
|
foreach($cnt as $i => $count){
|
||||||
|
$this->chunkCount[$count] = true;
|
||||||
|
}
|
||||||
/*$this->chunkCount = $this->dataPacket(MC_CHUNK_DATA, array(
|
/*$this->chunkCount = $this->dataPacket(MC_CHUNK_DATA, array(
|
||||||
"x" => $X,
|
"x" => $X,
|
||||||
"z" => $Z,
|
"z" => $Z,
|
||||||
@ -904,7 +908,11 @@ class Player{
|
|||||||
unset($this->resendQueue[$count]);
|
unset($this->resendQueue[$count]);
|
||||||
$this->packetStats[1]++;
|
$this->packetStats[1]++;
|
||||||
$this->lag[] = microtime(true) - $data["sendtime"];
|
$this->lag[] = microtime(true) - $data["sendtime"];
|
||||||
$this->directDataPacket($data["id"], $data, $data["pid"]);
|
$cnt = $this->directDataPacket($data["id"], $data, $data["pid"]);
|
||||||
|
if(isset($this->chunkCount[$count])){
|
||||||
|
unset($this->chunkCount[$count]);
|
||||||
|
$this->chunkCount[$cnt] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user