Ejemplo n.º 1
0
 /**
  * @param PlayerLoginEvent $event
  */
 public function onLoginEvent(PlayerLoginEvent $event)
 {
     $username = strtolower($event->getPlayer()->getName());
     if (!$this->provider->accountExists($username)) {
         $this->createAccount($username);
     }
     if (!isset($this->playerLang[$username])) {
         $this->setLang($this->config->get("default-lang"), $username);
     }
 }
Ejemplo n.º 2
0
 public function onJoin(PlayerJoinEvent $event)
 {
     $player = $event->getPlayer();
     if (!isset($this->playerLang[strtolower($player->getName())])) {
         $this->playerLang[strtolower($player->getName())] = $this->getConfig()->get("default-lang");
     }
     if (!$this->provider->accountExists($player)) {
         $this->getLogger()->debug("Account of '" . $player->getName() . "' is not found. Creating account...");
         $this->createAccount($player, false, true);
     }
 }