ClientCacheBlobStatusPacket: fixed field order

miss comes first, not hit.
This commit is contained in:
Dylan K. Taylor 2021-03-23 19:52:14 +00:00
parent fb20bb3832
commit ff61e1e018
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -66,23 +66,23 @@ class ClientCacheBlobStatusPacket extends DataPacket/* implements ServerboundPac
} }
protected function decodePayload() : void{ protected function decodePayload() : void{
$hitCount = $this->getUnsignedVarInt();
$missCount = $this->getUnsignedVarInt(); $missCount = $this->getUnsignedVarInt();
for($i = 0; $i < $hitCount; ++$i){ $hitCount = $this->getUnsignedVarInt();
$this->hitHashes[] = $this->getLLong();
}
for($i = 0; $i < $missCount; ++$i){ for($i = 0; $i < $missCount; ++$i){
$this->missHashes[] = $this->getLLong(); $this->missHashes[] = $this->getLLong();
} }
for($i = 0; $i < $hitCount; ++$i){
$this->hitHashes[] = $this->getLLong();
}
} }
protected function encodePayload() : void{ protected function encodePayload() : void{
$this->putUnsignedVarInt(count($this->hitHashes));
$this->putUnsignedVarInt(count($this->missHashes)); $this->putUnsignedVarInt(count($this->missHashes));
foreach($this->hitHashes as $hash){ $this->putUnsignedVarInt(count($this->hitHashes));
foreach($this->missHashes as $hash){
$this->putLLong($hash); $this->putLLong($hash);
} }
foreach($this->missHashes as $hash){ foreach($this->hitHashes as $hash){
$this->putLLong($hash); $this->putLLong($hash);
} }
} }