Player: Give me ALLLLL your crashdumps

I suspect this is going to cause a firestorm, but once it does we'll be able to see what needs fixing.
This commit is contained in:
Dylan K. Taylor 2018-12-28 19:30:05 +00:00
parent 0ea166a551
commit 0eef634aab

View File

@ -3398,8 +3398,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
*/ */
final public function close($message = "", string $reason = "generic reason", bool $notify = true) : void{ final public function close($message = "", string $reason = "generic reason", bool $notify = true) : void{
if($this->isConnected() and !$this->closed){ if($this->isConnected() and !$this->closed){
try{
if($notify and strlen($reason) > 0){ if($notify and strlen($reason) > 0){
$pk = new DisconnectPacket(); $pk = new DisconnectPacket();
$pk->message = $reason; $pk->message = $reason;
@ -3420,12 +3418,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->server->broadcastMessage($ev->getQuitMessage()); $this->server->broadcastMessage($ev->getQuitMessage());
} }
try{
$this->save(); $this->save();
}catch(\Throwable $e){
$this->server->getLogger()->critical("Failed to save player data for " . $this->getName());
$this->server->getLogger()->logException($e);
}
} }
if($this->isValid()){ if($this->isValid()){
@ -3467,6 +3460,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->server->removeOnlinePlayer($this); $this->server->removeOnlinePlayer($this);
} }
$this->server->removePlayer($this);
$this->server->getLogger()->info($this->getServer()->getLanguage()->translateString("pocketmine.player.logOut", [ $this->server->getLogger()->info($this->getServer()->getLanguage()->translateString("pocketmine.player.logOut", [
TextFormat::AQUA . $this->getName() . TextFormat::WHITE, TextFormat::AQUA . $this->getName() . TextFormat::WHITE,
$this->ip, $this->ip,
@ -3480,11 +3475,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->perm->clearPermissions(); $this->perm->clearPermissions();
$this->perm = null; $this->perm = null;
} }
}catch(\Throwable $e){
$this->server->getLogger()->logException($e);
}finally{
$this->server->removePlayer($this);
}
} }
} }