getReason() 공개 메소드

public getReason ( )
예제 #1
0
 public function onKick(PlayerKickEvent $e)
 {
     if ($e->getReason() === FULL) {
         $e->setCancelled(true);
         $this->getLogger()->info('Server is full: forcing ' . $e->getPlayer()->getName() . ' to join.');
     }
 }
예제 #2
0
 public function onKick(PlayerKickEvent $event)
 {
     if ($event->getReason() == "disconnectionScreen.serverFull") {
         if ($event->getPlayer()->isOp()) {
             $event->setCancelled();
         }
     }
 }
예제 #3
0
 public function PlayerKickEvent(PlayerKickEvent $e)
 {
     if ($e->getReason() === "disconnectionScreen.serverFull") {
         $now = count($this->getServer()->getOnlinePlayers());
         $max = $this->limit;
         if ($now < $max) {
             $e->setCancelled();
         }
     }
 }
예제 #4
0
 public function onPlayerKickEvent(PlayerKickEvent $event)
 {
     if ($event->getReason() == "disconnectionScreen.serverFull") {
         if (count($this->suList) === 0) {
             $this->getSuList();
         }
         if ($this->isManager($event->getPlayer())) {
             $event->setCancelled();
         }
     }
 }
예제 #5
0
 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($event->getReason() === "server full") {
         $rank = $this->getMain()->getMySQLi()->query("SELECT rank FROM players WHERE primaryname=%s;", MysqlConnection::ASSOC, strtolower($event->getPlayer()->getName()));
         if (is_array($rank)) {
             $rank = $rank["rank"];
             if (($rank & (Settings::RANK_SECTOR_IMPORTANCE | Settings::RANK_SECTOR_PERMISSION) & ~Settings::RANK_IMPORTANCE_TESTER) > 0) {
                 $event->setCancelled();
             }
         }
     }
 }
예제 #6
0
 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($event->getReason() === "disconnectionScreen.serverFull") {
         $timeRanksPlugin = $this->plugin->getServer()->getPluginManager()->getPlugin("TimeRanks");
         if (is_null($timeRanksPlugin)) {
             return;
         }
         $playerName = strtolower($event->getPlayer()->getName());
         $playTime = $timeRanksPlugin->getMinutes($playerName);
         if ($playTime > 60) {
             $msg = "Allowed {$playerName} to join when full ";
             $msg .= "because they have {$playTime} mins of playtime.";
             $this->plugin->getServer()->getLogger()->info($msg);
             $event->setCancelled(true);
         }
     }
 }
 public function onPlayerKickEvent(PlayerKickEvent $event)
 {
     $name = $event->getPlayer()->getName();
     $p = $event->getPlayer();
     $reason = $event->getReason();
     if ($reason == "disconnectionScreen.serverFull") {
         $pl = $event->getPlayer();
         $addr1 = $this->config->get("IP");
         $addr2 = $this->config->get("Port");
         $ft = $this->getServer()->getPluginManager()->getPlugin("FastTransfer");
         if (!$ft) {
             $this->getLogger()->info("FAST TRANSFER NOT INSTALLED");
             return;
         }
         $this->getLogger()->info(MT::YELLOW . "{$name} transfer to {$addr1} {$addr2}");
         $ft->transferPlayer($pl, $addr1, $addr2);
         $event->setCancelled(true);
     }
 }
예제 #8
0
 public function onKick(PlayerKickEvent $event)
 {
     $player = $event->getPlayer();
     if ($this->isLogin($player)) {
         if ($event->getReason() == "logged in from another location") {
             $this->kickev[$player->getName()] = true;
             $event->setCancelled();
             return;
         }
     }
 }
예제 #9
0
 public function preventFlyKick(PlayerKickEvent $event)
 {
     if (isset($this->elevateQueue[$event->getPlayer()->getName()])) {
         if ($event->getReason() == "Flying is not enabled on this server") {
             $this->log("preventFlyKick run");
             $event->setCancelled();
         }
     }
 }
