diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 5d9455076..7e29fa286 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1784,8 +1784,24 @@ class Server{ return; } ini_set("memory_limit", "-1"); //Fix error dump not dumped on memory problems - $this->logger->emergency("An unrecoverable has occurred and the server has crashed. Creating an error dump"); + $this->logger->emergency("An unrecoverable has occurred and the server has crashed. Creating a crash dump"); $dump = new CrashDump($this); + + if($this->getProperty("settings.send-crash", true) !== false){ + $reply = Utils::postURL("http://crash.pocketmine.net/submit/api", [ + "report" => "yes", + "name" => "PocketMine-MP ".$this->getPocketMineVersion(), + "email" => "crash@pocketmine.net", + "reportPaste" => base64_encode($dump->getEncodedData()) + ]); + + if(($data = json_decode($reply)) !== false and isset($data->crashId)){ + $reportId = $data->crashId; + $reportUrl = $data->crashUrl; + $this->logger->emergency("The crash dump has ben automatically submitted to the Crash Archive. You can view it on $reportUrl or use the ID #$reportId."); + } + } + $this->logger->emergency("Please submit the \"".$dump->getPath()."\" file to the Bug Reporting page. Give as much info as you can."); //$this->checkMemory(); diff --git a/src/pocketmine/resources/pocketmine.yml b/src/pocketmine/resources/pocketmine.yml index 3b7926525..d1aecc4ba 100644 --- a/src/pocketmine/resources/pocketmine.yml +++ b/src/pocketmine/resources/pocketmine.yml @@ -10,6 +10,7 @@ settings: advanced-cache: false upnp-forwarding: false send-usage: true + send-crash: true async-workers: 4 debug: