mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
emoji checks for say, tell and me
This commit is contained in:
parent
1370ccf6b4
commit
21fc67cf1a
1 changed files with 5 additions and 1 deletions
|
|
@ -35,6 +35,7 @@ class ChatAPI{
|
|||
break;
|
||||
}
|
||||
$sender = ($issuer instanceof Player) ? "Server" : ucfirst($issuer);
|
||||
if(Utils::hasEmoji($s)) return "Your message contains illegal characters!";
|
||||
$this->server->api->chat->broadcast("[$sender] " . $s);
|
||||
break;
|
||||
case "me":
|
||||
|
|
@ -52,7 +53,9 @@ class ChatAPI{
|
|||
}else{
|
||||
$sender = $issuer->username;
|
||||
}
|
||||
$this->broadcast("* $sender " . implode(" ", $params));
|
||||
$msg = implode(" ", $params);
|
||||
if(Utils::hasEmoji($msg)) return "Your message contains illegal characters!";
|
||||
$this->broadcast("* $sender $msg");
|
||||
break;
|
||||
case "tell":
|
||||
if(!isset($params[0]) or !isset($params[1])){
|
||||
|
|
@ -80,6 +83,7 @@ class ChatAPI{
|
|||
return "You can't send message to yourself.";
|
||||
}
|
||||
$mes = implode(" ", $params);
|
||||
if(Utils::hasEmoji($mes)) return "Your message contains illegal characters!";
|
||||
$output .= "You're whispering to " . $target . ": " . $mes . "\n";
|
||||
if($target !== "Console" and $target !== "Rcon"){
|
||||
$this->sendTo(false, $sender . " whispers to you: " . $mes, $target);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue