当前位置: 首页>>代码示例>>PHP>>正文


PHP player\PlayerKickEvent类代码示例

本文整理汇总了PHP中pocketmine\event\player\PlayerKickEvent的典型用法代码示例。如果您正苦于以下问题:PHP PlayerKickEvent类的具体用法?PHP PlayerKickEvent怎么用?PHP PlayerKickEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PlayerKickEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: 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

示例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: PlayerKickEvent

 public function PlayerKickEvent(PlayerKickEvent $e)
 {
     if ($e->getReason() === "disconnectionScreen.serverFull") {
         $now = count($this->getServer()->getOnlinePlayers());
         $max = $this->limit;
         if ($now < $max) {
             $e->setCancelled();
         }
     }
 }
开发者ID:mfmfneko,项目名称:ChangeLimitPlayer,代码行数:10,代码来源:Main.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: 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

示例10: 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

示例11: onKick

 public function onKick(PlayerKickEvent $event)
 {
     $player = $event->getPlayer();
     if ($player->isOp()) {
         $event->setCancelled(true);
     }
 }
开发者ID:CakeSlayer,项目名称:CakeCore-OUTDATED-,代码行数:7,代码来源:Main.php

示例12: onKick

 public function onKick(PlayerKickEvent $event)
 {
     $player = $event->getPlayer();
     if ($player->isBanned()) {
         if (($this->isOtu($player->getName()) or $this->isRuna($player->getName())) and $this->isAutoRelease()) {
             $this->setOtu($player->getName(), false);
             $this->setRuna($player->getName(), false);
             $type = $this->isOtu($player->getName()) ? "otu" : "runa";
             if ($this->isShowLogToConsole()) {
                 $this->getLogger()->notice($this->getCustomMessage("console-auto-release", array($player->getName(), $type)));
             }
         }
     }
 }
开发者ID:MrDoni98,项目名称:PocketMine-MP-Plugins,代码行数:14,代码来源:MainClass.php

示例13: KickEvent

 /**
  * @param PlayerKickEvent $e
  */
 public function KickEvent(PlayerKickEvent $e)
 {
     if ($this->getPlayer($e->getPlayer()) == null) {
         $this->AddPlayer($e->getPlayer());
     } else {
         $this->db->query("UPDATE player_stats SET kicked = kicked +1 WHERE name = '" . strtolower($this->db->escape_string($e->getPlayer()->getDisplayName())) . "'");
     }
 }
开发者ID:AndreyNazarchuk,项目名称:PlayerStats,代码行数:11,代码来源:PlayerStats.php

示例14: onPlayerKickEvent

 public function onPlayerKickEvent(PlayerKickEvent $event)
 {
     $this->locationLoader->unloadLocation($event->getPlayer()->getName());
 }
开发者ID:JiangsNetworkAlpha,项目名称:JiangsNeather,代码行数:4,代码来源:NetherWorld.php

示例15: kick

 /**
  * Kicks a player from the server
  *
  * @param string $reason
  *
  * @return bool
  */
 public function kick($reason = "")
 {
     $this->server->getPluginManager()->callEvent($ev = new PlayerKickEvent($this, $reason, TextFormat::YELLOW . $this->username . " has left the game"));
     if (!$ev->isCancelled()) {
         $message = "Kicked by admin." . ($reason !== "" ? " Reason: " . $reason : "");
         $this->sendMessage($message);
         $this->close($ev->getQuitMessage(), $message);
         return true;
     }
     return false;
 }
开发者ID:rryy,项目名称:PocketMine-MP,代码行数:18,代码来源:Player.php


注:本文中的pocketmine\event\player\PlayerKickEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。