From c97e1fdce02e9349684246ae1b40c59fb945617f Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 28 May 2015 15:03:45 +0200 Subject: [PATCH] Made Player::close() final, fixes several plugin issues that crashed the server --- src/pocketmine/Player.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index db5bef9a5..cfea0027a 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1519,19 +1519,19 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade return; } - if($packet->protocol1 !== ProtocolInfo::CURRENT_PROTOCOL){ + if(true or $packet->protocol1 !== ProtocolInfo::CURRENT_PROTOCOL){ if($packet->protocol1 < ProtocolInfo::CURRENT_PROTOCOL){ $message = "disconnectionScreen.outdatedClient"; $pk = new PlayStatusPacket(); $pk->status = PlayStatusPacket::LOGIN_FAILED_CLIENT; - $this->dataPacket($pk->setChannel(Network::CHANNEL_PRIORITY)); + $this->directDataPacket($pk->setChannel(Network::CHANNEL_PRIORITY)); }else{ $message = "disconnectionScreen.outdatedServer"; $pk = new PlayStatusPacket(); $pk->status = PlayStatusPacket::LOGIN_FAILED_SERVER; - $this->dataPacket($pk->setChannel(Network::CHANNEL_PRIORITY)); + $this->directDataPacket($pk->setChannel(Network::CHANNEL_PRIORITY)); } $this->close("", $message, false); @@ -1545,7 +1545,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade } if(strlen($packet->skin) < 64 * 32 * 4){ - $this->close("", "disconnectionScreen.invalidSkin", false); + $this->close("", "disconnectionScreen.invalidSkin"); return; } @@ -2740,7 +2740,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade * @param string $reason Reason showed in console * @param bool $notify */ - public function close($message = "", $reason = "generic reason", $notify = true){ + public final function close($message = "", $reason = "generic reason", $notify = true){ if($this->connected and !$this->closed){ if($notify and strlen((string) $reason) > 0){