Repurpose branch to be played

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 😗
This commit is contained in:
Patrick 'Quezler' Mounier 2020-01-28 14:31:32 +01:00
parent 445126ea65
commit ff578c8540
No known key found for this signature in database
GPG Key ID: 0D6CA7326C76D8EA
4 changed files with 38 additions and 1 deletions

View File

@ -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.*/

View File

@ -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(() -> {

5
servers_crater.json Normal file
View File

@ -0,0 +1,5 @@
[
{
"address": "mindustry.nydus.app:6565"
}
]

30
tools/crater-deploy.sh Executable file
View File

@ -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</Mindustry Craters</g' android/res/values/strings.xml
rm android/build.gradle.original
rm android/AndroidManifest.xml.original
rm android/res/values/strings.xml.original
./gradlew desktop:dist -Pbuildversion=$behind -PversionType=craters
./gradlew server:dist -Pbuildversion=$behind -PversionType=craters
./gradlew android:assembleDebug -Pbuildversion=$behind -PversionType=craters
git checkout -- "android/build.gradle"
git checkout -- "android/AndroidManifest.xml"
git checkout -- "android/res/values/strings.xml"
mkdir ./.gradle/craters
mv desktop/build/libs/Mindustry.jar ./.gradle/craters/Mindustry-Craters-Desktop-${behind}.jar
mv server/build/libs/server-release.jar ./.gradle/craters/Mindustry-Craters-Server-${behind}.jar
mv android/build/outputs/apk/debug/android-debug.apk ./.gradle/craters/Mindustry-Craters-Android-${behind}.apk
scp -r ./.gradle/craters root@mindustry.nydus.app:/var/www/html
scp ./.gradle/craters/Mindustry-Craters-Server-${behind}.jar root@mindustry.nydus.app:/root/crater/Mindustry-Craters-Server.jar