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

@ -39,6 +39,7 @@ use raklib\server\ServerHandler;
use raklib\server\ServerInstance;
use raklib\utils\InternetAddress;
use function addcslashes;
use function count;
use function implode;
use function rtrim;
use function spl_object_hash;
@ -99,6 +100,10 @@ class RakLibInterface implements ServerInstance, AdvancedNetworkInterface{
$this->rakLib->start(PTHREADS_INHERIT_CONSTANTS); //HACK: MainLogger needs constants for exception logging
}
public function getConnectionCount() : int{
return count($this->sessions);
}
public function setNetwork(Network $network) : void{
$this->network = $network;
}