mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
PlayerQuitEvent: improve documentation
This commit is contained in:
parent
4a3e42f82e
commit
1154c7c1ab
@ -27,7 +27,14 @@ use pocketmine\lang\Translatable;
|
|||||||
use pocketmine\player\Player;
|
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{
|
class PlayerQuitEvent extends PlayerEvent{
|
||||||
|
|
||||||
@ -42,14 +49,23 @@ class PlayerQuitEvent extends PlayerEvent{
|
|||||||
$this->quitReason = $quitReason;
|
$this->quitReason = $quitReason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the quit message broadcasted to other players.
|
||||||
|
*/
|
||||||
public function setQuitMessage(Translatable|string $quitMessage) : void{
|
public function setQuitMessage(Translatable|string $quitMessage) : void{
|
||||||
$this->quitMessage = $quitMessage;
|
$this->quitMessage = $quitMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the quit message broadcasted to other players, e.g. "Steve left the game".
|
||||||
|
*/
|
||||||
public function getQuitMessage() : Translatable|string{
|
public function getQuitMessage() : Translatable|string{
|
||||||
return $this->quitMessage;
|
return $this->quitMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the disconnect reason shown in the server log and on the console.
|
||||||
|
*/
|
||||||
public function getQuitReason() : string{
|
public function getQuitReason() : string{
|
||||||
return $this->quitReason;
|
return $this->quitReason;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user