本文整理匯總了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("");
}
}