diff --git a/src/main/java/me/jaimemartz/lobbybalancer/connection/ProviderType.java b/src/main/java/me/jaimemartz/lobbybalancer/connection/ProviderType.java index 00467e5..b30ddbe 100644 --- a/src/main/java/me/jaimemartz/lobbybalancer/connection/ProviderType.java +++ b/src/main/java/me/jaimemartz/lobbybalancer/connection/ProviderType.java @@ -21,7 +21,7 @@ import java.util.concurrent.ThreadLocalRandom; import static me.jaimemartz.lobbybalancer.LobbyBalancer.getPlayerCount; public enum ProviderType { - NONE(0, "Returns no server (dummy provider)") { + NONE(0, "Returns no server") { @Override public ServerInfo requestTarget(LobbyBalancer plugin, ServerSection section, List list, ProxiedPlayer player) { return null; diff --git a/src/main/java/me/jaimemartz/lobbybalancer/listener/ServerConnectListener.java b/src/main/java/me/jaimemartz/lobbybalancer/listener/ServerConnectListener.java index 0599777..585844b 100644 --- a/src/main/java/me/jaimemartz/lobbybalancer/listener/ServerConnectListener.java +++ b/src/main/java/me/jaimemartz/lobbybalancer/listener/ServerConnectListener.java @@ -4,7 +4,6 @@ import me.jaimemartz.faucet.Messager; import me.jaimemartz.lobbybalancer.LobbyBalancer; import me.jaimemartz.lobbybalancer.configuration.ConfigEntries; import me.jaimemartz.lobbybalancer.connection.ConnectionIntent; -import me.jaimemartz.lobbybalancer.connection.ProviderType; import me.jaimemartz.lobbybalancer.connection.ServerAssignRegistry; import me.jaimemartz.lobbybalancer.manager.PlayerLocker; import me.jaimemartz.lobbybalancer.section.ServerSection; @@ -52,6 +51,10 @@ public class ServerConnectListener implements Listener { } } + if (section.isDummy()) { + return; + } + new ConnectionIntent(plugin, player, section) { @Override public void connect(ServerInfo server) { diff --git a/src/main/java/me/jaimemartz/lobbybalancer/section/ServerSection.java b/src/main/java/me/jaimemartz/lobbybalancer/section/ServerSection.java index 0b79398..e1700dc 100644 --- a/src/main/java/me/jaimemartz/lobbybalancer/section/ServerSection.java +++ b/src/main/java/me/jaimemartz/lobbybalancer/section/ServerSection.java @@ -20,6 +20,7 @@ public class ServerSection { private final String name; private boolean principal; + private boolean dummy; private ServerSection parent; private boolean inherit = false; private List servers; @@ -47,6 +48,8 @@ public class ServerSection { } } + dummy = section.getBoolean("dummy", false); + if (ConfigUtils.isSet(section, "parent")) { parent = manager.getByName(section.getString("parent")); @@ -159,6 +162,10 @@ public class ServerSection { return principal; } + public boolean isDummy() { + return dummy; + } + public ServerSection getParent() { return parent; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 98e8f7a..8491b4d 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -5,7 +5,7 @@ # Remember to set enabled under settings to true # Providers of this plugin -# NONE: Returns no server (dummy provider) +# NONE: Returns no server # DIRECT: Returns the only server in the list # LOCALIZED: Returns the server that matches a region (testing) # LOWEST: Returns the server with the least players online @@ -168,6 +168,12 @@ sections: name: 'playskywars' permission: '' aliases: [] + dummy-section: + provider: RANDOM + dummy: true + parent: 'skywars-lobbies' + section-server: + servers: ["DS1"] practice: provider: LOCALIZED parent: 'general-lobbies'