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


PHP PlayerJoinEvent::setCancelled方法代碼示例

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


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

示例1: onPlayerJoin

 public function onPlayerJoin(PlayerJoinEvent $event)
 {
     if (strpos($n = strtolower($event->getPlayer()->getName()), "") !== false || preg_match('#^[a-zA-Z0-9_]{3,16}$#', $n) == 0 || $n === "" || $n === "rcon" || $n === "console" || $n === "steve" || strlen($n) > 16 || strlen($n) < 3) {
         $event->setCancelled();
         $event->setJoinMessage("");
     }
 }
開發者ID:Skull3x,項目名稱:MineBlock,代碼行數:7,代碼來源:BadName.php

示例2: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     $player = $event->getPlayer();
     $ip = $player->getAddress();
     if (isset($this->vpn_data[$ip])) {
         $event->setCancelled();
         $this->getLogger()->info(TextFormat::DARK_AQUA . "[OpenVPN 차단] " . $ip . " " . $player->getName() . "차단되었습니다.");
     }
 }
開發者ID:nesgohood,項目名稱:PMMP-Plugins,代碼行數:9,代碼來源:OpenVPNLock.php

示例3: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     $player = $event->getPlayer();
     $ip = $player->getAddress();
     if (!$this->checkCountry($ip)) {
         $event->setCancelled();
         $this->getLogger()->info(TextFormat::DARK_AQUA . "[해외아이피 차단] " . $ip . " " . $player->getName() . "차단되었습니다.");
     }
 }
開發者ID:EmreTr1,項目名稱:rtr,代碼行數:9,代碼來源:CountryLock.php

示例4: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     $playerName = $event->getPlayer()->getName();
     $checking = in_array($playerName, $this->authed);
     if ($checking == 1) {
         //success TO DO!
     } else {
         $event->setCancelled();
     }
 }
開發者ID:darkspive,項目名稱:XBase,代碼行數:10,代碼來源:main.php

示例5: pLogin

 public function pLogin(PlayerJoinEvent $event)
 {
     $laeng = $event->getPlayer();
     $rLaeng = strtolower($laeng);
     $set = $this->setting;
     if ($set->get("rb-auto-stop") && $this->rbASC <= 5) {
         if (empty($this->notice[$rLaeng])) {
             if ($this->rbASC > 0) {
                 $this->popup($laeng, $this->lang->get("message-auto-stop-01"));
             } else {
                 $this->popup($laeng, str_replace("%1", $this->rbASC, $this->lang->get("message-auto-stop-02")));
             }
         }
     }
     if ($setting->get("rb-daily-offer")) {
         $end = $set->get("rb-daily-offer-endDay");
         if (strlen($end) != 6 || $end >= date("ymd")) {
             $event->setCancelled(true);
         }
         $log = new Config($this->getDataFolder() . "RandomBox.log", Config::JSON);
         if ($log->get($rLaeng) === "") {
             $log->set($rLaeng, date("ymd") - 1);
             $log->save();
         }
         if ($log->get($rLaeng) == date("ymd")) {
             return;
         }
         $this->giveRB($laeng, $set->get("rb-daily-offer-unit"));
         $log->set($rLaneg, date("ymd"));
         $log->save();
         $this->message($laeng, $this->lang->get("message-free-offer-01"));
     }
 }
開發者ID:organization,項目名稱:RandomBox,代碼行數:33,代碼來源:RandomBox.php

示例6: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     if ($event->getPlayer()->isOp()) {
         return;
     }
     if (!isset($this->playerTemp[$event->getPlayer()->getName()])) {
         $this->playerTemp[$event->getPlayer()->getName()] = $event->getPlayer();
     }
     if (!isset($this->nameCheck[$event->getPlayer()->getName()])) {
         $this->nameCheck[$event->getPlayer()->getName()] = true;
         $this->getServer()->getScheduler()->scheduleAsyncTask(new GentlemanAsyncTask($event->getPlayer()->getName(), $event->getJoinMessage(), $event->getPlayer()->getName(), $this->badQueue, $this->dictionary, "name", true));
         $event->setJoinMessage("");
     } else {
         if (!$this->nameCheck[$event->getPlayer()->getName()]) {
             $event->setCancelled();
             return;
         }
     }
 }
開發者ID:nesgohood,項目名稱:PMMP-Plugins,代碼行數:19,代碼來源:Gentleman.php


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