From 5e231c846c7b6005a94003c37eed8881cf01ee1a Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Wed, 12 Jun 2013 14:55:38 +0200 Subject: [PATCH] Chat checks --- src/API/ConsoleAPI.php | 2 ++ src/Player.php | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/API/ConsoleAPI.php b/src/API/ConsoleAPI.php index 349eb9c3..245e02d7 100644 --- a/src/API/ConsoleAPI.php +++ b/src/API/ConsoleAPI.php @@ -245,6 +245,8 @@ class ConsoleAPI{ }elseif($this->server->api->dhandle("console.command.unknown", array("cmd" => $cmd, "params" => $params, "issuer" => $issuer, "alias" => $alias)) !== false){ $output = $this->defaultCommands($cmd, $params, $issuer, $alias); } + }else{ + $output = ""; } if($output != "" and ($issuer instanceof Player)){ $issuer->sendChat(trim($output)); diff --git a/src/Player.php b/src/Player.php index a5deee69..4447399d 100644 --- a/src/Player.php +++ b/src/Player.php @@ -570,9 +570,12 @@ class Player{ } } } - $this->dataPacket(MC_CHAT, array( - "message" => $m, - )); + + if($m !== ""){ + $this->dataPacket(MC_CHAT, array( + "message" => $m, + )); + } } }