From 19b3ac4a99a999e2494ebd7e542f40e2eaf455e7 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Tue, 20 Aug 2013 02:15:18 +0200 Subject: [PATCH] Fixed disconnection --- src/Player.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Player.php b/src/Player.php index 5db8b5182..607ce6352 100644 --- a/src/Player.php +++ b/src/Player.php @@ -274,8 +274,11 @@ class Player{ $this->recoveryQueue = array(); $this->receiveQueue = array(); $this->resendQueue = array(); - $this->server->interface->stopChunked($this->CID); - $this->server->api->player->remove($this->CID); + $this->server->interface->stopChunked($this->CID); + $this->server->api->player->remove($this->CID); + if($msg === true and $this->username != ""){ + $this->server->api->chat->broadcast($this->username." left the game"); + } console("[INFO] \x1b[33m".$this->username."\x1b[0m[/".$this->ip.":".$this->port."] logged out due to ".$reason); } } @@ -1217,9 +1220,9 @@ class Player{ if($this->spawned !== false){ break; } + $this->spawned = true; $this->server->api->player->spawnAllPlayers($this); $this->server->api->player->spawnToAllPlayers($this); - $this->spawned = true; $this->server->api->entity->spawnAll($this); $this->server->api->entity->spawnToAll($this->entity);