Do not send crash reports from non-phar plugins

This commit is contained in:
Shoghi Cervantes 2014-07-28 23:14:29 +02:00
parent 7d8a961374
commit 3370052fac

View File

@ -69,6 +69,7 @@ use pocketmine\network\SourceInterface;
use pocketmine\network\upnp\UPnP; use pocketmine\network\upnp\UPnP;
use pocketmine\permission\BanList; use pocketmine\permission\BanList;
use pocketmine\permission\DefaultPermissions; use pocketmine\permission\DefaultPermissions;
use pocketmine\plugin\PharPluginLoader;
use pocketmine\plugin\Plugin; use pocketmine\plugin\Plugin;
use pocketmine\plugin\PluginLoadOrder; use pocketmine\plugin\PluginLoadOrder;
use pocketmine\plugin\PluginManager; use pocketmine\plugin\PluginManager;
@ -1792,7 +1793,17 @@ class Server{
$this->logger->emergency("An unrecoverable error has occurred and the server has crashed. Creating a crash dump"); $this->logger->emergency("An unrecoverable error has occurred and the server has crashed. Creating a crash dump");
$dump = new CrashDump($this); $dump = new CrashDump($this);
$this->logger->emergency("Please submit the \"".$dump->getPath()."\" file to the Bug Reporting page. Give as much info as you can.");
if($this->getProperty("auto-report.enabled", true) !== false){ if($this->getProperty("auto-report.enabled", true) !== false){
$plugin = $dump->getData()["plugin"];
if(is_string($plugin)){
$p = $this->pluginManager->getPlugin($plugin);
if($p instanceof Plugin and !($p->getPluginLoader() instanceof PharPluginLoader)){
return;
}
}
$reply = Utils::postURL("http://".$this->getProperty("auto-report.host", "crash.pocketmine.net")."/submit/api", [ $reply = Utils::postURL("http://".$this->getProperty("auto-report.host", "crash.pocketmine.net")."/submit/api", [
"report" => "yes", "report" => "yes",
"name" => "PocketMine-MP ".$this->getPocketMineVersion(), "name" => "PocketMine-MP ".$this->getPocketMineVersion(),
@ -1807,8 +1818,6 @@ class Server{
} }
} }
$this->logger->emergency("Please submit the \"".$dump->getPath()."\" file to the Bug Reporting page. Give as much info as you can.");
//$this->checkMemory(); //$this->checkMemory();
//$dump .= "Memory Usage Tracking: \r\n" . chunk_split(base64_encode(gzdeflate(implode(";", $this->memoryStats), 9))) . "\r\n"; //$dump .= "Memory Usage Tracking: \r\n" . chunk_split(base64_encode(gzdeflate(implode(";", $this->memoryStats), 9))) . "\r\n";