From 08fe825a070904bc88d475559fdc7dd0f64544cd Mon Sep 17 00:00:00 2001 From: kotyaralih <62548070+kotyaralih@users.noreply.github.com> Date: Mon, 27 Dec 2021 00:41:15 +0500 Subject: [PATCH] Player leave message is now shown. --- src/Player.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Player.php b/src/Player.php index 3b98469b..c6f5b44d 100644 --- a/src/Player.php +++ b/src/Player.php @@ -291,6 +291,9 @@ class Player{ $this->directDataPacket(MC_DISCONNECT); $this->connected = false; $this->level->freeAllChunks($this); + if($msg === true and $this->username != "" and $this->spawned !== false){ + $this->server->api->chat->broadcast($this->username." left the game"); + } $this->spawned = false; $this->loggedIn = false; $this->buffer = null; @@ -301,9 +304,6 @@ class Player{ $this->ackQueue = array(); $this->server->interface->stopChunked($this->CID); $this->server->api->player->remove($this->CID); - if($msg === true and $this->username != "" and $this->spawned !== false){ - $this->server->api->chat->broadcast($this->username." left the game"); - } console("[INFO] ".FORMAT_AQUA.$this->username.FORMAT_RESET."[/".$this->ip.":".$this->port."] logged out due to ".$reason); $this->windows = array(); $this->armor = array();