mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Limited player upload peak using CLI max-chunks-per-second parameter
This commit is contained in:
parent
affd67debe
commit
ee7c767c16
@ -155,7 +155,7 @@ class Player{
|
||||
|
||||
foreach($this->chunkCount as $i => $count){
|
||||
if(isset($this->recoveryQueue[$count])){
|
||||
$this->server->schedule(1, array($this, "getNextChunk"));
|
||||
$this->server->schedule(MAX_CHUNK_RATE, array($this, "getNextChunk"));
|
||||
return;
|
||||
}else{
|
||||
unset($this->chunkCount[$i]);
|
||||
@ -207,7 +207,7 @@ class Player{
|
||||
}
|
||||
}
|
||||
|
||||
$this->server->schedule(1, array($this, "getNextChunk"));
|
||||
$this->server->schedule(MAX_CHUNK_RATE, array($this, "getNextChunk"));
|
||||
}
|
||||
|
||||
public function save(){
|
||||
|
@ -37,6 +37,7 @@ define("VIEWER", 3);
|
||||
|
||||
|
||||
//Players
|
||||
define("MAX_CHUNK_RATE", 20 / arg("max-chunks-per-second", 3.5)); //Default rate ~172 kB/s
|
||||
define("PLAYER_MAX_RECOVERY_BUFFER", 1024);
|
||||
|
||||
define("PLAYER_SURVIVAL_SLOTS", 36);
|
||||
|
Loading…
x
Reference in New Issue
Block a user