当前位置: 首页>>代码示例>>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;未经允许,请勿转载。