Improved handling of incompatible protocols

Allow plugins to hack around incompatible protocol numbers 🙈
This commit is contained in:
Dylan K. Taylor
2017-05-14 16:15:15 +01:00
parent dbb8e8ad0a
commit 576702ffa9
2 changed files with 19 additions and 15 deletions

View File

@ -54,12 +54,9 @@ class LoginPacket extends DataPacket{
public function decode(){
$this->protocol = $this->getInt();
}
if($this->protocol !== ProtocolInfo::CURRENT_PROTOCOL){
$this->buffer = null;
return; //Do not attempt to decode for non-accepted protocols
}
public function decodeAdditional(){
$this->gameEdition = $this->getByte();
$str = zlib_decode($this->getString(), 1024 * 1024 * 64);