Provide a way for plugins such as Specter to bypass chain verification

This commit is contained in:
Dylan K. Taylor 2017-11-18 12:44:18 +00:00
parent e709e3c653
commit 6facd8b50f
2 changed files with 13 additions and 1 deletions

View File

@ -1837,7 +1837,11 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
return true;
}
$this->server->getScheduler()->scheduleAsyncTask(new VerifyLoginTask($this, $packet));
if(!$packet->skipVerification){
$this->server->getScheduler()->scheduleAsyncTask(new VerifyLoginTask($this, $packet));
}else{
$this->onVerifyCompleted($packet, true, true);
}
return true;
}

View File

@ -60,6 +60,14 @@ class LoginPacket extends DataPacket{
/** @var array decoded payload of the clientData JWT */
public $clientData = [];
/**
* This field may be used by plugins to bypass keychain verification. It should only be used for plugins such as
* Specter where passing verification would take too much time and not be worth it.
*
* @var bool
*/
public $skipVerification = false;
public function canBeSentBeforeLogin() : bool{
return true;
}