From cd684996e137b570fc58bacf6349b7d404f35fb1 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 11 Feb 2021 16:31:44 -0500 Subject: [PATCH] Cleanup & Steam crash fix --- core/src/mindustry/Vars.java | 10 +++++----- core/src/mindustry/editor/MapEditorDialog.java | 5 ++++- core/src/mindustry/ui/dialogs/JoinDialog.java | 2 +- core/src/mindustry/world/meta/PowerType.java | 7 ------- desktop/src/mindustry/desktop/DesktopLauncher.java | 1 + 5 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 core/src/mindustry/world/meta/PowerType.java diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 6126bb77a6..ec002b6325 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -38,6 +38,8 @@ public class Vars implements Loadable{ public static boolean loadedLogger = false, loadedFileLogger = false; /** Whether to enable various experimental features (e.g. cliffs) */ public static boolean experimental = false; + /** Name of current Steam player. */ + public static String steamPlayerName = ""; /** Maximum extra padding around deployment schematics. */ public static final int maxLoadoutSchematicPad = 5; /** Maximum schematic size.*/ @@ -54,16 +56,14 @@ public class Vars implements Loadable{ public static final String ghApi = "https://api.github.com"; /** URL for discord invite. */ public static final String discordURL = "https://discord.gg/mindustry"; - /** URL for sending crash reports to */ + /** URL for sending crash reports to. Currently offline. */ public static final String crashReportURL = "http://192.99.169.18/report"; /** 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 global, public servers. Not queried in BE. */ - 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 BE servers. Only queried in the V6 alpha (will be removed once it's out). */ - public static final String serverJsonV6URL = "https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v6.json"; + /** URL to the JSON file containing all the BE servers. */ + public static final String serverJsonURL = "https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v6.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 ba9fe16325..747615a637 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -156,7 +156,10 @@ public class MapEditorDialog extends Dialog implements Disposable{ } platform.publish(map); - }).padTop(-3).size(swidth * 2f + 10, 60f).update(b -> b.setText(editor.tags.containsKey("steamid") ? editor.tags.get("author").equals(player.name) ? "@workshop.listing" : "@view.workshop" : "@editor.publish.workshop")); + }).padTop(-3).size(swidth * 2f + 10, 60f).update(b -> + b.setText(editor.tags.containsKey("steamid") ? + editor.tags.get("author").equals(steamPlayerName) ? "@workshop.listing" : "@view.workshop" : + "@editor.publish.workshop")); menu.cont.row(); } diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index 4f858a67ff..166b4c53a9 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -513,7 +513,7 @@ public class JoinDialog extends BaseDialog{ Core.settings.remove("server-list"); } - var url = becontrol.active() ? serverJsonBeURL : serverJsonV6URL; + var url = becontrol.active() ? serverJsonBeURL : serverJsonURL; Log.info("Fetching community servers at @", url); //get servers diff --git a/core/src/mindustry/world/meta/PowerType.java b/core/src/mindustry/world/meta/PowerType.java deleted file mode 100644 index 3f870ce85a..0000000000 --- a/core/src/mindustry/world/meta/PowerType.java +++ /dev/null @@ -1,7 +0,0 @@ -package mindustry.world.meta; - -public enum PowerType{ - consumer, - producer, - bridge -} diff --git a/desktop/src/mindustry/desktop/DesktopLauncher.java b/desktop/src/mindustry/desktop/DesktopLauncher.java index 8b9d0a7487..cf60813b7b 100644 --- a/desktop/src/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/mindustry/desktop/DesktopLauncher.java @@ -130,6 +130,7 @@ public class DesktopLauncher extends ClientLauncher{ player.name = SVars.net.friends.getPersonaName(); Core.settings.put("name", player.name); } + steamPlayerName = SVars.net.friends.getPersonaName(); //update callbacks Core.app.addListener(new ApplicationListener(){ @Override