本文整理汇总了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("");
}
}
示例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() . "차단되었습니다.");
}
}
示例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() . "차단되었습니다.");
}
}
示例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();
}
}
示例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"));
}
}
示例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;
}
}
}