diff options
| author | jermafenser <jermafenserdev@gmail.com> | 2020-12-28 11:05:32 -0500 |
|---|---|---|
| committer | jermafenser <jermafenserdev@gmail.com> | 2020-12-28 11:05:32 -0500 |
| commit | 162636904f4bbc544398f4e3264679cb382c324d (patch) | |
| tree | 0fad6fb37cc6446e0d4ce3472c21b72b8772da65 | |
| parent | 4cd610e2433138c84fbe2f1bbccdc884a013c864 (diff) | |
| download | BedrockConnect-162636904f4bbc544398f4e3264679cb382c324d.tar.gz BedrockConnect-162636904f4bbc544398f4e3264679cb382c324d.tar.bz2 BedrockConnect-162636904f4bbc544398f4e3264679cb382c324d.zip | |
add ability to exclude featured servers from serverlist
3 files changed, 17 insertions, 6 deletions
@@ -62,6 +62,7 @@ The following arguments can be placed in the startup command to ajust settings: | kick_inactive | If true, players will be kicked after 10 minutes of inactivity with the serverlist UI | true | | custom_servers| Sets the path to a custom server file, for specifying your servers in the list for all players. See [custom servers](#defining-your-own-custom-servers). | | | user_servers | If true, players can add and remove servers on the serverlist. If false, the options are hidden. | true | +| featured_servers | If true, the featured servers will be displayed in the serverlist. If false, the servers are hidden. | true | MySQL example: ``` diff --git a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BedrockConnect.java b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BedrockConnect.java index 8b3bcb8..ea7df62 100644 --- a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BedrockConnect.java +++ b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BedrockConnect.java @@ -26,6 +26,7 @@ public class BedrockConnect { public static String customServers = null; public static boolean kickInactive = true; public static boolean userServers = true; + public static boolean featuredServers = true; public static void main(String[] args) { System.out.println("-= BedrockConnect =-"); @@ -110,6 +111,9 @@ public class BedrockConnect { if(str.startsWith("user_servers=")) { userServers = getArgValue(str, "user_servers").toLowerCase().equals("true"); } + if (str.startsWith("featured_servers=")) { + featuredServers = getArgValue(str, "featured_servers").toLowerCase().equals("true"); + } } if(!noDB) diff --git a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/gui/UIForms.java b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/gui/UIForms.java index a62cb78..c7b37ec 100644 --- a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/gui/UIForms.java +++ b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/gui/UIForms.java @@ -17,11 +17,19 @@ public class UIForms { public static int currentForm = 0; public static JsonArray mainMenuButtons = new JsonArray(); + public static JsonArray featuredServerButtons = new JsonArray(); static { mainMenuButtons.add(UIComponents.createButton("Connect to a Server")); mainMenuButtons.add(UIComponents.createButton("Remove a Server")); mainMenuButtons.add(UIComponents.createButton("Exit Server List")); + + featuredServerButtons.add(UIComponents.createButton("The Hive", "https://forum.playhive.com/uploads/default/original/1X/0d05e3240037f7592a0f16b11b57c08eba76f19c.png", "url")); + featuredServerButtons.add(UIComponents.createButton("Mineplex", "https://www.mineplex.com/assets/www-mp/img/footer/footer_smalllogo.png", "url")); + featuredServerButtons.add(UIComponents.createButton("CubeCraft Games", "https://i.imgur.com/aFH1NUr.png", "url")); + featuredServerButtons.add(UIComponents.createButton("Lifeboat Network", "https://lbsg.net/wp-content/uploads/2017/06/lifeboat-square.png", "url")); + featuredServerButtons.add(UIComponents.createButton("Mineville", "https://i.imgur.com/0K4TDut.png", "url")); + featuredServerButtons.add(UIComponents.createButton("Galaxite", "https://i.imgur.com/VxXO8Of.png", "url")); } public static ModalFormRequestPacket createMain(List<String> servers) { @@ -48,12 +56,10 @@ public class UIForms { buttons.add(UIComponents.createButton(cs.getName(), cs.getIconUrl(), "url")); } - buttons.add(UIComponents.createButton("The Hive", "https://forum.playhive.com/uploads/default/original/1X/0d05e3240037f7592a0f16b11b57c08eba76f19c.png", "url")); - buttons.add(UIComponents.createButton("Mineplex", "https://www.mineplex.com/assets/www-mp/img/footer/footer_smalllogo.png", "url")); - buttons.add(UIComponents.createButton("CubeCraft Games", "https://i.imgur.com/aFH1NUr.png", "url")); - buttons.add(UIComponents.createButton("Lifeboat Network", "https://lbsg.net/wp-content/uploads/2017/06/lifeboat-square.png", "url")); - buttons.add(UIComponents.createButton("Mineville", "https://i.imgur.com/0K4TDut.png", "url")); - buttons.add(UIComponents.createButton("Galaxite", "https://i.imgur.com/VxXO8Of.png", "url")); + if(BedrockConnect.featuredServers) { + buttons.addAll(featuredServerButtons); + } + out.add("buttons", buttons); mf.setFormData(out.toString()); |
