PocketMine-MP 5.16.1 git-585aee9386a787c95e73dd0a05ffca8329606b68
pocketmine\network\NetworkSessionManager Class Reference
+ Collaboration diagram for pocketmine\network\NetworkSessionManager:

Public Member Functions

 add (NetworkSession $session)
 close (Translatable|string $reason="", Translatable|string|null $disconnectScreenMessage=null)
 getSessionCount ()
 getSessions ()
 getValidSessionCount ()
 markLoginReceived (NetworkSession $session)
 remove (NetworkSession $session)
 tick ()

Detailed Description

Definition at line 31 of file NetworkSessionManager.php.

Member Function Documentation

◆ add()

pocketmine\network\NetworkSessionManager::add ( NetworkSession  $session)

Adds a network session to the manager. This should only be called on session creation.

Definition at line 42 of file NetworkSessionManager.php.

◆ close()

pocketmine\network\NetworkSessionManager::close ( Translatable|string  $reason = "",
Translatable|string|null  $disconnectScreenMessage = null 

Terminates all connected sessions with the given reason.

Translatable | string$reasonShown in the server log - this should be a short one-line message
Translatable | string | null$disconnectScreenMessageShown on the player's disconnection screen (null will use the reason)

Definition at line 103 of file NetworkSessionManager.php.

◆ getSessionCount()

pocketmine\network\NetworkSessionManager::getSessionCount ( )

Returns the number of known connected sessions, including sessions which have not yet sent a login request.

Definition at line 70 of file NetworkSessionManager.php.

◆ getSessions()

pocketmine\network\NetworkSessionManager::getSessions ( )

Definition at line 83 of file NetworkSessionManager.php.

◆ getValidSessionCount()

pocketmine\network\NetworkSessionManager::getValidSessionCount ( )

Returns the number of connected sessions which have either sent a login request, or have already completed the login sequence.

Definition at line 78 of file NetworkSessionManager.php.

◆ markLoginReceived()

pocketmine\network\NetworkSessionManager::markLoginReceived ( NetworkSession  $session)

Marks the session as having sent a login request. After this point, they are counted towards the total player count.

Definition at line 52 of file NetworkSessionManager.php.

◆ remove()

pocketmine\network\NetworkSessionManager::remove ( NetworkSession  $session)

Removes the given network session, due to disconnect. This should only be called by a network session on disconnection.

Definition at line 61 of file NetworkSessionManager.php.

◆ tick()

pocketmine\network\NetworkSessionManager::tick ( )

Updates all sessions which need it.

Definition at line 88 of file NetworkSessionManager.php.

The documentation for this class was generated from the following file: