當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PlayerKickEvent::getPlayer方法代碼示例

本文整理匯總了PHP中pocketmine\event\player\PlayerKickEvent::getPlayer方法的典型用法代碼示例。如果您正苦於以下問題:PHP PlayerKickEvent::getPlayer方法的具體用法?PHP PlayerKickEvent::getPlayer怎麽用?PHP PlayerKickEvent::getPlayer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pocketmine\event\player\PlayerKickEvent的用法示例。


在下文中一共展示了PlayerKickEvent::getPlayer方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onKick

 public function onKick(PlayerKickEvent $event)
 {
     if ($event->getPlayer() === null) {
         //If a plugin stoped this event like VIPSlots.
         $this->clearSession($event->getPlayer());
     }
 }
開發者ID:EpicArtz08999,項目名稱:xAuth,代碼行數:7,代碼來源:LoginAndRegister.php

示例2: onKick

 public function onKick(PlayerKickEvent $event)
 {
     $player = $event->getPlayer();
     if ($this->plugin->hasFlyingSession($player)) {
         $this->plugin->removeFlyingSession($player);
     }
 }
開發者ID:Pocket-GAD,項目名稱:PocketMine-MP-Plugins,代碼行數:7,代碼來源:EventListener.php

示例3: onKick

 public function onKick(PlayerKickEvent $e)
 {
     if ($e->getReason() === FULL) {
         $e->setCancelled(true);
         $this->getLogger()->info('Server is full: forcing ' . $e->getPlayer()->getName() . ' to join.');
     }
 }
開發者ID:Wolfurama,項目名稱:SupremePlugins,代碼行數:7,代碼來源:Unlimited.php

示例4: onKick

 public function onKick(PlayerKickEvent $event)
 {
     if ($event->getReason() == "disconnectionScreen.serverFull") {
         if ($event->getPlayer()->isOp()) {
             $event->setCancelled();
         }
     }
 }
開發者ID:nesgohood,項目名稱:PMMP-Plugins,代碼行數:8,代碼來源:exceptop.php

示例5: onPlayerKickEvent

 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);
     }
 }
開發者ID:100henrik100,項目名稱:Minecraft-Pocket-Edition,代碼行數:19,代碼來源:weiterleitung.php

示例6: onPlayerKickEvent

 public function onPlayerKickEvent(PlayerKickEvent $event)
 {
     if ($event->getReason() == "disconnectionScreen.serverFull") {
         if (count($this->suList) === 0) {
             $this->getSuList();
         }
         if ($this->isManager($event->getPlayer())) {
             $event->setCancelled();
         }
     }
 }
開發者ID:organization,項目名稱:MySeat,代碼行數:11,代碼來源:MySeat.php

示例7: onPlayerKick

 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();
             }
         }
     }
 }
開發者ID:LegionPE,項目名稱:LegionPE-Eta,代碼行數:12,代碼來源:SessionInterface.php

示例8: onPlayerKick

 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);
         }
     }
 }
開發者ID:mwvent,項目名稱:WattzMCPE,代碼行數:17,代碼來源:EventListener.php

示例9: onPlayerKick

 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($event->getPlayer()->hasPermission("fulljoin.join") and $event->getReason() === "disconnectionScreen.serverFull") {
         $event->setCancelled(true);
     }
 }
開發者ID:AryToNeX,項目名稱:FullJoin,代碼行數:6,代碼來源:Main.php

示例10: onKick

 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");
         }
     }
 }
開發者ID:legoboy0215,項目名稱:LegionPE-Theta-Base,代碼行數:11,代碼來源:BaseListener.php

示例11: onPlayerKick

 /**
  * @param PlayerKickEvent $event
  *
  * @priority MONITOR
  */
 public function onPlayerKick(PlayerKickEvent $event)
 {
     $this->plugin->closePlayer($event->getPlayer());
 }
開發者ID:ecoron,項目名稱:SimpleAuth,代碼行數:9,代碼來源:EventListener.php

示例12: onPlayerKicked

 public function onPlayerKicked(PlayerKickEvent $event)
 {
     if ($this->plugin->vipenforceaccess) {
         if ($event->getPlayer() instanceof Player) {
             $this->checkOutVIP($event->getPlayer());
             $this->plugin->log("[HG] VIPPlayerListener->onPlayerKicked: " . $event->getPlayer()->getName());
         }
     }
 }
開發者ID:robozeri,項目名稱:SG,代碼行數:9,代碼來源:VIPPlayerListener.php

示例13: onKick

 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;
         }
     }
 }
開發者ID:pid011,項目名稱:SimpleLogin,代碼行數:11,代碼來源:EventListener.php

示例14: onKick

 public function onKick(PlayerKickEvent $omke)
 {
     if ($omke->getPlayer()->hasPermission('opmanager.nokick')) {
         $omke->setCancelled(true);
     }
 }
開發者ID:AmiroEmad,項目名稱:Op-Manager,代碼行數:6,代碼來源:OpManager.php

示例15: onKick

 public function onKick(PlayerKickEvent $event)
 {
     $player = $event->getPlayer();
     $onlinekey = array_search($player->getName(), $this->onlinelist);
     if ($onlinekey !== false) {
         array_splice($this->onlinelist, $onlinekey, 1);
     }
     $offlinekey = array_search($player->getName(), $this->offlinelist);
     if ($offlinekey === false) {
         if (count($this->offlinelist) >= 5) {
             array_shift($this->offlinelist);
         }
         $this->offlinelist[] = $player->getName();
     }
     $player_d_name = explode("d", $player->getName());
     if (is_numeric($player->getName()) or isset($player_d_name[1]) and is_numeric($player_d_name[1])) {
         $event->setQuitMessage("");
         return;
     }
     if (isset($this->ipban_data[$player->getAddress()])) {
         $event->setQuitMessage("");
         return;
     }
     if (isset($this->ban_data[$player->getName()])) {
         $event->setQuitMessage("");
         return;
     }
     if (isset($this->subban_data[$player->getAddress()])) {
         $event->setQuitMessage("");
         return;
     }
 }
開發者ID:EmreTr1,項目名稱:rtr,代碼行數:32,代碼來源:PSYCHOPASS_Dominator.php


注:本文中的pocketmine\event\player\PlayerKickEvent::getPlayer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。