PocketMine-MP 5.16.1 git-585aee9386a787c95e73dd0a05ffca8329606b68
pocketmine\event\player\PlayerDuplicateLoginEvent Class Reference
+ Inheritance diagram for pocketmine\event\player\PlayerDuplicateLoginEvent:
+ Collaboration diagram for pocketmine\event\player\PlayerDuplicateLoginEvent:

Public Member Functions

 __construct (private NetworkSession $connectingSession, private NetworkSession $existingSession, private Translatable|string $disconnectReason, private Translatable|string|null $disconnectScreenMessage)
 
 call ()
 
 getConnectingSession ()
 
 getEventName ()
 
 getExistingSession ()
 
 isCancelled ()
 

Static Public Member Functions

static hasHandlers ()
 

Protected Attributes

string $eventName = null
 

Detailed Description

Called when a player connects with a username or UUID that is already used by another player on the server. If cancelled, the newly connecting session will be disconnected; otherwise, the existing player will be disconnected.

Definition at line 36 of file PlayerDuplicateLoginEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\player\PlayerDuplicateLoginEvent::__construct ( private NetworkSession  $connectingSession,
private NetworkSession  $existingSession,
private Translatable|string  $disconnectReason,
private Translatable|string|null  $disconnectScreenMessage 
)

Definition at line 40 of file PlayerDuplicateLoginEvent.php.

Member Function Documentation

◆ call()

pocketmine\event\Event::call ( )
inherited

Calls event handlers registered for this event.

Exceptions

RuntimeException if event call recursion reaches the max depth limit

Definition at line 49 of file Event.php.

◆ getConnectingSession()

pocketmine\event\player\PlayerDuplicateLoginEvent::getConnectingSession ( )

Definition at line 47 of file PlayerDuplicateLoginEvent.php.

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getExistingSession()

pocketmine\event\player\PlayerDuplicateLoginEvent::getExistingSession ( )

Definition at line 51 of file PlayerDuplicateLoginEvent.php.

◆ hasHandlers()

static pocketmine\event\Event::hasHandlers ( )
staticinherited

Returns whether the current class context has any registered global handlers. This can be used in hot code paths to avoid unnecessary event object creation.

Usage: SomeEventClass::hasHandlers()

Definition at line 77 of file Event.php.

◆ isCancelled()

pocketmine\event\Cancellable::isCancelled ( )
inherited

Returns whether this instance of the event is currently cancelled.

If it is cancelled, only downstream handlers that declare @handleCancelled will be called with this event.

Member Data Documentation

◆ $eventName

string pocketmine\event\Event::$eventName = null
protectedinherited

Definition at line 38 of file Event.php.


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