diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnection.java b/proxy/src/main/java/net/md_5/bungee/ServerConnection.java index 57994e55..54db34e3 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnection.java @@ -9,6 +9,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; import javax.crypto.SecretKey; import lombok.Getter; import net.md_5.bungee.api.Callback; +import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ServerPing; import net.md_5.bungee.api.config.ServerInfo; @@ -101,6 +102,7 @@ public class ServerConnection extends GenericConnection implements Server ServerInfo def = ProxyServer.getInstance().getServers().get(user.getPendingConnection().getListener().getDefaultServer()); if (retry && !info.equals(def)) { + user.sendMessage(ChatColor.RED + "Could not connect to target server, you have been moved to the default server"); return connect(user, def, handshake, false); } else { diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 5b893456..32a2c154 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -61,6 +61,11 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer name = handshake.username; displayName = handshake.username; this.loginPackets = loginPackets; + Collection g = ProxyServer.getInstance().getConfigurationAdapter().getGroups(name); + for (String s : g) + { + addGroups(s); + } } @Override diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java b/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java index 29d5e5ec..1c518efc 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java @@ -44,7 +44,7 @@ public class CommandServer extends Command if (server == null) { player.sendMessage(ChatColor.RED + "The specified server does not exist"); - } else if (server == player.getServer()) + } else if (server.equals(player.getServer().getInfo())) { player.sendMessage(ChatColor.RED + "You are already on this server."); } else diff --git a/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java index d288ee80..a3da837e 100644 --- a/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/config/YamlConfig.java @@ -11,7 +11,6 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.LinkedHashMap; import java.util.Map; import java.util.logging.Level; import net.md_5.bungee.Util; @@ -191,7 +190,10 @@ public class YamlConfig implements ConfigurationAdapter @SuppressWarnings("unchecked") public Collection getGroups(String player) { - return get("groups." + player, Collections.singleton("default")); + Collection groups = get("groups." + player, Collections.EMPTY_LIST); + Collection ret = new HashSet<>(groups); + ret.add("default"); + return ret; } @Override