From 3d5541696b7db73d1112bf80acffc638a07107bb Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 26 Aug 2013 23:35:18 +0200 Subject: [PATCH] New chat protocol --- src/API/ChatAPI.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/API/ChatAPI.php b/src/API/ChatAPI.php index 225814ab..ed0ad60f 100644 --- a/src/API/ChatAPI.php +++ b/src/API/ChatAPI.php @@ -104,23 +104,26 @@ class ChatAPI{ public function send($owner, $text, $whitelist = false, $blacklist = false){ $message = array( - "owner" => $owner, + "player" => $owner, "message" => $text, - } + ); if($owner !== false){ if($owner instanceof Player){ - console("[INFO] <".$owner->username."> ".$text); + if($whitelist === false){ + console("[INFO] <".$owner->username."> ".$text); + } }else{ - console("[INFO] <".$owner."> ".$text); + if($whitelist === false){ + console("[INFO] <".$owner."> ".$text); + } } }else{ - console("[INFO] $text"); - $message["owner"] = ""; + if($whitelist === false){ + console("[INFO] $text"); + } + $message["player"] = ""; } - if($whitelist === false){ - console("[INFO] ".$message); - } $this->server->handle("server.chat", new Container($message, $whitelist, $blacklist)); } } \ No newline at end of file