From ff578c8540933828f1c0c59e2c5e831f873a40c4 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Tue, 28 Jan 2020 14:31:32 +0100 Subject: [PATCH] Repurpose branch to be played MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When anuke shows more interest in this branch the changes that stem from this can be reversed and squashed, but people want to play it, and keeping 2 crater related branches in sync is frankly a pain 😗 --- core/src/mindustry/Vars.java | 2 ++ core/src/mindustry/ui/dialogs/JoinDialog.java | 2 +- servers_crater.json | 5 ++++ tools/crater-deploy.sh | 30 +++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 servers_crater.json create mode 100755 tools/crater-deploy.sh diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index ab88d572bf..58bdefbfe1 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -59,6 +59,8 @@ public class Vars implements Loadable{ public static final String serverJsonURL = "https://raw.githubusercontent.com/Anuken/Mindustry/master/servers.json"; /** URL to the JSON file containing all the BE servers. Only queried in BE. */ public static final String serverJsonBeURL = "https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_be.json"; + /** URL to the JSON file containing all the crater servers. */ + public static final String serverJsonCraterURL = "https://raw.githubusercontent.com/Quezler/Mindustry/craters/servers_crater.json"; /** URL of the github issue report template.*/ public static final String reportIssueURL = "https://github.com/Anuken/Mindustry/issues/new?template=bug_report.md"; /** list of built-in servers.*/ diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index 429b27f5fb..316c4d7e1f 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -376,7 +376,7 @@ public class JoinDialog extends FloatingDialog{ servers = Core.settings.getObject("server-list", Array.class, Array::new); //get servers - Core.net.httpGet(becontrol.active() ? serverJsonBeURL : serverJsonURL, result -> { + Core.net.httpGet(serverJsonCraterURL, result -> { try{ Jval val = Jval.read(result.getResultAsString()); Core.app.post(() -> { diff --git a/servers_crater.json b/servers_crater.json new file mode 100644 index 0000000000..32faccac11 --- /dev/null +++ b/servers_crater.json @@ -0,0 +1,5 @@ +[ + { + "address": "mindustry.nydus.app:6565" + } +] diff --git a/tools/crater-deploy.sh b/tools/crater-deploy.sh new file mode 100755 index 0000000000..7b270cf783 --- /dev/null +++ b/tools/crater-deploy.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +behind=$(git rev-list --right-only --count master...crater) # https://stackoverflow.com/a/27940027/6056864 + +echo "sdk.dir=/Users/quezler/Library/Android/sdk" > local.properties +sed -i'.original' 's/applicationId "io.anuke.mindustry"/applicationId "io.anuke.mindustry.craters"/g' android/build.gradle +sed -i'.original' 's/"io.anuke.mindustry"/"io.anuke.mindustry.craters"/g' android/AndroidManifest.xml +sed -i'.original' 's/Mindustry