26 public const NETWORK_ID = ProtocolInfo::NETWORK_SETTINGS_PACKET;
28 public const COMPRESS_NOTHING = 0;
29 public const COMPRESS_EVERYTHING = 1;
31 private int $compressionThreshold;
32 private int $compressionAlgorithm;
33 private bool $enableClientThrottling;
34 private int $clientThrottleThreshold;
35 private float $clientThrottleScalar;
40 public static function create(
int $compressionThreshold,
int $compressionAlgorithm,
bool $enableClientThrottling,
int $clientThrottleThreshold,
float $clientThrottleScalar) : self{
42 $result->compressionThreshold = $compressionThreshold;
43 $result->compressionAlgorithm = $compressionAlgorithm;
44 $result->enableClientThrottling = $enableClientThrottling;
45 $result->clientThrottleThreshold = $clientThrottleThreshold;
46 $result->clientThrottleScalar = $clientThrottleScalar;
50 public function canBeSentBeforeLogin() : bool{
54 public function getCompressionThreshold() : int{
55 return $this->compressionThreshold;
63 public function isEnableClientThrottling() : bool{ return $this->enableClientThrottling; }
65 public function getClientThrottleThreshold() : int{ return $this->clientThrottleThreshold; }
67 public function getClientThrottleScalar() : float{ return $this->clientThrottleScalar; }
70 $this->compressionThreshold = $in->getLShort();
71 $this->compressionAlgorithm = $in->
getLShort();
72 $this->enableClientThrottling = $in->
getBool();
73 $this->clientThrottleThreshold = $in->
getByte();
74 $this->clientThrottleScalar = $in->
getLFloat();
78 $out->putLShort($this->compressionThreshold);
79 $out->putLShort($this->compressionAlgorithm);
80 $out->putBool($this->enableClientThrottling);
81 $out->putByte($this->clientThrottleThreshold);
82 $out->putLFloat($this->clientThrottleScalar);
86 return $handler->handleNetworkSettings($this);