mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Accept 1.19.63 (same protocol, different protocol version)
This commit is contained in:
parent
efdd7a186d
commit
ae50b952f1
@ -64,18 +64,6 @@ class LoginPacketHandler extends PacketHandler{
|
|||||||
){}
|
){}
|
||||||
|
|
||||||
public function handleLogin(LoginPacket $packet) : bool{
|
public function handleLogin(LoginPacket $packet) : bool{
|
||||||
if(!$this->isCompatibleProtocol($packet->protocol)){
|
|
||||||
$this->session->sendDataPacket(PlayStatusPacket::create($packet->protocol < ProtocolInfo::CURRENT_PROTOCOL ? PlayStatusPacket::LOGIN_FAILED_CLIENT : PlayStatusPacket::LOGIN_FAILED_SERVER), 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((string) $packet->protocol)),
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$extraData = $this->fetchAuthData($packet->chainDataJwt);
|
$extraData = $this->fetchAuthData($packet->chainDataJwt);
|
||||||
|
|
||||||
if(!Player::isValidUserName($extraData->displayName)){
|
if(!Player::isValidUserName($extraData->displayName)){
|
||||||
@ -237,8 +225,4 @@ class LoginPacketHandler extends PacketHandler{
|
|||||||
$this->server->getAsyncPool()->submitTask(new ProcessLoginTask($packet->chainDataJwt->chain, $packet->clientDataJwt, $authRequired, $this->authCallback));
|
$this->server->getAsyncPool()->submitTask(new ProcessLoginTask($packet->chainDataJwt->chain, $packet->clientDataJwt, $authRequired, $this->authCallback));
|
||||||
$this->session->setHandler(null); //drop packets received during login verification
|
$this->session->setHandler(null); //drop packets received during login verification
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function isCompatibleProtocol(int $protocolVersion) : bool{
|
|
||||||
return $protocolVersion === ProtocolInfo::CURRENT_PROTOCOL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,9 @@ final class SessionStartPacketHandler extends PacketHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function isCompatibleProtocol(int $protocolVersion) : bool{
|
protected function isCompatibleProtocol(int $protocolVersion) : bool{
|
||||||
return $protocolVersion === ProtocolInfo::CURRENT_PROTOCOL;
|
//TODO: REMOVE THIS
|
||||||
|
//1.19.63 released with an unchanged protocol, but a bumped protocol version, since they forgot to do it in the
|
||||||
|
//previous release. Since they are functionally identical, we can accept both.
|
||||||
|
return $protocolVersion === ProtocolInfo::CURRENT_PROTOCOL || $protocolVersion === 568;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user