本文整理汇总了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;
}
}
示例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)));
}
示例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;
}
}
}
示例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));
}
}
}
示例5: onPlayerKick
public function onPlayerKick(PlayerKickEvent $event)
{
if ($event->getReason() == "기본닉네임") {
$event->setQuitMessage("");
}
}
示例6: onKick
public function onKick(PlayerKickEvent $event)
{
if ($event->getReason() == $this->get("badwords-nickname")) {
$event->setQuitMessage("");
}
}
示例7: onPlayerKickEvent
public function onPlayerKickEvent(PlayerKickEvent $event)
{
if ($event->getReason() == $this->plugin->get("already-connected")) {
$event->setQuitMessage("");
}
}