getProtocolVersion(); if(!$this->isCompatibleProtocol($protocolVersion)){ $this->session->sendDataPacket(PlayStatusPacket::create($protocolVersion < 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) $protocolVersion)), false ); return true; } //TODO: we're filling in the defaults to get pre-1.19.30 behaviour back for now, but we should explore the new options in the future $this->session->sendDataPacket(NetworkSettingsPacket::create( NetworkSettingsPacket::COMPRESS_EVERYTHING, CompressionAlgorithm::ZLIB, false, 0, 0 )); ($this->onSuccess)(); return true; } protected function isCompatibleProtocol(int $protocolVersion) : bool{ return $protocolVersion === ProtocolInfo::CURRENT_PROTOCOL; } }