Merge commit 'd376399b7f332384532a82eaf69b9b02dad5bd0c' into minor-next

This commit is contained in:
Dylan K. Taylor 2023-03-14 18:39:03 +00:00
commit 0022d82779
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
4 changed files with 65 additions and 58 deletions

View File

@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
image: [ubuntu-20.04]
php: [8.0.27, 8.1.14, 8.2.1]
php: [8.0.28, 8.1.16, 8.2.3]
steps:
- name: Build and prepare PHP cache
@ -32,7 +32,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.27, 8.1.14, 8.2.1]
php: [8.0.28, 8.1.16, 8.2.3]
steps:
- uses: actions/checkout@v3
@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.27, 8.1.14, 8.2.1]
php: [8.0.28, 8.1.16, 8.2.3]
steps:
- uses: actions/checkout@v3
@ -110,7 +110,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.27, 8.1.14, 8.2.1]
php: [8.0.28, 8.1.16, 8.2.3]
steps:
- uses: actions/checkout@v3
@ -151,7 +151,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.27, 8.1.14, 8.2.1]
php: [8.0.28, 8.1.16, 8.2.3]
steps:
- uses: actions/checkout@v3

View File

@ -34,9 +34,9 @@
"adhocore/json-comment": "^1.1",
"fgrosse/phpasn1": "^2.3",
"netresearch/jsonmapper": "^4.0",
"pocketmine/bedrock-block-upgrade-schema": "^1.0.0",
"pocketmine/bedrock-block-upgrade-schema": "~1.0.0",
"pocketmine/bedrock-data": "~2.0.0+bedrock-1.19.60",
"pocketmine/bedrock-item-upgrade-schema": "^1.0.0",
"pocketmine/bedrock-item-upgrade-schema": "~1.0.0",
"pocketmine/bedrock-protocol": "~19.3.0+bedrock-1.19.62",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
@ -56,7 +56,7 @@
"webmozart/path-util": "^2.3"
},
"require-dev": {
"phpstan/phpstan": "1.10.4",
"phpstan/phpstan": "1.10.6",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^9.2"

54
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2230c1697e4d7d490f5957b3a80d80a7",
"content-hash": "1911f5d75ca37c8390925a70f5e08210",
"packages": [
{
"name": "adhocore/json-comment",
@ -250,16 +250,16 @@
},
{
"name": "pocketmine/bedrock-block-upgrade-schema",
"version": "1.1.0",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockBlockUpgradeSchema.git",
"reference": "78c965a2316986ac0eaf3235d75efb187127e7a2"
"reference": "a05ce434eb7f8c11058d26833bc975fe635b23b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockBlockUpgradeSchema/zipball/78c965a2316986ac0eaf3235d75efb187127e7a2",
"reference": "78c965a2316986ac0eaf3235d75efb187127e7a2",
"url": "https://api.github.com/repos/pmmp/BedrockBlockUpgradeSchema/zipball/a05ce434eb7f8c11058d26833bc975fe635b23b4",
"reference": "a05ce434eb7f8c11058d26833bc975fe635b23b4",
"shasum": ""
},
"type": "library",
@ -270,9 +270,9 @@
"description": "Schemas describing how to upgrade saved block data in older Minecraft: Bedrock Edition world saves",
"support": {
"issues": "https://github.com/pmmp/BedrockBlockUpgradeSchema/issues",
"source": "https://github.com/pmmp/BedrockBlockUpgradeSchema/tree/1.1.0"
"source": "https://github.com/pmmp/BedrockBlockUpgradeSchema/tree/1.0.0"
},
"time": "2023-03-06T17:53:36+00:00"
"time": "2023-02-01T21:09:54+00:00"
},
{
"name": "pocketmine/bedrock-data",
@ -1658,16 +1658,16 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.11.0",
"version": "1.11.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614"
"reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614",
"reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
"reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
"shasum": ""
},
"require": {
@ -1705,7 +1705,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.11.0"
"source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
},
"funding": [
{
@ -1713,7 +1713,7 @@
"type": "tidelift"
}
],
"time": "2022-03-03T13:19:32+00:00"
"time": "2023-03-08T13:26:56+00:00"
},
{
"name": "nikic/php-parser",
@ -1884,16 +1884,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.10.4",
"version": "1.10.6",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "8d39218664b45a4a42d5be66d2b63dcf8c149982"
"reference": "50d089a3e0904b0fe7e2cf2d4fd37d427d64235a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/8d39218664b45a4a42d5be66d2b63dcf8c149982",
"reference": "8d39218664b45a4a42d5be66d2b63dcf8c149982",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/50d089a3e0904b0fe7e2cf2d4fd37d427d64235a",
"reference": "50d089a3e0904b0fe7e2cf2d4fd37d427d64235a",
"shasum": ""
},
"require": {
@ -1923,7 +1923,7 @@
],
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.10.4"
"source": "https://github.com/phpstan/phpstan/tree/1.10.6"
},
"funding": [
{
@ -1939,7 +1939,7 @@
"type": "tidelift"
}
],
"time": "2023-03-06T13:39:20+00:00"
"time": "2023-03-09T16:55:12+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
@ -2362,16 +2362,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.6.4",
"version": "9.6.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d"
"reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9125ee085b6d95e78277dc07aa1f46f9e0607b8d",
"reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5",
"reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5",
"shasum": ""
},
"require": {
@ -2404,8 +2404,8 @@
"sebastian/version": "^3.0.2"
},
"suggest": {
"ext-soap": "*",
"ext-xdebug": "*"
"ext-soap": "To be able to generate mocks based on WSDL files",
"ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
},
"bin": [
"phpunit"
@ -2444,7 +2444,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.4"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5"
},
"funding": [
{
@ -2460,7 +2460,7 @@
"type": "tidelift"
}
],
"time": "2023-02-27T13:06:37+00:00"
"time": "2023-03-09T06:34:10+00:00"
},
{
"name": "sebastian/cli-parser",

View File

@ -426,32 +426,39 @@ class NetworkSession{
throw new PacketHandlingException("Unexpected non-serverbound packet");
}
$timings = Timings::getDecodeDataPacketTimings($packet);
$timings = Timings::getReceiveDataPacketTimings($packet);
$timings->startTiming();
try{
$stream = PacketSerializer::decoder($buffer, 0, $this->packetSerializerContext);
try{
$packet->decode($stream);
}catch(PacketDecodeException $e){
throw PacketHandlingException::wrap($e);
}
if(!$stream->feof()){
$remains = substr($stream->getBuffer(), $stream->getOffset());
$this->logger->debug("Still " . strlen($remains) . " bytes unread in " . $packet->getName() . ": " . bin2hex($remains));
}
}finally{
$timings->stopTiming();
}
$timings = Timings::getHandleDataPacketTimings($packet);
$timings->startTiming();
try{
//TODO: I'm not sure DataPacketReceiveEvent should be included in the handler timings, but it needs to be
//included for now to ensure the receivePacket timings are counted the way they were before
$ev = new DataPacketReceiveEvent($this, $packet);
$ev->call();
if(!$ev->isCancelled() && ($this->handler === null || !$packet->handle($this->handler))){
$this->logger->debug("Unhandled " . $packet->getName() . ": " . base64_encode($stream->getBuffer()));
$decodeTimings = Timings::getDecodeDataPacketTimings($packet);
$decodeTimings->startTiming();
try{
$stream = PacketSerializer::decoder($buffer, 0, $this->packetSerializerContext);
try{
$packet->decode($stream);
}catch(PacketDecodeException $e){
throw PacketHandlingException::wrap($e);
}
if(!$stream->feof()){
$remains = substr($stream->getBuffer(), $stream->getOffset());
$this->logger->debug("Still " . strlen($remains) . " bytes unread in " . $packet->getName() . ": " . bin2hex($remains));
}
}finally{
$decodeTimings->stopTiming();
}
$handlerTimings = Timings::getHandleDataPacketTimings($packet);
$handlerTimings->startTiming();
try{
//TODO: I'm not sure DataPacketReceiveEvent should be included in the handler timings, but it needs to be
//included for now to ensure the receivePacket timings are counted the way they were before
$ev = new DataPacketReceiveEvent($this, $packet);
$ev->call();
if(!$ev->isCancelled() && ($this->handler === null || !$packet->handle($this->handler))){
$this->logger->debug("Unhandled " . $packet->getName() . ": " . base64_encode($stream->getBuffer()));
}
}finally{
$handlerTimings->stopTiming();
}
}finally{
$timings->stopTiming();