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


PHP PlayerQuitEvent::setQuitMessage方法代码示例

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


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

示例1: onQuit

 public function onQuit(PlayerQuitEvent $event)
 {
     // Epic Fail
     $player = $event->getPlayer();
     if ($player->isOp()) {
         $event->setQuitMessage("|ScMCPE|" . $player->getDisplayName() . "[Ranked] est hors ligne!");
     } else {
         $event->setQuitMessage("|ScMCPE|" . $player->getDisplayName() . "est hors ligne!.");
     }
 }
开发者ID:AndreyNazarchuk,项目名称:Collection-Plugins-PocketMine-Prax,代码行数:10,代码来源:Main.php

示例2: QuitEvent

 public function QuitEvent(PlayerQuitEvent $ev)
 {
     $player = $ev->getPlayer();
     if ($player->isop()) {
         $ev->setQuitMessage("GM [" . $player->getName() . "] 님께서 SAO 데이테베이솔부터 로그아웃 하셨습니다 ");
     }
 }
开发者ID:junknight,项目名称:SAOjoin,代码行数:7,代码来源:SAOjoin.php

示例3: onQuit

 public function onQuit(PlayerQuitEvent $event)
 {
     chdir($this->getDataFolder());
     $data = file_get_contents("config.yml");
     $file_array = json_decode($data, true);
     $quit_message = $file_array["quit-message:"];
     $event->setQuitMessage(str_replace("{player}", $event->getPlayer()->getDisplayName(), $quit_message));
 }
开发者ID:applqpak,项目名称:JoinLeaveMessages,代码行数:8,代码来源:Main.php

示例4: onQuit

 public function onQuit(PlayerQuitEvent $event)
 {
     $player = $event->getPlayer();
     $player_name = $player->getName();
     $quit = "quit-message: ";
     $quit_message = substr(strstr(file_get_contents("CustomMessages/messages.txt"), $quit), strlen($quit));
     $event->setQuitMessage($quit_message);
 }
开发者ID:NameNoOne100,项目名称:CustomMessages,代码行数:8,代码来源:Main.php

示例5: onPlayerQuitEvent

 public function onPlayerQuitEvent(PlayerQuitEvent $event)
 {
     $message = $event->getQuitMessage();
     if ($message instanceof TranslationContainer) {
         $message = $this->getServer()->getLanguage()->translateString($message->getText(), $message->getParameters());
     }
     AnnounceSystem::getInstance()->pushBroadCastPopup($message, 2);
     $event->setQuitMessage(null);
 }
开发者ID:organization,项目名称:AnnounceClear,代码行数:9,代码来源:AnnounceClear.php

示例6: onQuit

 public function onQuit(PlayerQuitEvent $event)
 {
     $this->plugin->players = $this->plugin->players - 1;
     $event->setQuitMessage("[HG] " . $event->getPlayer()->getName() . " left the match!");
     if ($this->plugin->players <= 1) {
         $this->plugin->getServer()->broadcastMessage("[HG] Game ended!");
         $this->plugin->getServer()->shutdown();
     }
 }
开发者ID:Skull3x,项目名称:WonderCore,代码行数:9,代码来源:EventHandler.php

示例7: onPlayerQuit

 public function onPlayerQuit(PlayerQuitEvent $event)
 {
     $this->config_message = ccMain::getInstance()->getMCfg();
     $message = $this->config_message->get("Enable-CustomLeave-Message");
     $player = $event->getPlayer();
     $event->setQuitMessage(null);
     if ($this->factionspro == true && $this->factionspro->isInFaction(strtolower($player->getName()))) {
         $getUserFaction = $this->factionspro->getPlayerFaction(strtolower($player->getName()));
         $message = str_replace("@Faction", $getUserFaction, $message);
     } else {
         $this->config = ccMain::getInstance()->getCfg();
         $nofac = $this->config->get("if-player-has-no-faction");
         $message = str_replace("@Faction", $nofac, $message);
     }
     if ($this->massive) {
         $message = str_replace("{Money}", MassiveEconomyAPI::getInstance()->getMoney($player->getName()), $message);
     } else {
         $message = str_replace("{Money}", "ERROR", $message);
     }
     if (!$this->pureperms) {
         $message = str_replace("{PurePerms}", "NoGroup", $message);
     }
     if ($this->pureperms) {
         $isMultiWorldEnabled = $this->pureperms->getConfig()->get("enable-multiworld-formats");
         $levelName = $isMultiWorldEnabled ? $player->getLevel()->getName() : null;
         $message = str_replace("{PurePerms}", $this->pureperms->getUser($player)->getGroup($levelName)->getName(), $message);
     } else {
         return false;
     }
     if ($this->killchat) {
         $message = str_replace("{Kills}", KillChat::getInstance()->getKills($player->getName()), $message);
     } else {
         $message = str_replace("{Kills}", "ERROR", $message);
     }
     if ($this->killchat) {
         $message = str_replace("{Deaths}", KillChat::getInstance()->getDeaths($player->getName()), $message);
     } else {
         $message = str_replace("{Deaths}", "ERROR", $message);
     }
     $message = str_replace("@Player", $event->getPlayer()->getDisplayName(), $message);
     foreach ($this->plugin->getServer()->getOnlinePlayers() as $player) {
         $player->sendPopup($message);
     }
 }
