NetworkSessionManager
in package
Table of Contents
- $sessions : array<string|int, NetworkSession>
- add() : void
- Adds a network session to the manager. This should only be called on session creation.
- close() : void
- Terminates all connected sessions with the given reason.
- getSessionCount() : int
- Returns the number of known connected sessions.
- getSessions() : array<string|int, NetworkSession>
- remove() : void
- Removes the given network session, due to disconnect. This should only be called by a network session on disconnection.
- tick() : void
- Updates all sessions which need it.
Properties
$sessions
private
array<string|int, NetworkSession>
$sessions
= []
Methods
add()
Adds a network session to the manager. This should only be called on session creation.
public
add(NetworkSession $session) : void
Parameters
- $session : NetworkSession
Return values
void —close()
Terminates all connected sessions with the given reason.
public
close([string $reason = "" ]) : void
Parameters
- $reason : string = ""
Return values
void —getSessionCount()
Returns the number of known connected sessions.
public
getSessionCount() : int
Return values
int —getSessions()
public
getSessions() : array<string|int, NetworkSession>
Return values
array<string|int, NetworkSession> —remove()
Removes the given network session, due to disconnect. This should only be called by a network session on disconnection.
public
remove(NetworkSession $session) : void
Parameters
- $session : NetworkSession
Return values
void —tick()
Updates all sessions which need it.
public
tick() : void