Player: duct tape for yet another login sequence bug in the shitty net architecture

This commit is contained in:
Dylan K. Taylor 2020-05-13 12:59:43 +01:00
parent a70fa15690
commit b044550475

View File

@ -261,6 +261,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
/** @var bool */
public $loggedIn = false;
/** @var bool */
private $seenLoginPacket = false;
/** @var bool */
private $resourcePacksDone = false;
@ -1816,9 +1818,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
public function handleLogin(LoginPacket $packet) : bool{
if($this->loggedIn){
if($this->seenLoginPacket){
return false;
}
$this->seenLoginPacket = true;
if($packet->protocol !== ProtocolInfo::CURRENT_PROTOCOL){
if($packet->protocol < ProtocolInfo::CURRENT_PROTOCOL){