Fixes for servers.
This commit is contained in:
parent
6c0666c59b
commit
37b779f108
@ -589,8 +589,8 @@ public class ServerManager extends MiniPlugin
|
||||
if (serverList == null) return null;
|
||||
|
||||
List<ServerInfo> servers = new ArrayList<ServerInfo>(serverList);
|
||||
Collections.sort(servers, new ServerCountSorter());
|
||||
servers = fetchOpenServers(player, servers, servers.size()); // Removes all full servers from list
|
||||
Collections.sort(servers, new ServerCountSorter());
|
||||
|
||||
int count = Math.min(servers.size(), TOP_SERVERS);
|
||||
|
||||
@ -600,10 +600,12 @@ public class ServerManager extends MiniPlugin
|
||||
|
||||
if (largestServer.getAvailableSlots() >= MIN_SLOTS_REQUIRED || largestServer.MaxPlayers > 40)
|
||||
{
|
||||
System.out.println("Largest.");
|
||||
return largestServer;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("Random.");
|
||||
return servers.get(random.nextInt(count));
|
||||
}
|
||||
}
|
||||
@ -689,13 +691,9 @@ public class ServerManager extends MiniPlugin
|
||||
for (ServerGroup serverGroup : mineplex.serverdata.servers.ServerManager.getServerRepository(region).getServerGroups(null))
|
||||
{
|
||||
addServerGroup(serverGroup);
|
||||
System.out.println("Adding servergroup : " + serverGroup.getName() + " prefix:" + serverGroup.getPrefix());
|
||||
|
||||
if (!serverGroup.getServerNpcName().isEmpty())
|
||||
{
|
||||
AddServerNpc(serverGroup);
|
||||
System.out.println("Adding to npcs");
|
||||
}
|
||||
|
||||
if (!serverGroup.getPortalBottomCornerLocation().isEmpty() && !serverGroup.getPortalTopCornerLocation().isEmpty())
|
||||
{
|
||||
|
@ -8,6 +8,6 @@ public class ServerCountSorter implements Comparator<ServerInfo>
|
||||
{
|
||||
public int compare(ServerInfo a, ServerInfo b)
|
||||
{
|
||||
return a.CurrentPlayers - b.CurrentPlayers;
|
||||
return b.CurrentPlayers - a.CurrentPlayers;
|
||||
}
|
||||
}
|
@ -52,23 +52,6 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
/*
|
||||
setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Solo " + C.cGray + getName(), new String[]
|
||||
{
|
||||
ChatColor.RESET + "Solo Mode",
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Click to play!",
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Teaming in Solo Mode is bannable!",
|
||||
}));
|
||||
|
||||
setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL.getId(), (byte)0, 2, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Team " + C.cGray + getName(), new String[]
|
||||
{
|
||||
ChatColor.RESET + "Team Mode",
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Click to play!"
|
||||
}));
|
||||
*/
|
||||
List<ServerInfo> serverList = new ArrayList<ServerInfo>(getPlugin().GetServerList(_serverNpcKey));
|
||||
|
||||
int slotsNeeded = 1;
|
||||
|
@ -48,8 +48,6 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
String name = _serverGroup.getName();
|
||||
|
||||
String friendlyName = _serverGroup.getServerNpcName();
|
||||
|
||||
setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 1, ChatColor.RESET + C.cYellow + "Solo " + friendlyName, new String[]
|
||||
|
Loading…
Reference in New Issue
Block a user