mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Avoid creating batch buffers just to determine whether a batch should be globally compressed
Instead, sum together the lengths of encoded packet buffers and use that to decide whether to build the buffer or not.
This commit is contained in:
@ -891,6 +891,9 @@ class Server{
|
||||
if($this->configGroup->getPropertyInt("network.batch-threshold", 256) >= 0){
|
||||
$netCompressionThreshold = $this->configGroup->getPropertyInt("network.batch-threshold", 256);
|
||||
}
|
||||
if($netCompressionThreshold < 0){
|
||||
$netCompressionThreshold = null;
|
||||
}
|
||||
|
||||
$netCompressionLevel = $this->configGroup->getPropertyInt("network.compression-level", 6);
|
||||
if($netCompressionLevel < 1 || $netCompressionLevel > 9){
|
||||
|
Reference in New Issue
Block a user