arc.util.Http migration

This commit is contained in:
Anuken
2021-07-07 19:00:32 -04:00
parent 02b42c51da
commit 2ae7863cae
7 changed files with 112 additions and 174 deletions

View File

@@ -1,7 +1,6 @@
package mindustry.net;
import arc.*;
import arc.Net.*;
import arc.files.*;
import arc.func.*;
import arc.struct.*;
@@ -150,12 +149,12 @@ public class CrashSender{
Log.info("Sending crash report.");
//post to crash report URL, exit code indicates send success
new arc.Net().http(new HttpRequest().block(true).method(HttpMethod.POST).content(value.toJson(OutputType.json)).url(Vars.crashReportURL), r -> {
Log.info("Crash sent successfully.");
System.exit(1);
}, t -> {
Http.post(Vars.crashReportURL, value.toJson(OutputType.json)).error(t -> {
Log.info("Crash report not sent.");
System.exit(-1);
}).block(r -> {
Log.info("Crash sent successfully.");
System.exit(1);
});
ret();