mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +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;
|
break;
|
||||||
}
|
}
|
||||||
$sender = ($issuer instanceof Player) ? "Server" : ucfirst($issuer);
|
$sender = ($issuer instanceof Player) ? "Server" : ucfirst($issuer);
|
||||||
|
if(Utils::hasEmoji($s)) return "Your message contains illegal characters!";
|
||||||
$this->server->api->chat->broadcast("[$sender] " . $s);
|
$this->server->api->chat->broadcast("[$sender] " . $s);
|
||||||
break;
|
break;
|
||||||
case "me":
|
case "me":
|
||||||
|
|
@ -52,7 +53,9 @@ class ChatAPI{
|
||||||
}else{
|
}else{
|
||||||
$sender = $issuer->username;
|
$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;
|
break;
|
||||||
case "tell":
|
case "tell":
|
||||||
if(!isset($params[0]) or !isset($params[1])){
|
if(!isset($params[0]) or !isset($params[1])){
|
||||||
|
|
@ -80,6 +83,7 @@ class ChatAPI{
|
||||||
return "You can't send message to yourself.";
|
return "You can't send message to yourself.";
|
||||||
}
|
}
|
||||||
$mes = implode(" ", $params);
|
$mes = implode(" ", $params);
|
||||||
|
if(Utils::hasEmoji($mes)) return "Your message contains illegal characters!";
|
||||||
$output .= "You're whispering to " . $target . ": " . $mes . "\n";
|
$output .= "You're whispering to " . $target . ": " . $mes . "\n";
|
||||||
if($target !== "Console" and $target !== "Rcon"){
|
if($target !== "Console" and $target !== "Rcon"){
|
||||||
$this->sendTo(false, $sender . " whispers to you: " . $mes, $target);
|
$this->sendTo(false, $sender . " whispers to you: " . $mes, $target);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue