mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
PlayerPreLoginEvent: implement Cancellable again
This commit is contained in:
parent
2226efd7a0
commit
923ea46476
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\player;
|
||||
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\Event;
|
||||
use pocketmine\player\PlayerInfo;
|
||||
use function array_keys;
|
||||
@ -38,7 +39,7 @@ use function count;
|
||||
* WARNING: Any information about the player CANNOT be trusted at this stage, because they are not authenticated and
|
||||
* could be a hacker posing as another player.
|
||||
*/
|
||||
class PlayerPreLoginEvent extends Event{
|
||||
class PlayerPreLoginEvent extends Event implements Cancellable{
|
||||
public const KICK_REASON_PLUGIN = 0;
|
||||
public const KICK_REASON_SERVER_FULL = 1;
|
||||
public const KICK_REASON_SERVER_WHITELISTED = 2;
|
||||
@ -167,4 +168,8 @@ class PlayerPreLoginEvent extends Event{
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public function isCancelled() : bool{
|
||||
return !$this->isAllowed();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user