Fix /me @all critical server crash bug. Fix #840. Disabled usage of @all for non-ops.

This commit is contained in:
Michael Yoo 2013-10-19 11:12:54 +10:30
parent 780f60554d
commit 58fce0e939

View File

@ -204,9 +204,16 @@ class ConsoleAPI{
break;
case "a":
case "all":
$output = "";
foreach($this->server->api->player->getAll() as $p){
$output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias);
if($this->server->api->ban->isOp($issuer->username))
{
$output = "";
foreach($this->server->api->player->getAll() as $p){
$output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias);
}
}
else
{
$issuer->sendChat("You don't have permissions to use this command.\n");
}
return $output;
case "r":