Fix /list adding a trailing comma.

This commit is contained in:
williamtdr 2014-03-14 16:45:54 -05:00
parent e0705c80e2
commit c266cb991c

View File

@ -277,14 +277,14 @@ class PlayerAPI{
} }
break; break;
case "list": case "list":
$output .= "There are ".count($this->server->clients)."/".$this->server->maxClients." players online:\n"; $cmd_output .= "There are ".count($this->server->clients)."/".$this->server->maxClients." players online:\n";
if(count($this->server->clients) == 0){ if(count($this->server->clients) == 0){
break; break;
} }
foreach($this->server->clients as $c){ foreach($this->server->clients as $c){
$output .= $c->username.", "; $cmd_output .= $c->username.", ";
} }
$output = substr($output, 0, -2)."\n"; $output = substr($cmd_output, 0, -2)."\n";
break; break;
} }
return $output; return $output;