Added player commands, better console API and implemented future player chat

This commit is contained in:
Shoghi Cervantes Pueyo
2013-02-07 09:23:37 +01:00
parent 72388fa3cb
commit c2e55941d8
6 changed files with 186 additions and 131 deletions

View File

@ -39,14 +39,18 @@ class ChatAPI{
$this->send(false, $message);
}
public function sendTo($owner, $text, $username){
$this->send($owner, $text, array($username));
public function sendTo($owner, $text, $player){
$this->send($owner, $text, array($player));
}
public function send($owner, $text, $whitelist = false, $blacklist = false){
$message = "";
if($owner !== false){
$message = "<".$owner."> ";
if($owner instanceof Player){
$message = "<".$owner->username."> ";
}else{
$message = "<".$owner."> ";
}
}
$message .= $text;
console("[CHAT] ".$message);