NetworkSessionManager
Methods
add()
php
public function add(\pocketmine\network\mcpe\NetworkSession $session) : voidAdds a network session to the manager. This should only be called on session creation.
close()
php
public function close(\pocketmine\lang\Translatable|string $reason = "", \pocketmine\lang\Translatable|string|null $disconnectScreenMessage = null) : voidTerminates all connected sessions with the given reason.
getSessionCount()
php
public function getSessionCount() : intReturns the number of known connected sessions, including sessions which have not yet sent a login request.
getSessions()
php
public function getSessions() : arraygetValidSessionCount()
php
public function getValidSessionCount() : intReturns the number of connected sessions which have either sent a login request, or have already completed the login sequence.
markLoginReceived()
php
public function markLoginReceived(\pocketmine\network\mcpe\NetworkSession $session) : voidMarks the session as having sent a login request. After this point, they are counted towards the total player count.
remove()
php
public function remove(\pocketmine\network\mcpe\NetworkSession $session) : voidRemoves the given network session, due to disconnect. This should only be called by a network session on disconnection.
tick()
php
public function tick() : voidUpdates all sessions which need it.
