mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Merge commit 'f4ee2912db89c6629d4fa191e993f0798035ef20'
# Conflicts: # resources/vanilla # src/pocketmine/Server.php
This commit is contained in:
commit
c29ed34b54
@ -1437,17 +1437,24 @@ class Server{
|
|||||||
|
|
||||||
if($report){
|
if($report){
|
||||||
$url = ((bool) $this->configGroup->getProperty("auto-report.use-https", true) ? "https" : "http") . "://" . $this->configGroup->getProperty("auto-report.host", "crash.pmmp.io") . "/submit/api";
|
$url = ((bool) $this->configGroup->getProperty("auto-report.use-https", true) ? "https" : "http") . "://" . $this->configGroup->getProperty("auto-report.host", "crash.pmmp.io") . "/submit/api";
|
||||||
|
$postUrlError = "Unknown error";
|
||||||
$reply = Internet::postURL($url, [
|
$reply = Internet::postURL($url, [
|
||||||
"report" => "yes",
|
"report" => "yes",
|
||||||
"name" => $this->getName() . " " . $this->getPocketMineVersion(),
|
"name" => $this->getName() . " " . $this->getPocketMineVersion(),
|
||||||
"email" => "crash@pocketmine.net",
|
"email" => "crash@pocketmine.net",
|
||||||
"reportPaste" => base64_encode($dump->getEncodedData())
|
"reportPaste" => base64_encode($dump->getEncodedData())
|
||||||
]);
|
], 10, [], $postUrlError);
|
||||||
|
|
||||||
if($reply !== false and ($data = json_decode($reply)) !== null and isset($data->crashId) and isset($data->crashUrl)){
|
if($reply !== false and ($data = json_decode($reply)) !== null){
|
||||||
$reportId = $data->crashId;
|
if(isset($data->crashId) and isset($data->crashUrl)){
|
||||||
$reportUrl = $data->crashUrl;
|
$reportId = $data->crashId;
|
||||||
$this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId]));
|
$reportUrl = $data->crashUrl;
|
||||||
|
$this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId]));
|
||||||
|
}elseif(isset($data->error)){
|
||||||
|
$this->logger->emergency("Automatic crash report submission failed: $data->error");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$this->logger->emergency("Failed to communicate with crash archive: $postUrlError");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user