mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Improved Chat API
This commit is contained in:
parent
b398b9daa2
commit
02950474af
6 changed files with 104 additions and 23 deletions
|
|
@ -35,8 +35,17 @@ class ChatAPI{
|
|||
|
||||
}
|
||||
|
||||
public function send($a, $b){//a == name of owner. b == message
|
||||
$this->server->chat($a, $b);
|
||||
return true;
|
||||
public function broadcast($message){
|
||||
$this->send(false, $message);
|
||||
}
|
||||
|
||||
public function send($owner, $text, $whitelist = false, $blacklist = false){
|
||||
$message = "";
|
||||
if($owner !== false){
|
||||
$message = "<".$owner."> ";
|
||||
}
|
||||
$message .= $text;
|
||||
console("[CHAT] ".$message);
|
||||
$this->server->handle("server.chat", new Container($message, $whitelist, $blacklist));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue