Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2014-06-25 20:53:39 -07:00
commit 210264f25b

View File

@ -28,7 +28,7 @@ public class Portal extends MiniPlugin
private static Object _transferLock = new Object();
private HashSet<String> _connectingPlayers = new HashSet<String>();
private PortalRepository _repository= new PortalRepository();
private PortalRepository _repository = new PortalRepository();
private List<String> _transfers = new ArrayList<String>();
private boolean _retrieve = true;
@ -94,6 +94,12 @@ public class Portal extends MiniPlugin
}, 20L);
}
private void SendPlayerToServerWithMessage(Player player, String serverName)
{
SendPlayerToServer(player, serverName);
player.sendMessage(ChatColor.YELLOW + "You have been sent to server: " + ChatColor.GOLD + serverName + ChatColor.YELLOW + "!");
}
@EventHandler
public void addTransferDelete(final PlayerQuitEvent event)
{
@ -166,6 +172,7 @@ public class Portal extends MiniPlugin
}
Player player = e.getPlayer();
Rank playerRank = _clientier.Get(player).GetRank();
if (command.equalsIgnoreCase("/server"))
{
@ -173,16 +180,46 @@ public class Portal extends MiniPlugin
if(args.length == 0)
{
player.sendMessage(ChatColor.YELLOW + "You are currently on server: " + Bukkit.getServerName());
player.sendMessage(ChatColor.YELLOW + "You are currently on server: " + ChatColor.GOLD + GetPlugin().getServer().getName() + " " + GetPlugin().getServer().getServerName());
return;
}
else if(args.length == 1)
{
// NEED TO IMPLEMENT OTHER PERMISSION LEVELS!!!
if(_clientier.Get(player).GetRank().Has(Rank.MAPDEV))
String servUp = args[0].toUpperCase();
if(!(servUp.contains("HERO") || servUp.contains("ULTRA") || servUp.contains("BETA")
|| servUp.contains("STAFF") || servUp.contains("TEST")))
{
SendPlayerToServer(player, args[1]);
player.sendMessage(ChatColor.YELLOW + "You have been sent to server: " + args[1] + "!");
SendPlayerToServerWithMessage(player, args[0]);
return;
}
if(servUp.contains("HERO") && ((playerRank == Rank.OWNER)
|| (playerRank == Rank.MAPDEV) || (playerRank == Rank.DEVELOPER) || (playerRank == Rank.YOUTUBE)
|| (playerRank == Rank.ADMIN) || (playerRank == Rank.MODERATOR) || (playerRank == Rank.HELPER)
|| (playerRank == Rank.ULTRA) || (playerRank == Rank.HERO)))
{
SendPlayerToServerWithMessage(player, args[0]);
return;
}
if((servUp.contains("ULTRA") || servUp.contains("BETA")) && ((playerRank == Rank.OWNER)
|| (playerRank == Rank.MAPDEV) || (playerRank == Rank.DEVELOPER) || (playerRank == Rank.YOUTUBE)
|| (playerRank == Rank.ADMIN) || (playerRank == Rank.MODERATOR) || (playerRank == Rank.HELPER)
|| (playerRank == Rank.ULTRA)))
{
SendPlayerToServerWithMessage(player, args[0]);
return;
}
if(servUp.contains("STAFF") && ((playerRank == Rank.OWNER)
|| (playerRank == Rank.MAPDEV) || (playerRank == Rank.DEVELOPER) || (playerRank == Rank.YOUTUBE)
|| (playerRank == Rank.ADMIN) || (playerRank == Rank.MODERATOR) || (playerRank == Rank.HELPER)))
{
SendPlayerToServerWithMessage(player, args[0]);
return;
}
if(servUp.contains("TEST") && ((playerRank == Rank.OWNER)
|| (playerRank == Rank.MAPDEV) || (playerRank == Rank.DEVELOPER) || (playerRank == Rank.YOUTUBE)
|| (playerRank == Rank.ADMIN) || (playerRank == Rank.MODERATOR)))
{
SendPlayerToServerWithMessage(player, args[0]);
return;
}
player.sendMessage(ChatColor.DARK_PURPLE + "Your arrrguments are not allowed for this command!");
@ -201,11 +238,12 @@ public class Portal extends MiniPlugin
if(args.length == 2)
{
// NEED TO ADD OTHER PERMISSION LEVELS!!!
if(_clientier.Get(player).GetRank().Has(Rank.ADMIN))
if((playerRank == Rank.OWNER) || (playerRank == Rank.MAPDEV) || (playerRank == Rank.DEVELOPER)
|| (playerRank == Rank.YOUTUBE) || (playerRank == Rank.ADMIN))
{
// ADD TRANSFER RECORD IN Queue.playerServerTransfer!!!
player.sendMessage(ChatColor.BOLD + "Functionality not implemented, yet...");
Player sendPlayer = _clientier.Get(args[0]).GetPlayer();
SendPlayerToServerWithMessage(sendPlayer, args[1]);
player.sendMessage(ChatColor.YELLOW + "You have sent player: " + ChatColor.GOLD + args[0] + " " + ChatColor.YELLOW + "to server: " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + "!");
return;
}
player.sendMessage(ChatColor.DARK_PURPLE + "Your arrrguments are not allowed for this command!");