This commit is contained in:
Dylan K. Taylor 2023-02-17 16:36:32 +00:00
parent 396d64c60b
commit 1e3b025916
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 29 additions and 8 deletions

View File

@ -35,7 +35,7 @@
"fgrosse/phpasn1": "^2.3",
"netresearch/jsonmapper": "^4.0",
"pocketmine/bedrock-data": "~1.14.0+bedrock-1.19.60",
"pocketmine/bedrock-protocol": "~19.1.0+bedrock-1.19.60",
"pocketmine/bedrock-protocol": "~19.2.0+bedrock-1.19.62",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
"pocketmine/classloader": "^0.2.0",

14
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": "2121c9df1e7a2193339f5a4fc9f70f52",
"content-hash": "56a1e8facd8fd7d56d6c7d2eb390e842",
"packages": [
{
"name": "adhocore/json-comment",
@ -276,16 +276,16 @@
},
{
"name": "pocketmine/bedrock-protocol",
"version": "19.1.0+bedrock-1.19.60",
"version": "19.2.0+bedrock-1.19.62",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "b57d8145cb765110d599dd68241f2ebe68c80933"
"reference": "a156db582d0b1a6c20c9d9cc9b1df7ef907efd0b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/b57d8145cb765110d599dd68241f2ebe68c80933",
"reference": "b57d8145cb765110d599dd68241f2ebe68c80933",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/a156db582d0b1a6c20c9d9cc9b1df7ef907efd0b",
"reference": "a156db582d0b1a6c20c9d9cc9b1df7ef907efd0b",
"shasum": ""
},
"require": {
@ -317,9 +317,9 @@
"description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP",
"support": {
"issues": "https://github.com/pmmp/BedrockProtocol/issues",
"source": "https://github.com/pmmp/BedrockProtocol/tree/19.1.0+bedrock-1.19.60"
"source": "https://github.com/pmmp/BedrockProtocol/tree/19.2.0+bedrock-1.19.62"
},
"time": "2023-02-15T12:35:51+00:00"
"time": "2023-02-17T16:32:49+00:00"
},
{
"name": "pocketmine/binaryutils",

View File

@ -84,6 +84,27 @@ class LoginPacketHandler extends PacketHandler{
}
$clientData = $this->parseClientData($packet->clientDataJwt);
//TODO: REMOVE THIS
//Mojang forgot to bump the protocol version when they changed protocol in 1.19.62. Check the game version instead.
if(preg_match('/^(\d+)\.(\d+)\.(\d+)/', $clientData->GameVersion, $matches) !== 1){
throw new PacketHandlingException("Invalid game version format, expected at least 3 digits");
}
$major = (int) $matches[1];
$minor = (int) $matches[2];
$patch = (int) $matches[3];
if($major === 1 && $minor === 19 && $patch < 62){
$this->session->sendDataPacket(PlayStatusPacket::create(PlayStatusPacket::LOGIN_FAILED_CLIENT), true);
//This pocketmine disconnect message will only be seen by the console (PlayStatusPacket causes the messages to be shown for the client)
$this->session->disconnect(
$this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_disconnect_incompatibleProtocol("$packet->protocol (< v1.19.62)")),
false
);
return true;
}
try{
$skin = SkinAdapterSingleton::get()->fromSkinData(ClientDataToSkinDataHelper::fromClientData($clientData));
}catch(\InvalidArgumentException | InvalidSkinException $e){