Fix permissions and stuff, we are go for master!

This commit is contained in:
md_5 2013-01-22 13:21:04 +11:00
parent a22f57c1f5
commit cae71552cd
4 changed files with 12 additions and 3 deletions

View File

@ -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
{

View File

@ -61,6 +61,11 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer
name = handshake.username;
displayName = handshake.username;
this.loginPackets = loginPackets;
Collection<String> g = ProxyServer.getInstance().getConfigurationAdapter().getGroups(name);
for (String s : g)
{
addGroups(s);
}
}
@Override

View File

@ -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

View File

@ -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<String> getGroups(String player)
{
return get("groups." + player, Collections.singleton("default"));
Collection<String> groups = get("groups." + player, Collections.EMPTY_LIST);
Collection<String> ret = new HashSet<>(groups);
ret.add("default");
return ret;
}
@Override