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{
$hitCount = $this->getUnsignedVarInt();
$missCount = $this->getUnsignedVarInt();
for($i = 0; $i < $hitCount; ++$i){
$this->hitHashes[] = $this->getLLong();
}
$hitCount = $this->getUnsignedVarInt();
for($i = 0; $i < $missCount; ++$i){
$this->missHashes[] = $this->getLLong();
}
for($i = 0; $i < $hitCount; ++$i){
$this->hitHashes[] = $this->getLLong();
}
}
protected function encodePayload() : void{
$this->putUnsignedVarInt(count($this->hitHashes));
$this->putUnsignedVarInt(count($this->missHashes));
foreach($this->hitHashes as $hash){
$this->putUnsignedVarInt(count($this->hitHashes));
foreach($this->missHashes as $hash){
$this->putLLong($hash);
}
foreach($this->missHashes as $hash){
foreach($this->hitHashes as $hash){
$this->putLLong($hash);
}
}