diff --git a/plugin.yml b/plugin.yml index 76a6900..bc5d0e4 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,7 +1,7 @@ name: SimpleAuth main: SimpleAuth\SimpleAuth -version: 1.7.1 -api: 1.12.0 +version: 1.7.2 +api: 2.0.0 load: STARTUP author: PocketMine Team authors: [shoghicp] diff --git a/src/SimpleAuth/EventListener.php b/src/SimpleAuth/EventListener.php index 10fe512..9d29ca0 100644 --- a/src/SimpleAuth/EventListener.php +++ b/src/SimpleAuth/EventListener.php @@ -50,7 +50,7 @@ public function __construct(SimpleAuth $plugin){ public function onPlayerJoin(PlayerJoinEvent $event){ if($this->plugin->getConfig()->get("authenticateByLastUniqueId") === true and $event->getPlayer()->hasPermission("simpleauth.lastid")){ $config = $this->plugin->getDataProvider()->getPlayer($event->getPlayer()); - if($config !== null and $config["lastip"] === $event->getPlayer()->getUniqueId()){ + if($config !== null and $config["lastip"] === $event->getPlayer()->getUniqueId()->toString()){ $this->plugin->authenticatePlayer($event->getPlayer()); return; } diff --git a/src/SimpleAuth/SimpleAuth.php b/src/SimpleAuth/SimpleAuth.php index 5824cd7..85048d1 100644 --- a/src/SimpleAuth/SimpleAuth.php +++ b/src/SimpleAuth/SimpleAuth.php @@ -101,7 +101,7 @@ public function authenticatePlayer(Player $player){ $player->removeAttachment($attachment); unset($this->needAuth[spl_object_hash($player)]); } - $this->provider->updatePlayer($player, $player->getUniqueId(), time()); + $this->provider->updatePlayer($player, $player->getUniqueId()->toString(), time()); $player->sendMessage(TextFormat::GREEN . $this->getMessage("login.success")); $this->getMessageTask()->removePlayer($player); diff --git a/src/SimpleAuth/task/ShowMessageTask.php b/src/SimpleAuth/task/ShowMessageTask.php index 7ea52a1..ca07d1f 100644 --- a/src/SimpleAuth/task/ShowMessageTask.php +++ b/src/SimpleAuth/task/ShowMessageTask.php @@ -39,11 +39,11 @@ public function getPlugin(){ } public function addPlayer(Player $player){ - $this->playerList[$player->getUniqueId()] = $player; + $this->playerList[$player->getUniqueId()->toString()] = $player; } public function removePlayer(Player $player){ - unset($this->playerList[$player->getUniqueId()]); + unset($this->playerList[$player->getUniqueId()->toString()]); } public function onRun($currentTick){