From 96590307b69c13075cc8be153089be37b5b59234 Mon Sep 17 00:00:00 2001 From: LouisBHirst Date: Sat, 12 Sep 2015 11:43:34 -0400 Subject: [PATCH] Update for 1.6 added toString to getUniqueId as uuid is now an array --- src/SimpleAuth/EventListener.php | 2 +- src/SimpleAuth/SimpleAuth.php | 2 +- src/SimpleAuth/task/ShowMessageTask.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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){