Initial proof-of-concept for crash report server

This commit is contained in:
Anuken
2018-08-29 22:09:55 -04:00
parent db47b9a877
commit 9a41399178
10 changed files with 95 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
package io.anuke.mindustry.desktop;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.game.Version;
import io.anuke.mindustry.net.Net;
import io.anuke.ucore.core.Settings;
@@ -13,7 +14,6 @@ import java.util.Date;
public class CrashHandler{
public static void handle(Throwable e){
//TODO send full error report to server via HTTP
e.printStackTrace();
boolean netActive = false, netServer = false;
@@ -28,7 +28,7 @@ public class CrashHandler{
}
//don't create crash logs for me (anuke), as it's expected
if(System.getProperty("user.name").equals("anuke")) return;
//if(System.getProperty("user.name").equals("anuke")) return;
String header = "--CRASH REPORT--\n";
@@ -50,6 +50,8 @@ public class CrashHandler{
String filename = "";
Net.http(Vars.crashReportURL, "POST", result, r -> {}, Throwable::printStackTrace);
//try to write it
try{
filename = "crash-report-" + new SimpleDateFormat("dd-MM-yy h.mm.ss").format(new Date()) + ".txt";