allow to add admin without having them in the database

This commit is contained in:
Beu 2024-08-28 18:26:55 +02:00
parent c8bbb3d7c6
commit 9c114cd13b

View File

@ -68,12 +68,10 @@ class AuthCommands implements CommandListener, UsageInformationAble {
$target = $this->maniaControl->getPlayerManager()->getPlayer($commandParts[1]); $target = $this->maniaControl->getPlayerManager()->getPlayer($commandParts[1]);
if (!$target) { if (!$target) {
$message = $this->maniaControl->getChat()->formatMessage( // It's not needed to save the player, it will be done by the grantAuthLevel function
'Player %s not found!', $target = new Player($this->maniaControl, false);
$commandParts[1] $target->login = $commandParts[1];
); $target->nickname = $commandParts[1];
$this->maniaControl->getChat()->sendError($message, $player);
return;
} }
$success = $this->maniaControl->getAuthenticationManager()->grantAuthLevel($target, $targetAuthLevel); $success = $this->maniaControl->getAuthenticationManager()->grantAuthLevel($target, $targetAuthLevel);