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


PHP Player::kick方法代码示例

本文整理汇总了PHP中pocketmine\Player::kick方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::kick方法的具体用法?PHP Player::kick怎么用?PHP Player::kick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\Player的用法示例。


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

示例1: onRun

 /**
  * @param int $currentTick
  */
 public function onRun($currentTick)
 {
     $this->getPlugin()->getServer()->getLogger()->debug(TextFormat::YELLOW . "Running EssentialsPE's AFKKickTask");
     if ($this->getPlugin()->isAFK($this->player) && !$this->player->hasPermission("essentials.afk.kickexempt") && time() - $this->getPlugin()->getLastPlayerMovement($this->player) >= $this->getPlugin()->getConfig()->getNested("afk.auto-set")) {
         $this->player->kick("You have been kicked for idling more than " . (($time = floor($this->getPlugin()->getConfig()->getNested("afk.auto-kick"))) / 60 >= 1 ? $time / 60 . " minutes" : $time . " seconds"), false);
     }
 }
开发者ID:JungHyun3459,项目名称:EssentialsPE,代码行数:10,代码来源:AFKKickTask.php

示例2: checkMessage

 /**
  * checks message for any flooding
  *
  * @param Player $player
  */
 public function checkMessage(Player $player)
 {
     if ($this->isSpamming() && !$player->isOp()) {
         if (!isset($this->spams[$player->getName()]) && !$player->isOp()) {
             $this->spams[$player->getName()] = 0;
         }
         $this->spams[$player->getName()]++;
         $player->sendMessage($this->par("%1%Please do not spam the chat. Warnings: " . $this->spams[$player->getName()] . ".%nl%%2%* If your warnings are 3 you will be kicked.", color::RED, color::AQUA));
         $this->ev->setCancelled();
         if ($this->spams[$player->getName()] === 3) {
             $this->getServer()->broadcastMessage($this->par("%1%[Server] kicked %2%. Reason: spamming the chat.", color::RED, $player->getName()));
             $player->kick($this->par("%1%%nl%Spamming the chat.", color::RED));
             unset($this->spams[$player->getName()]);
         }
     } else {
         $this->time = time();
     }
 }
开发者ID:xBeastModeXD,项目名称:AntiSpammer-1,代码行数:23,代码来源:AntiSpammer.php

示例3: alreadyLogined

 public function alreadyLogined(Player $player)
 {
     $player->kick($this->plugin->get("already-connected"));
 }
开发者ID:JungHyun3459,项目名称:EmailAuth,代码行数:4,代码来源:API_CustomPacketListner.php

示例4: Kick

 public function Kick(Player $player)
 {
     $player->kick("You're not allowed to use this username.");
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:4,代码来源:namingCaution.php

示例5: KickExecute

 public function KickExecute(Player $target)
 {
     if (!$target->closed) {
         $target->kick();
     }
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:6,代码来源:PSYCHOPASS_Dominator.php

示例6: redirect_run

 public function redirect_run(Player $player, $warpname)
 {
     $warpname = strtolower($warpname);
     // chucked in to enable me to deal with an emergencey
     if ($this->cfg["autokickall"]) {
         $player->kick($this->cfg["autokickall_msg"]);
         return;
     }
     // get server details from config
     $targetwarp = $this->getWarpRealName($warpname);
     if ($targetwarp === false) {
         $player->sendMessage(TextFormat::RED . "[Error] Warp doesn't exist");
         return false;
     }
     if ($this->cfg["warps"]["this_server_name"] == $targetwarp) {
         $player->sendMessage(TextFormat::RED . "[Error] You are already in this world");
         return false;
     }
     // Get connection details
     $hostname = $this->cfg["warps"][$targetwarp]["hostname"];
     $port = $this->cfg["warps"][$targetwarp]["port"];
     // Update db
     $this->db->db_setUserLocation($player, $targetwarp);
     // skip past the actual transfer if disabled - just go to the part where
     // player is disconnected
     if ($this->cfg["warps"]["prevent-actual-transfer"]) {
         $player->kick("To go to this world please connect to {$hostname} {$port}");
         return;
     }
     // TODO ping/query target to check online
     $ft_plugin = $this->getServer()->getPluginManager()->getPlugin("FastTransfer");
     if ($ft_plugin === null) {
         Server::getInstance()->getLogger()->critical(Main::PREFIX . "Could not find FastTransfer plugin");
     }
     $ft_plugin->transferPlayer($player, $hostname, $port, "Connecting you to " . $warpname);
     $this->forcePlayerDisconnect($player);
 }
开发者ID:mwvent,项目名称:WattzMCPE,代码行数:37,代码来源:Main.php

示例7: Kick

 public function Kick(Player $player)
 {
     $player->kick("게임모드 변경");
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:4,代码来源:GameModeKick.php

示例8: onRun

 public function onRun($currentTick)
 {
     if (!$this->listener->isLogin($this->player)) {
         $this->player->kick($this->db->get("timeout"));
     }
 }
开发者ID:organization,项目名称:SimpleLogin,代码行数:6,代码来源:timeoutKickTask.php


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