Skip to content

Commit

Permalink
NetworkSession: fixed timings not being stopped when handling uncompr…
Browse files Browse the repository at this point in the history
…essed packets
  • Loading branch information
dktapps committed Mar 1, 2024
1 parent b2c97cf commit 72f3c0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/network/mcpe/NetworkSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,12 @@ public function handleEncoded(string $payload) : void{
}

if($this->enableCompression){
Timings::$playerNetworkReceiveDecompress->startTiming();
$compressionType = ord($payload[0]);
$compressed = substr($payload, 1);
if($compressionType === CompressionAlgorithm::NONE){
$decompressed = $compressed;
}elseif($compressionType === $this->compressor->getNetworkId()){
Timings::$playerNetworkReceiveDecompress->startTiming();
try{
$decompressed = $this->compressor->decompress($compressed);
}catch(DecompressionException $e){
Expand Down

0 comments on commit 72f3c0b

Please sign in to comment.