DisconnectPacket: fix decoding

This commit is contained in:
Dylan K. Taylor 2018-05-02 16:56:48 +01:00
parent d80c471ae1
commit 295016cbc1

View File

@ -34,7 +34,7 @@ class DisconnectPacket extends DataPacket{
/** @var bool */
public $hideDisconnectionScreen = false;
/** @var string */
public $message;
public $message = "";
public function canBeSentBeforeLogin() : bool{
return true;
@ -42,7 +42,9 @@ class DisconnectPacket extends DataPacket{
protected function decodePayload(){
$this->hideDisconnectionScreen = $this->getBool();
$this->message = $this->getString();
if(!$this->hideDisconnectionScreen){
$this->message = $this->getString();
}
}
protected function encodePayload(){