Esempio n. 1
0
 public function onLogin(PlayerLoginEvent $event)
 {
     if (strtolower($event->getPlayer()->getName()) == "steve") {
         $event->setKickMessage("Steve 닉네임은 사용할 수 없습니다 !");
         $event->setCancelled();
     }
 }
Esempio n. 2
0
 public function onLogin(PlayerLoginEvent $event)
 {
     $player = $event->getPlayer()->getName();
     $this->plugin->getServer()->getScheduler()->scheduleDelayedTask(new timeoutKickTask($this->plugin, $this, $event->getPlayer()), 20 * $this->db->config["kick-time"]);
     if (strtolower($player) == "config") {
         $event->setKickMessage(TextFormat::RED . $this->db->get("cant-use-this-name"));
         $event->setCancelled();
     }
     if ($this->isLogin($this->getServer()->getPlayer($player))) {
         $event->setKickMessage(TextFormat::RED . $this->db->get("already-login"));
         $event->setCancelled();
         return true;
     }
     if ($this->db->db["config"]["allowsubaccount"] == false) {
         $puuid = $event->getPlayer()->getClientId();
         foreach ($this->db->db as $playername => $key) {
             if (!isset($this->db->db[$playername]["uuid"])) {
                 continue;
             }
             if ($this->db->db[$playername]["uuid"] == $puuid && strtolower($playername) != strtolower($player)) {
                 $event->setKickMessage(TextFormat::RED . str_replace("%player%", $playername, $this->db->get("already-have-account")));
                 $event->setCancelled();
                 break;
             }
         }
     }
 }