예제 #10
0
파일: Main.php 프로젝트: AryToNeX/FullJoin
 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($event->getPlayer()->hasPermission("fulljoin.join") and $event->getReason() === "disconnectionScreen.serverFull") {
         $event->setCancelled(true);
     }
 }
 public function onPlayerKickEvent(PlayerKickEvent $event)
 {
     if ($event->getReason() == $this->plugin->get("already-connected")) {
         $event->setQuitMessage("");
     }
     if (isset($this->standbyAuth[strtolower($event->getPlayer()->getName())])) {
         unset($this->standbyAuth[strtolower($event->getPlayer()->getName())]);
         return;
     }
     if (isset($this->needAuth[strtolower($event->getPlayer()->getName())])) {
         unset($this->needAuth[strtolower($event->getPlayer()->getName())]);
         return;
     }
     if ($this->plugin->getConfig()->get("servermode", null) != "slave") {
         return;
     }
     $event->getPlayer()->save();
     // itemSyncro
     // slave->master = [passcode, itemSyncro, username, itemData]
     $data = [$this->plugin->getConfig()->get("passcode"), "itemSyncro", $event->getPlayer()->getName(), $this->getPlayerDataFile($event->getPlayer()->getName())];
     CPAPI::sendPacket(new DataPacket($this->plugin->getConfig()->get("masterip"), $this->plugin->getConfig()->get("masterport"), json_encode($data)));
     // logoutRequest
     // slave->master = [passcode, logoutRequest, username, IP, isUserGenerate]
     $data = [$this->plugin->getConfig()->get("passcode"), "logoutRequest", $event->getPlayer()->getName(), $event->getPlayer()->getAddress(), false];
     CPAPI::sendPacket(new DataPacket($this->plugin->getConfig()->get("masterip"), $this->plugin->getConfig()->get("masterport"), json_encode($data)));
 }
예제 #12
0
 public function onPlayerKick(PlayerKickEvent $event)
 {
     $Player = $event->getPlayer();
     $Level = $Player->getLevel();
     if (!$this->plugin->game || $this->plugin->game->level_name != $Level->getFolderName()) {
         return;
     }
     if (strpos($event->getReason(), "flying") !== false) {
         $event->setCancelled(true);
         return;
     }
     $Player->setNameTag($Player->getName());
     if ($Team = $this->plugin->game->getTeamByPlayer($Player)) {
         array_splice($Team->Players, array_search($Player, $Team->Players), 1);
         $this->plugin->game->updateTeams();
     }
     $Player->removeAllEffects();
     $Player->setDataFlag(Entity::DATA_FLAGS, Entity::DATA_FLAG_INVISIBLE, false);
 }
 public function onKick(PlayerKickEvent $event)
 {
     if ($event->getReason() === "disconnectionScreen.serverFull") {
         $event->setCancelled();
         $this->main->getAltServer($ip, $port);
         if ($ip !== "0.0.0.0") {
             $this->getMain()->getLogger()->notice("Transferring " . $event->getPlayer()->getName() . " to {$ip}:{$port} because server strict limit is reached");
             $this->main->transfer($event->getPlayer(), $ip, $port, "This server is full");
         }
     }
 }
예제 #14
0
 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($event->getReason() === "disconnectionScreen.serverFull") {
         $event->setCancelled(true);
     }
 }
예제 #15
0
 public function onKick(PlayerKickEvent $event)
 {
     if ($event->getReason() === "Flying is not enabled on this server") {
         if (($user = $this->main->getUserByPlayer($event->getPlayer())) === null or !$user->isPlaying()) {
             $event->setCancelled();
         }
     }
 }
예제 #16
0
파일: Trampoline.php 프로젝트: EmreTr1/rtr
 public function preventFlyKick(PlayerKickEvent $event)
 {
     if (isset($this->fallen[$event->getPlayer()->getName()])) {
         if ($event->getReason() == "Flying is not enabled on this server") {
             $event->setCancelled();
         }
     }
 }
예제 #17
0
 public function onKick(PlayerKickEvent $e)
 {
     if ($e->isCancelled()) {
         return;
     }
     if (preg_match('/flying/i', $e->getReason())) {
         $state = $this->getState($e->getPlayer(), null);
         if ($state) {
             $e->setCancelled();
         }
     }
 }
 public function onPlayerKickEvent(PlayerKickEvent $event)
 {
     if ($event->getReason() == $this->plugin->get("already-connected")) {
         $event->setQuitMessage("");
     }
 }
예제 #19
0
파일: Fly.php 프로젝트: stoastye85/Plugins
 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($this->fly["Fly"] && $event->getReason() == "Flying is not enabled on this server") {
         $event->setCancelled();
     }
 }
예제 #20
0
파일: SteveWarn.php 프로젝트: EmreTr1/rtr
 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($event->getReason() == "기본닉네임") {
         $event->setQuitMessage("");
     }
 }
예제 #21
0
 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($this->vips->exists(strtolower($event->getPlayer()->getName())) and $event->getReason() === "disconnectionScreen.serverFull") {
         $event->setCancelled(true);
     }
 }
예제 #22
0
 public function onKick(PlayerKickEvent $event)
 {
     if ($event->getReason() == $this->get("badwords-nickname")) {
         $event->setQuitMessage("");
     }
 }