diff --git a/src/Player.php b/src/Player.php index ebbdba660..51735415c 100644 --- a/src/Player.php +++ b/src/Player.php @@ -303,7 +303,7 @@ class Player{ $this->resendQueue = array(); $this->ackQueue = array(); $this->server->api->player->remove($this->CID); - if($msg === true and $this->username != ""){ + 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); diff --git a/src/utils/Utils.php b/src/utils/Utils.php index a83793fbf..c25597941 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -569,7 +569,7 @@ class Utils{ for($i = 0; $i < 8; $i += 4){ $value = bcmul($value, "4294967296", 0); //4294967296 == 2^32 - $value = bcadd($value, 0x1000000 * ord($x{$i}) + ((ord($x{$i + 1}) << 16) | (ord($x{$i + 2}) << 8) | ord($x{$i + 3})), 0); + $value = bcadd($value, 0x1000000 * ord(@$x{$i}) + ((ord(@$x{$i + 1}) << 16) | (ord(@$x{$i + 2}) << 8) | ord(@$x{$i + 3})), 0); } return ($negative === true ? "-".$value:$value); }