开发者ID:AndreyNazarchuk,项目名称:Collection-Plugins-PocketMine-Prax,代码行数:44,代码来源:ccListener.php

示例8: onPlayerQuit

 /**
  * @param PlayerQuitEvent $event
  */
 public function onPlayerQuit(PlayerQuitEvent $event)
 {
     // Quit message (nick):
     $message = $event->getQuitMessage();
     if ($message instanceof TranslationContainer) {
         foreach ($message->getParameters() as $i => $m) {
             $message->setParameter($i, str_replace($event->getPlayer()->getName(), $event->getPlayer()->getDisplayName(), $m));
         }
     } elseif ($message instanceof TextContainer) {
         $message->setText(str_replace($event->getPlayer()->getName(), $event->getPlayer()->getDisplayName(), $message->getText()));
     } else {
         $message = str_replace($event->getPlayer()->getName(), $event->getPlayer()->getDisplayName(), $message);
     }
     $event->setQuitMessage($message);
     // Session destroy:
     if ($this->getPlugin()->sessionExists($event->getPlayer())) {
         $this->getPlugin()->removeSession($event->getPlayer());
     }
 }
开发者ID:Jackboy320,项目名称:EssentialsPE,代码行数:22,代码来源:PlayerEvents.php

示例9: onPlayerQuit

 /**
  * @param PlayerQuitEvent $event
  *
  * @priority HIGHEST
  */
 public function onPlayerQuit(PlayerQuitEvent $event)
 {
     $player = $event->getPlayer();
     //Motd Update
     if (CustomAlerts::getAPI()->isMotdCustom()) {
         CustomAlerts::getAPI()->setMotdMessage(CustomAlerts::getAPI()->getDefaultMotdMessage());
     } else {
         CustomAlerts::getAPI()->setMotdMessage($this->plugin->translateColors("&", $this->plugin->getServer()->getMotd()));
     }
     //Motd Update Event
     $this->plugin->getServer()->getPluginManager()->callEvent(new CustomAlertsMotdUpdateEvent($this->plugin->getServer()->getMotd()));
     $this->plugin->getServer()->getNetwork()->setName(CustomAlerts::getAPI()->getMotdMessage());
     CustomAlerts::getAPI()->setQuitMessage($event->getQuitMessage());
     //Check if Quit message is hidden
     if (CustomAlerts::getAPI()->isQuitHidden()) {
         CustomAlerts::getAPI()->setQuitMessage("");
     } else {
         //Check if Quit message is custom
         if (CustomAlerts::getAPI()->isQuitCustom()) {
             CustomAlerts::getAPI()->setQuitMessage(CustomAlerts::getAPI()->getDefaultQuitMessage($player));
         }
     }
     //Quit Event
     $this->plugin->getServer()->getPluginManager()->callEvent(new CustomAlertsQuitEvent($player, $event->getQuitMessage()));
     $event->setQuitMessage(CustomAlerts::getAPI()->getQuitMessage());
 }
开发者ID:xHFx,项目名称:CustomAlerts,代码行数:31,代码来源:EventListener.php

示例10: onPlayerQuit

 public function onPlayerQuit(PlayerQuitEvent $event)
 {
     $event->getPlayer()->setDisplayName(substr($event->getPlayer()->getDisplayName(), strlen(PocketTelegram::getInstance()->getConfig()->get("minecraftUserPrefix", "~"))));
     $event->setQuitMessage($event->getPlayer()->getLeaveMessage());
 }
开发者ID:ChalkPE,项目名称:PocketTelegram,代码行数:5,代码来源:EventHandler.php

示例11: onQuit

 public function onQuit(PlayerQuitEvent $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);
         }
         if (count($this->offline_iplist) >= 5) {
             array_shift($this->offlinelist);
         }
         $this->offlinelist[] = $player->getName();
         $this->offline_iplist[] = $player->getAddress();
     }
     $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,代码行数:36,代码来源:PSYCHOPASS_Dominator.php

示例12: onQuit

 public function onQuit(PlayerQuitEvent $event)
 {
     if ($this->plugin->status === "enabled" && $this->plugin->getConfig()->get("player-quit") !== true) {
         $event->setQuitMessage("");
     }
 }
开发者ID:Jackboy320,项目名称:xAuth,代码行数:6,代码来源:LoginTasks.php

示例13: onQuit

 public function onQuit(PlayerQuitEvent $event)
 {
     $this->main->endSession($event->getPlayer());
     $event->setQuitMessage("");
 }
开发者ID:legoboy0215,项目名称:LegionPE-Theta-Base,代码行数:5,代码来源:SessionEventListener.php

示例14: onPlayerQuitEvent

 public function onPlayerQuitEvent(PlayerQuitEvent $event)
 {
     $name = $event->getPlayer()->getName();
     unset($this->players[$name]);
     $event->setQuitMessage('');
 }
开发者ID:100henrik100,项目名称:Minecraft-Pocket-Edition,代码行数:6,代码来源:minigame.php

示例15: onQuit

 public function onQuit(PlayerQuitEvent $event)
 {
     if (isset($this->preventQueue[$event->getPlayer()->getName()])) {
         $event->setQuitMessage("");
         unset($this->preventQueue[$event->getPlayer()->getName()]);
     }
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:7,代码来源:Gentleman.php


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