Max players check now works properly

This now includes all connected sessions, whether they are considered online or not.
This commit is contained in:
Dylan K. Taylor
2019-01-17 21:40:10 +00:00
parent 41676cb4d4
commit 38cf8d157d
5 changed files with 26 additions and 2 deletions

View File

@@ -2093,9 +2093,13 @@ class Server{
$u = Utils::getMemoryUsage(true);
$usage = sprintf("%g/%g/%g/%g MB @ %d threads", round(($u[0] / 1024) / 1024, 2), round(($d[0] / 1024) / 1024, 2), round(($u[1] / 1024) / 1024, 2), round(($u[2] / 1024) / 1024, 2), Utils::getThreadCount());
$online = count($this->playerList);
$connecting = $this->network->getConnectionCount() - $online;
echo "\x1b]0;" . $this->getName() . " " .
$this->getPocketMineVersion() .
" | Online " . count($this->players) . "/" . $this->getMaxPlayers() .
" | Online $online/" . $this->getMaxPlayers() .
($connecting > 0 ? " (+$connecting connecting)" : "") .
" | Memory " . $usage .
" | U " . round($this->network->getUpload() / 1024, 2) .
" D " . round($this->network->getDownload() / 1024, 2) .