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


PHP PlayerKickEvent::setQuitMessage方法代码示例

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


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

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

示例2: onPlayerKickEvent

 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)));
 }
开发者ID:JungHyun3459,项目名称:EmailAuth,代码行数:26,代码来源:API_CustomPacketListner.php

示例3: onKick

 public function onKick(PlayerKickEvent $event)
 {
     $player = $event->getPlayer();
     foreach ($this->list["names"] as $l) {
         if (stripos($player->getName(), $l) !== false) {
             $event->setQuitMessage("");
             break;
         }
     }
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:10,代码来源:namingCaution.php

示例4: PlayerKickEvent

 public function PlayerKickEvent(PlayerKickEvent $event)
 {
     $player = $event->getPlayer();
     if ($this->config->get("PlayerKickEvent", true)) {
         if ($player instanceof Player) {
             $event->setQuitMessage($this->prefix . "§bYou have been kicked!");
             $player->getLevel()->addSound(new PopSound($player));
         }
     }
 }
开发者ID:EmreTr1,项目名称:GoodGame,代码行数:10,代码来源:Main.php

示例5: onPlayerKick

 public function onPlayerKick(PlayerKickEvent $event)
 {
     if ($event->getReason() == "기본닉네임") {
         $event->setQuitMessage("");
     }
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:6,代码来源:SteveWarn.php

示例6: onKick

 public function onKick(PlayerKickEvent $event)
 {
     if ($event->getReason() == $this->get("badwords-nickname")) {
         $event->setQuitMessage("");
     }
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:6,代码来源:Gentleman.php

示例7: onPlayerKickEvent

 public function onPlayerKickEvent(PlayerKickEvent $event)
 {
     if ($event->getReason() == $this->plugin->get("already-connected")) {
         $event->setQuitMessage("");
     }
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:6,代码来源:API_CustomPacketListner.php


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