Skip to content

Commit

Permalink
Made incompatible client disconnect messages more informative
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Sep 25, 2017
1 parent 03d3e59 commit 6e5759b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pocketmine/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -1972,13 +1972,13 @@ public function handleLogin(LoginPacket $packet) : bool{

if($packet->protocol !== ProtocolInfo::CURRENT_PROTOCOL){
if($packet->protocol < ProtocolInfo::CURRENT_PROTOCOL){
$message = "disconnectionScreen.outdatedClient";
$this->sendPlayStatus(PlayStatusPacket::LOGIN_FAILED_CLIENT, true);
}else{
$message = "disconnectionScreen.outdatedServer";
$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;
}
Expand Down

0 comments on commit 6e5759b

Please sign in to comment.