From 7e01b8796e783465785200cb848899c128275a47 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 5 Oct 2024 11:28:39 -0400 Subject: [PATCH] Moved BE/v8 servers to new repo / Removed experimental Vars --- core/src/mindustry/Vars.java | 9 +++--- .../src/mindustry/editor/MapEditorDialog.java | 15 ++++----- core/src/mindustry/editor/WaveInfoDialog.java | 12 +++---- core/src/mindustry/graphics/FogRenderer.java | 1 - .../ui/dialogs/CustomRulesDialog.java | 17 ++++------ core/src/mindustry/ui/dialogs/JoinDialog.java | 4 +-- .../mindustry/ui/fragments/HudFragment.java | 4 +-- servers_be.json | 32 ------------------- tests/src/test/java/ApplicationTests.java | 2 +- 9 files changed, 26 insertions(+), 70 deletions(-) delete mode 100644 servers_be.json diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 7531b849b3..2eb0e16ca5 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -45,10 +45,10 @@ public class Vars implements Loadable{ public static boolean loadLocales = true; /** Whether the logger is loaded. */ public static boolean loadedLogger = false, loadedFileLogger = false; - /** Whether to enable various experimental features (e.g. spawn positions for spawn groups) TODO change */ - public static boolean experimental = true; /** Name of current Steam player. */ public static String steamPlayerName = ""; + /** If true, the BE server list is always used. */ + public static boolean forceBeServers = false; /** Default accessible content types used for player-selectable icons. */ public static final ContentType[] defaultContentIcons = {ContentType.item, ContentType.liquid, ContentType.block, ContentType.unit}; /** Default rule environment. */ @@ -72,10 +72,9 @@ public class Vars implements Loadable{ /** URL the links to the wiki's modding guide.*/ public static final String modGuideURL = "https://mindustrygame.github.io/wiki/modding/1-modding/"; /** 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"; + public static final String serverJsonBeURL = "https://raw.githubusercontent.com/Anuken/MindustryServerList/master/servers_be.json"; /** URL to the JSON file containing all the stable servers. */ - //TODO merge with v6 list upon release - public static final String serverJsonURL = "https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json"; + public static final String serverJsonURL = "https://raw.githubusercontent.com/Anuken/MindustryServerList/master/servers_v8.json"; /** URL of the github issue report template.*/ public static final String reportIssueURL = "https://github.com/Anuken/Mindustry/issues/new?labels=bug&template=bug_report.md"; /** list of built-in servers.*/ diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index f7af548b61..ad35a4a45f 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -172,21 +172,18 @@ public class MapEditorDialog extends Dialog implements Disposable{ menu.cont.row(); } - //wip feature - if(experimental){ - menu.cont.button("@editor.sectorgenerate", Icon.terrain, () -> { - menu.hide(); - sectorGenDialog.show(); - }).padTop(!steam ? -3 : 1).size(swidth * 2f + 10, 60f); - menu.cont.row(); - } + menu.cont.button("@editor.sectorgenerate", Icon.terrain, () -> { + menu.hide(); + sectorGenDialog.show(); + }).padTop(!steam ? -3 : 1).size(swidth * 2f + 10, 60f); + menu.cont.row(); menu.cont.row(); menu.cont.button("@quit", Icon.exit, () -> { tryExit(); menu.hide(); - }).padTop(!steam && !experimental ? -3 : 1).size(swidth * 2f + 10, 60f); + }).padTop(1).size(swidth * 2f + 10, 60f); resizeDialog = new MapResizeDialog((width, height, shiftX, shiftY) -> { if(!(editor.width() == width && editor.height() == height && shiftX == 0 && shiftY == 0)){ diff --git a/core/src/mindustry/editor/WaveInfoDialog.java b/core/src/mindustry/editor/WaveInfoDialog.java index 818a31844a..a708f7ae2b 100644 --- a/core/src/mindustry/editor/WaveInfoDialog.java +++ b/core/src/mindustry/editor/WaveInfoDialog.java @@ -91,13 +91,11 @@ public class WaveInfoDialog extends BaseDialog{ dialog.show(); }).size(250f, 64f); - if(experimental){ - buttons.button(Core.bundle.get("waves.random"), Icon.refresh, () -> { - groups.clear(); - groups = Waves.generate(1f / 10f); - buildGroups(); - }).width(200f); - } + buttons.button(Core.bundle.get("waves.random"), Icon.refresh, () -> { + groups.clear(); + groups = Waves.generate(1f / 10f); + buildGroups(); + }).width(200f); } void setup(){ diff --git a/core/src/mindustry/graphics/FogRenderer.java b/core/src/mindustry/graphics/FogRenderer.java index da0212bd86..60807ed8cf 100644 --- a/core/src/mindustry/graphics/FogRenderer.java +++ b/core/src/mindustry/graphics/FogRenderer.java @@ -16,7 +16,6 @@ import mindustry.world.meta.*; import static mindustry.Vars.*; -/** Highly experimental fog-of-war renderer. */ public final class FogRenderer{ private FrameBuffer staticFog = new FrameBuffer(), dynamicFog = new FrameBuffer(); private LongSeq events = new LongSeq(); diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index baf69a5526..9c2dd94759 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -224,10 +224,7 @@ public class CustomRulesDialog extends BaseDialog{ check("@rules.airUseSpawns", b -> rules.airUseSpawns = b, () -> rules.airUseSpawns, () -> rules.waves); numberi("@rules.wavelimit", f -> rules.winWave = f, () -> rules.winWave, () -> rules.waves, 0, Integer.MAX_VALUE); number("@rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> rules.waves && rules.waveTimer, 1, Float.MAX_VALUE); - //this is experimental, because it's not clear that 0 makes it default. - if(experimental){ - number("@rules.initialwavespacing", false, f -> rules.initialWaveSpacing = f * 60f, () -> rules.initialWaveSpacing / 60f, () -> rules.waves && rules.waveTimer, 0, Float.MAX_VALUE); - } + number("@rules.initialwavespacing", false, f -> rules.initialWaveSpacing = f * 60f, () -> rules.initialWaveSpacing / 60f, () -> rules.waves && rules.waveTimer, 0, Float.MAX_VALUE); number("@rules.dropzoneradius", false, f -> rules.dropZoneRadius = f * tilesize, () -> rules.dropZoneRadius / tilesize, () -> rules.waves); category("resourcesbuilding"); @@ -292,13 +289,11 @@ public class CustomRulesDialog extends BaseDialog{ check("@rules.fog", b -> rules.fog = b, () -> rules.fog); check("@rules.lighting", b -> rules.lighting = b, () -> rules.lighting); - if(experimental){ - check("@rules.limitarea", b -> rules.limitMapArea = b, () -> rules.limitMapArea); - numberi("x", x -> rules.limitX = x, () -> rules.limitX, () -> rules.limitMapArea, 0, 10000); - numberi("y", y -> rules.limitY = y, () -> rules.limitY, () -> rules.limitMapArea, 0, 10000); - numberi("w", w -> rules.limitWidth = w, () -> rules.limitWidth, () -> rules.limitMapArea, 0, 10000); - numberi("h", h -> rules.limitHeight = h, () -> rules.limitHeight, () -> rules.limitMapArea, 0, 10000); - } + check("@rules.limitarea", b -> rules.limitMapArea = b, () -> rules.limitMapArea); + numberi("x", x -> rules.limitX = x, () -> rules.limitX, () -> rules.limitMapArea, 0, 10000); + numberi("y", y -> rules.limitY = y, () -> rules.limitY, () -> rules.limitMapArea, 0, 10000); + numberi("w", w -> rules.limitWidth = w, () -> rules.limitWidth, () -> rules.limitMapArea, 0, 10000); + numberi("h", h -> rules.limitHeight = h, () -> rules.limitHeight, () -> rules.limitMapArea, 0, 10000); number("@rules.solarmultiplier", f -> rules.solarMultiplier = f, () -> rules.solarMultiplier); diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index e4c8bee716..b0912c7b9c 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -599,7 +599,7 @@ public class JoinDialog extends BaseDialog{ connect(lastIp, lastPort); }, exception -> {}); }, 1, 1); - + ui.loadfrag.setButton(() -> { ui.loadfrag.hide(); if(ping == null) return; @@ -631,7 +631,7 @@ public class JoinDialog extends BaseDialog{ Core.settings.remove("server-list"); } - var url = Version.type.equals("bleeding-edge") ? serverJsonBeURL : serverJsonURL; + var url = Version.type.equals("bleeding-edge") || Vars.forceBeServers ? serverJsonBeURL : serverJsonURL; Log.info("Fetching community servers at @", url); //get servers diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index 91a9c1f8f6..23c6d1a742 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -40,11 +40,11 @@ import static mindustry.gen.Tex.*; public class HudFragment{ private static final float dsize = 65f, pauseHeight = 36f; - public final PlacementFragment blockfrag = new PlacementFragment(); + public PlacementFragment blockfrag = new PlacementFragment(); + public CoreItemsDisplay coreItems = new CoreItemsDisplay(); public boolean shown = true; private ImageButton flip; - private CoreItemsDisplay coreItems = new CoreItemsDisplay(); private String hudText = ""; private boolean showHudText; diff --git a/servers_be.json b/servers_be.json deleted file mode 100644 index 6ba3d25ad2..0000000000 --- a/servers_be.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "name": "Nydus", - "address": ["be.mindustry.nydus.app:6567", "be.mindustry.nydus.app:6568"] - }, - { - "name": "mindustry.pl", - "address": ["130.61.190.181:6567", "130.61.190.181:7777", "0.baseduser.eu.org:7777", "0.baseduser.eu.org:42001"] - }, - { - "address": "v7.mindurka.tk:9999" - }, - { - "name": "Chaotic Neutral", - "address": ["37.187.73.180:7022"] - }, - { - "address": "n1.yeet.ml:6574" - }, - { - "name": "Phoenix-Network", - "address": ["be.phoenix-network.dev"] - }, - { - "name": "Darkdustry", - "address": ["darkdustry.tk"] - }, - { - "name": "TinyLake", - "address": ["cn.mindustry.top:40500"] - } -] diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index 773a91ffa3..4f6c608d19 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -226,7 +226,7 @@ public class ApplicationTests{ @Test void serverListJson(){ - String[] files = {"servers_v6.json", "servers_v7.json", "servers_be.json"}; + String[] files = {"servers_v6.json", "servers_v7.json"}; for(String file : files){