mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
First look at separating disconnect reason and disconnect screen messages (#4512)
This commit is contained in:
@@ -96,10 +96,13 @@ class NetworkSessionManager{
|
||||
|
||||
/**
|
||||
* Terminates all connected sessions with the given reason.
|
||||
*
|
||||
* @param Translatable|string $reason Shown in the server log - this should be a short one-line message
|
||||
* @param Translatable|string|null $disconnectScreenMessage Shown on the player's disconnection screen (null will use the reason)
|
||||
*/
|
||||
public function close(Translatable|string $reason = "") : void{
|
||||
public function close(Translatable|string $reason = "", Translatable|string|null $disconnectScreenMessage = null) : void{
|
||||
foreach($this->sessions as $session){
|
||||
$session->disconnect($reason);
|
||||
$session->disconnect($reason, $disconnectScreenMessage);
|
||||
}
|
||||
$this->sessions = [];
|
||||
}
|
||||
|
Reference in New Issue
Block a user