summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew <pugmatt@gmail.com>2021-01-11 23:18:26 -0500
committerGitHub <noreply@github.com>2021-01-11 23:18:26 -0500
commite21569a6a94155afd96d007bedc22a0d253d7094 (patch)
treeecab616cc6447025451abf51e1d0962de0c92457
parent32c57ac8a1948acc15a1a50d3b56dce66cd3afab (diff)
parentcc1307fe83d10550eeff60ba76f1f8ee3258c976 (diff)
downloadBedrockConnect-e21569a6a94155afd96d007bedc22a0d253d7094.tar.gz
BedrockConnect-e21569a6a94155afd96d007bedc22a0d253d7094.tar.bz2
BedrockConnect-e21569a6a94155afd96d007bedc22a0d253d7094.zip
Merge pull request #139 from jermafenser/master
Allow featured servers to be excluded
-rw-r--r--README.md1
-rw-r--r--serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BedrockConnect.java4
-rw-r--r--serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/gui/UIForms.java18
3 files changed, 17 insertions, 6 deletions
diff --git a/README.md b/README.md
index 8ba9b18..a22909e 100644
--- a/README.md
+++ b/README.md
@@ -92,6 +92,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 5336869..1bf34e7 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());