當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。