PlayerQuitEvent: improve documentation

This commit is contained in:
Dylan K. Taylor 2022-05-21 21:23:13 +01:00
parent 4a3e42f82e
commit 1154c7c1ab
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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;
}