From 1154c7c1ab9711101194004b4c59c9a64c2ec06c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 21 May 2022 21:23:13 +0100 Subject: [PATCH] PlayerQuitEvent: improve documentation --- src/event/player/PlayerQuitEvent.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/event/player/PlayerQuitEvent.php b/src/event/player/PlayerQuitEvent.php index 9791cd893..3e08cb315 100644 --- a/src/event/player/PlayerQuitEvent.php +++ b/src/event/player/PlayerQuitEvent.php @@ -27,7 +27,14 @@ use pocketmine\lang\Translatable; use pocketmine\player\Player; /** - * Called when a player leaves the server + * Called when a player disconnects from the server for any reason. + * + * Some possible reasons include: + * - being kicked by an operator + * - disconnecting from the game + * - timeout due to network connectivity issues + * + * @see PlayerKickEvent */ class PlayerQuitEvent extends PlayerEvent{ @@ -42,14 +49,23 @@ class PlayerQuitEvent extends PlayerEvent{ $this->quitReason = $quitReason; } + /** + * Sets the quit message broadcasted to other players. + */ public function setQuitMessage(Translatable|string $quitMessage) : void{ $this->quitMessage = $quitMessage; } + /** + * Returns the quit message broadcasted to other players, e.g. "Steve left the game". + */ public function getQuitMessage() : Translatable|string{ return $this->quitMessage; } + /** + * Returns the disconnect reason shown in the server log and on the console. + */ public function getQuitReason() : string{ return $this->quitReason; }