PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
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 48 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.

Parameters
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 109 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 76 of file NetworkSessionManager.php.

◆ getSessions()

pocketmine\network\NetworkSessionManager::getSessions ( )
Returns
NetworkSession[]

Definition at line 89 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 84 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 58 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 67 of file NetworkSessionManager.php.

◆ tick()

pocketmine\network\NetworkSessionManager::tick ( )

Updates all sessions which need it.

Definition at line 94 of file NetworkSessionManager.php.


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