mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
protocol: avoid potential constructor refactoring packet decode bug
if the order of the constructor parameters were changed, it would cause these statements to be reordered, causing packet fields to be decoded in the wrong order.
This commit is contained in:
parent
3e2cfd28cc
commit
1ba32c98c7
@ -91,14 +91,13 @@ class ResourcePackInfoEntry{
|
||||
}
|
||||
|
||||
public static function read(PacketSerializer $in) : self{
|
||||
return new self(
|
||||
$uuid = $in->getString(),
|
||||
$version = $in->getString(),
|
||||
$sizeBytes = $in->getLLong(),
|
||||
$encryptionKey = $in->getString(),
|
||||
$subPackName = $in->getString(),
|
||||
$contentId = $in->getString(),
|
||||
$hasScripts = $in->getBool()
|
||||
);
|
||||
$uuid = $in->getString();
|
||||
$version = $in->getString();
|
||||
$sizeBytes = $in->getLLong();
|
||||
$encryptionKey = $in->getString();
|
||||
$subPackName = $in->getString();
|
||||
$contentId = $in->getString();
|
||||
$hasScripts = $in->getBool();
|
||||
return new self($uuid, $version, $sizeBytes, $encryptionKey, $subPackName, $contentId, $hasScripts);
|
||||
}
|
||||
}
|
||||
|
@ -59,10 +59,9 @@ class ResourcePackStackEntry{
|
||||
}
|
||||
|
||||
public static function read(PacketSerializer $in) : self{
|
||||
return new self(
|
||||
$packId = $in->getString(),
|
||||
$version = $in->getString(),
|
||||
$subPackName = $in->getString()
|
||||
);
|
||||
$packId = $in->getString();
|
||||
$version = $in->getString();
|
||||
$subPackName = $in->getString();
|
||||
return new self($packId, $version, $subPackName);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user