diff --git a/core/src/io/anuke/mindustry/net/CrashSender.java b/core/src/io/anuke/mindustry/net/CrashSender.java index 44a57ea8ac..f7370b629d 100644 --- a/core/src/io/anuke/mindustry/net/CrashSender.java +++ b/core/src/io/anuke/mindustry/net/CrashSender.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.net; import io.anuke.arc.*; +import io.anuke.arc.Net.*; import io.anuke.arc.collection.*; import io.anuke.arc.function.*; import io.anuke.arc.util.*; @@ -103,7 +104,7 @@ public class CrashSender{ Log.info("Sending crash report."); //post to crash report URL - Core.net.httpPost(Vars.crashReportURL, value.toJson(OutputType.json), r -> { + httpPost(Vars.crashReportURL, value.toJson(OutputType.json), r -> { Log.info("Crash sent successfully."); sent[0] = true; System.exit(1); @@ -126,6 +127,10 @@ public class CrashSender{ } } + private static void httpPost(String url, String content, Consumer success, Consumer failure){ + new NetJavaImpl().http(new HttpRequest().method(HttpMethod.POST).content(content).url(url), success, failure); + } + private static String parseException(Throwable e){ StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw);