|
|
|
@ -95,6 +95,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
|
|
|
|
|
$this->maniaControl->getCommandManager()->registerCommandListener('brb', $this, 'chat_brb', false, 'Writes a be right back message to the chat.');
|
|
|
|
|
$this->maniaControl->getCommandManager()->registerCommandListener('bgm', $this, 'chat_bgm', false, 'Writes a bad game for me message to the chat.');
|
|
|
|
|
$this->maniaControl->getCommandManager()->registerCommandListener('afk', $this, 'chat_afk', false, 'Writes an away from keyboard message to the chat.');
|
|
|
|
|
$this->maniaControl->getCommandManager()->registerCommandListener('wp', $this, 'chat_wp', false, 'Writes an well played message to the chat.');
|
|
|
|
|
$this->maniaControl->getCommandManager()->registerCommandListener(array('bm', 'bootme'), $this, 'chat_bootme', false, 'Gets you away from this server quickly!');
|
|
|
|
|
$this->maniaControl->getCommandManager()->registerCommandListener(array('rq', 'ragequit'), $this, 'chat_ragequit', false, 'Gets you away from this server in rage!');
|
|
|
|
|
//TODO block command listener for muted people
|
|
|
|
@ -109,6 +110,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
|
|
|
|
|
public function unload() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Builds a chat message starting with the player's nickname, can used to express emotions
|
|
|
|
|
*
|
|
|
|
@ -119,7 +121,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
|
|
|
|
|
$message = substr($chat[1][2], 4);
|
|
|
|
|
|
|
|
|
|
$msg = '$<' . $player->nickname . '$>$s$i$fa0 ' . $message;
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -136,7 +138,276 @@ class ChatMessagePlugin implements CommandListener, Plugin {
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iHello All!';
|
|
|
|
|
}
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bye Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_bye(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iBye $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iI have to go... Bye All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Thx Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_thx(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iThanks $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iThanks All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Good Game Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_gg(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[' . $player->getEscapedNickname() . '] $ff0$iGood Game $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[' . $player->getEscapedNickname() . '] $ff0$iGood Game All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Good Luck Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_gl(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iGood Luck $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iGood Luck All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Have Fun Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_hf(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[' . $player->getEscapedNickname() . '] $ff0$iHave Fun $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[' . $player->getEscapedNickname() . '] $ff0$iHave Fun All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Good Luck and Have Fun Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_glhf(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iGood Luck and Have Fun $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iGood Luck and Have Fun All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Nice Shot Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_ns(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iNice Shot $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iNice Shot!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Nice one Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_n1(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iNice One $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iNice One!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Well Played message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_wp(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iWell Played $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iWell Played!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Lol! Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_lol(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iLoL!';
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* LooOOooL! Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_lool(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iLooOOooL!';
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Be right back Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_brb(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iBe Right Back!';
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bad game for me Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_bgm(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iBad Game for me :(';
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Leave the server with an Bootme Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_bootme(array $chat, Player $player) {
|
|
|
|
|
$msg = '$i$ff0 $<' . $player->nickname . '$>$s$39f chooses to boot back to the real world!';
|
|
|
|
|
$this->sendChat($msg, $player, true);
|
|
|
|
|
|
|
|
|
|
$message = '$39F Thanks for Playing, see you around!$z';
|
|
|
|
|
try {
|
|
|
|
|
$this->maniaControl->getClient()->kick($player->login, $message);
|
|
|
|
|
} catch (UnknownPlayerException $exception) {
|
|
|
|
|
$this->maniaControl->getChat()->sendException($exception, $player);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Leave the server with an Ragequit
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_ragequit(array $chat, Player $player) {
|
|
|
|
|
try {
|
|
|
|
|
$message = '$39F Thanks for Playing, please come back soon!$z ';
|
|
|
|
|
$this->maniaControl->getClient()->kick($player->login, $message);
|
|
|
|
|
$msg = '$i$ff0 $<' . $player->nickname . '$>$s$f00 said: "@"#!" and ragequitted!';
|
|
|
|
|
$this->sendChat($msg, $player, true);
|
|
|
|
|
} catch (UnknownPlayerException $e) {
|
|
|
|
|
$this->maniaControl->getChat()->sendError('Error occurred: ' . $e->getMessage(), $player);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Afk Message and force player to spec
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_afk(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iAway From Keyboard!';
|
|
|
|
|
$this->sendChat($msg, $player);
|
|
|
|
|
|
|
|
|
|
if (!$this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_AFK_FORCE_SPEC)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($player->isSpectator) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// Force into spec
|
|
|
|
|
$this->maniaControl->getClient()->forceSpectator($player->login, 3);
|
|
|
|
|
// Free player slot
|
|
|
|
|
$this->maniaControl->getClient()->spectatorReleasePlayerSlot($player->login);
|
|
|
|
|
} catch (UnknownPlayerException $exception) {
|
|
|
|
|
$this->maniaControl->getChat()->sendException($exception, $player);
|
|
|
|
|
} catch (PlayerStateException $exception) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -163,254 +434,17 @@ class ChatMessagePlugin implements CommandListener, Plugin {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bye Message
|
|
|
|
|
* Checks if the Player is Muted and sends the Chat if he isnt
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param $msg
|
|
|
|
|
* @param Player $player
|
|
|
|
|
* @param bool $prefix
|
|
|
|
|
*/
|
|
|
|
|
public function chat_bye(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iBye $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
private function sendChat($msg, Player $player, $prefix = false) {
|
|
|
|
|
if (!$player->isMuted()) {
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, $prefix);
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iI have to go... Bye All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Thx Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_thx(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iThanks $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iThanks All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Good Game Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_gg(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[' . $player->getEscapedNickname() . '] $ff0$iGood Game $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[' . $player->getEscapedNickname() . '] $ff0$iGood Game All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Good Luck Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_gl(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iGood Luck $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iGood Luck All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Have Fun Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_hf(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[' . $player->getEscapedNickname() . '] $ff0$iHave Fun $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[' . $player->getEscapedNickname() . '] $ff0$iHave Fun All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Good Luck and Have Fun Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_glhf(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iGood Luck and Have Fun $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iGood Luck and Have Fun All!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Nice Shot Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_ns(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iNice Shot $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iNice Shot!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Nice one Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_n1(array $chat, Player $player) {
|
|
|
|
|
$command = explode(" ", $chat[1][2]);
|
|
|
|
|
|
|
|
|
|
if (isset($command[1])) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iNice One $z$<' . $this->getTarget($command[1]) . '$>$i!';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iNice One!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Lol! Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_lol(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iLoL!';
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* LooOOooL! Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_lool(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iLooOOooL!';
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Be right back Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_brb(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iBe Right Back!';
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bad game for me Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_bgm(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iBad Game for me :(';
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Leave the server with an Bootme Message
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_bootme(array $chat, Player $player) {
|
|
|
|
|
$msg = '$i$ff0 $<' . $player->nickname . '$>$s$39f chooses to boot back to the real world!';
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, true);
|
|
|
|
|
|
|
|
|
|
$message = '$39F Thanks for Playing, see you around!$z';
|
|
|
|
|
try {
|
|
|
|
|
$this->maniaControl->getClient()->kick($player->login, $message);
|
|
|
|
|
} catch (UnknownPlayerException $exception) {
|
|
|
|
|
$this->maniaControl->getChat()->sendException($exception, $player);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Leave the server with an Ragequit
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_ragequit(array $chat, Player $player) {
|
|
|
|
|
try {
|
|
|
|
|
$message = '$39F Thanks for Playing, please come back soon!$z ';
|
|
|
|
|
$this->maniaControl->getClient()->kick($player->login, $message);
|
|
|
|
|
$msg = '$i$ff0 $<' . $player->nickname . '$>$s$f00 said: "@"#!" and ragequitted!';
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, true);
|
|
|
|
|
} catch (UnknownPlayerException $e) {
|
|
|
|
|
$this->maniaControl->getChat()->sendError('Error occurred: ' . $e->getMessage(), $player);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Afk Message and force player to spec
|
|
|
|
|
*
|
|
|
|
|
* @param array $chat
|
|
|
|
|
* @param Player $player
|
|
|
|
|
*/
|
|
|
|
|
public function chat_afk(array $chat, Player $player) {
|
|
|
|
|
$msg = '$ff0[$<' . $player->nickname . '$>] $ff0$iAway From Keyboard!';
|
|
|
|
|
$this->maniaControl->getChat()->sendChat($msg, null, false);
|
|
|
|
|
|
|
|
|
|
if (!$this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_AFK_FORCE_SPEC)
|
|
|
|
|
) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($player->isSpectator) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// Force into spec
|
|
|
|
|
$this->maniaControl->getClient()->forceSpectator($player->login, 3);
|
|
|
|
|
// Free player slot
|
|
|
|
|
$this->maniaControl->getClient()->spectatorReleasePlayerSlot($player->login);
|
|
|
|
|
} catch (UnknownPlayerException $exception) {
|
|
|
|
|
$this->maniaControl->getChat()->sendException($exception, $player);
|
|
|
|
|
} catch (PlayerStateException $exception) {
|
|
|
|
|
$this->maniaControl->getChat()->sendError("You can't use this command because you are muted!", $player);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|