public function __construct(HereAuth $main, Player $player, AccountInfo $info)
{
$this->main = $main;
$this->player = $player;
$this->accountInfo = $info;
if ($info->passwordHash === null) {
if (!$main->getConfig()->getNested("ForceRegister.Enabled", true)) {
// no registration involved
$this->onAuth();
$reminder = $main->getConfig()->getNested("ForceRegister.Reminder", "");
if (strlen($reminder) > 0) {
$player->sendMessage($reminder);
}
return;
}
$this->startRegistration();
return;
}
if ($info->opts->autoSecret and $player->getClientSecret() === $info->lastSecret) {
$this->onAuth();
return;
}
if ($info->opts->autoIp and $player->getAddress() === $info->lastIp) {
$this->onAuth();
return;
}
if ($info->opts->autoUuid and $player->getUniqueId()->toBinary() === $info->lastUuid) {
$this->onAuth();
return;
}
$this->state = self::STATE_PENDING_LOGIN;
$this->player->sendMessage($main->getConfig()->getNested("Messages.Login.Query", "Please login"));
}