mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 10:31:51 +00:00
Made incompatible client disconnect messages more informative
This commit is contained in:
parent
03d3e595d6
commit
6e5759b1d1
@ -1972,13 +1972,13 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
|
|
||||||
if($packet->protocol !== ProtocolInfo::CURRENT_PROTOCOL){
|
if($packet->protocol !== ProtocolInfo::CURRENT_PROTOCOL){
|
||||||
if($packet->protocol < ProtocolInfo::CURRENT_PROTOCOL){
|
if($packet->protocol < ProtocolInfo::CURRENT_PROTOCOL){
|
||||||
$message = "disconnectionScreen.outdatedClient";
|
|
||||||
$this->sendPlayStatus(PlayStatusPacket::LOGIN_FAILED_CLIENT, true);
|
$this->sendPlayStatus(PlayStatusPacket::LOGIN_FAILED_CLIENT, true);
|
||||||
}else{
|
}else{
|
||||||
$message = "disconnectionScreen.outdatedServer";
|
|
||||||
$this->sendPlayStatus(PlayStatusPacket::LOGIN_FAILED_SERVER, true);
|
$this->sendPlayStatus(PlayStatusPacket::LOGIN_FAILED_SERVER, true);
|
||||||
}
|
}
|
||||||
$this->close("", $message, false);
|
|
||||||
|
//This pocketmine disconnect message will only be seen by the console (PlayStatusPacket causes the messages to be shown for the client)
|
||||||
|
$this->close("", $this->server->getLanguage()->translateString("pocketmine.disconnect.incompatibleProtocol", [$packet->protocol]), false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user