diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClient.java b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClient.java index 46416bd1e..64dcdbccf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClient.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClient.java @@ -115,6 +115,10 @@ public class CoreClient public void setPrimaryGroup(PermissionGroup group) { + if (group != null && !group.canBePrimary()) + { + return; + } if (_primary != null) { _lastPrimary = _primary; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/permissions/PermissionManager.java b/Plugins/Mineplex.Core/src/mineplex/core/account/permissions/PermissionManager.java index bb445f734..54f73bfd6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/permissions/PermissionManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/permissions/PermissionManager.java @@ -98,7 +98,11 @@ public class PermissionManager extends MiniPlugin createPermissionGroup(new PermissionGroup("owner", "Owner", "Owners are the core managers of Mineplex. \nEach owner manages a different aspect of the \nserver and ensures its efficient operation.", ChatColor.DARK_RED, 55, true, "lt")); //SUB-GROUPS + createPermissionGroup(new PermissionGroup("qam", "", "Managers of the Quality Assurance team.", ChatColor.WHITE, 50, false, "qa")); + createPermissionGroup(new PermissionGroup("qa", "", "Members of the Quality Assurance team.", ChatColor.WHITE, 50, false)); createPermissionGroup(new PermissionGroup("cmod", "", "Members of the Clans Management team.", ChatColor.WHITE, 32, false)); + createPermissionGroup(new PermissionGroup("tm", "", "Members of the Trainee Management team.", ChatColor.WHITE, 52, false)); + createPermissionGroup(new PermissionGroup("mc", "", "Members of the Moderator Coordination team.", ChatColor.WHITE, 49, false)); createPermissionGroup(new PermissionGroup("eventmod", "", "Members of the Event Management team.", ChatColor.WHITE, -1, false)); createPermissionGroup(new PermissionGroup("cma", "", "Members of the Clans Management Assistance team.", ChatColor.WHITE, -1, false)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 75a9e9636..156cfdd50 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -214,6 +214,8 @@ public class AntiHack extends MiniPlugin } pm.setPermission(pm.getGroup("dev"), GroupPermission.of(DETAILED_MESSAGES_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("dev"), GroupPermission.of(GET_VLS_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(DETAILED_MESSAGES_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(GET_VLS_COMMAND_PERMISSION), true, true); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/logging/AntihackLogger.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/logging/AntihackLogger.java index 52d4ae275..03c20d6cc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/logging/AntihackLogger.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/logging/AntihackLogger.java @@ -67,7 +67,7 @@ public class AntihackLogger extends MiniPlugin private void generatePermissions() { PermissionManager pm = _clientManager.getPermissionManager(); - pm.setPermission(pm.getGroup("srmod"), GroupPermission.of(SAVE_METADATA_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(SAVE_METADATA_COMMAND_PERMISSION), true, true); } public void addCommands() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java index 963cfac73..fc1b9e6d9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java @@ -22,6 +22,7 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayerBase; +import mineplex.core.common.util.UtilServer; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketHandler; import mineplex.core.packethandler.PacketInfo; @@ -85,6 +86,10 @@ public class CommandCenter implements Listener, IPacketHandler ClientManager = clientManager; clientManager.getPermissionManager().setPermission(clientManager.getPermissionManager().getGroup("dev"), GroupPermission.of(BLOCKED_COMMAND_PERMISSION), true, true); + if (UtilServer.isTestServer()) + { + clientManager.getPermissionManager().setPermission(clientManager.getPermissionManager().getGroup("qam"), GroupPermission.of(BLOCKED_COMMAND_PERMISSION), false, true); + } } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/playerdisguise/PlayerDisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/playerdisguise/PlayerDisguiseManager.java index 274c76c69..22f2c2662 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/playerdisguise/PlayerDisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/playerdisguise/PlayerDisguiseManager.java @@ -155,6 +155,8 @@ public class PlayerDisguiseManager extends MiniPlugin implements IPacketHandler { PermissionManager pm = _clients.getPermissionManager(); + pm.setPermission(pm.getGroup("tm"), GroupPermission.of(USE_DISGUISE_PERMISSION), false, true); + pm.setPermission(pm.getGroup("mc"), GroupPermission.of(USE_DISGUISE_PERMISSION), false, true); pm.setPermission(pm.getGroup("content"), GroupPermission.of(USE_DISGUISE_PERMISSION), true, true); pm.setPermission(pm.getGroup("content"), GroupPermission.of(BLOCKED_DISGUISE_PERMISSION), true, true); pm.setPermission(pm.getGroup("builder"), GroupPermission.of(BLOCKED_DISGUISE_PERMISSION), true, true); @@ -164,7 +166,7 @@ public class PlayerDisguiseManager extends MiniPlugin implements IPacketHandler @Override public void addCommands() { - this.addCommand(new DisguiseCommand(this)); + addCommand(new DisguiseCommand(this)); } @EventHandler(priority = EventPriority.MONITOR) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 825be43a7..d25ce5042 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -379,8 +379,8 @@ public class GadgetManager extends MiniPlugin pm.setPermission(pm.getGroup("admin"), GroupPermission.of(LOCK_INFUSED_COMMAND_PERMISSION), true, true); if (UtilServer.isTestServer()) { - pm.setPermission(pm.getGroup("srmod"), GroupPermission.of(LOCK_COSMETICS_COMMAND_PERMISSION), true, true); - pm.setPermission(pm.getGroup("srmod"), GroupPermission.of(UNLOCK_COSMETICS_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(LOCK_COSMETICS_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(UNLOCK_COSMETICS_COMMAND_PERMISSION), true, true); } else { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/give/Give.java b/Plugins/Mineplex.Core/src/mineplex/core/give/Give.java index 64912f153..7146232b6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/give/Give.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/give/Give.java @@ -41,6 +41,10 @@ public class Give extends MiniPlugin PermissionManager pm = Managers.get(CoreClientManager.class).getPermissionManager(); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(GIVE_COMMAND_PERMISSION), true, true); + if (UtilServer.isTestServer()) + { + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(GIVE_COMMAND_PERMISSION), true, true); + } } public static void Initialize(JavaPlugin plugin) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java index 1c4e0a281..210290961 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java @@ -49,7 +49,8 @@ public class LagMeter extends MiniPlugin { PermissionManager pm = _clientManager.getPermissionManager(); - pm.setPermission(pm.getGroup("dev"), GroupPermission.of(VERSIONS_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("admin"), GroupPermission.of(VERSIONS_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(VERSIONS_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("mod"), GroupPermission.of(LAG_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("mod"), GroupPermission.of(MONITOR_COMMAND_PERMISSION), true, true); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/quests/QuestManager.java b/Plugins/Mineplex.Core/src/mineplex/core/quests/QuestManager.java index 61c78d994..e31644f82 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/quests/QuestManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/quests/QuestManager.java @@ -119,6 +119,7 @@ public class QuestManager extends MiniDbClientPlugin PermissionManager pm = getClientManager().getPermissionManager(); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(GET_QUEST_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(GET_QUEST_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(INCREMENT_QUEST_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("player"), GroupPermission.of(QUEST_GUI_COMMAND_PERMISSION), true, true); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java index 10baf4d8c..bc0c60fb4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java @@ -1,8 +1,10 @@ package mineplex.core.teleport; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.Map; +import java.util.Set; import java.util.UUID; import org.bukkit.Bukkit; @@ -16,6 +18,7 @@ import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClientManager; import mineplex.core.account.event.ClientUnloadEvent; import mineplex.core.account.permissions.GroupPermission; +import mineplex.core.account.permissions.PermissionGroup; import mineplex.core.account.permissions.PermissionManager; import mineplex.core.common.jsonchat.ChildJsonMessage; import mineplex.core.common.jsonchat.ClickEvent; @@ -28,8 +31,12 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilWorld; import mineplex.core.teleport.command.LocateCommand; +import mineplex.core.teleport.command.ModLocateCommand; import mineplex.core.teleport.command.TeleportCommand; +import mineplex.core.teleport.command.TraineeLocateCommand; import mineplex.core.teleport.event.MineplexTeleportEvent; +import mineplex.core.teleport.redis.RankLocate; +import mineplex.core.teleport.redis.RankLocateCallback; import mineplex.core.teleport.redis.RedisLocate; import mineplex.core.teleport.redis.RedisLocateCallback; import mineplex.core.updater.UpdateType; @@ -39,12 +46,15 @@ import mineplex.serverdata.commands.ServerCommandManager; public class Teleport extends MiniPlugin { public static final String FIND_COMMAND_PERMISSION = "mineplex.core.teleport.find"; + public static final String FIND_MOD_COMMAND_PERMISSION = "mineplex.core.teleport.find.mod"; + public static final String FIND_TRAINEE_COMMAND_PERMISSION = "mineplex.core.teleport.find.trainee"; public static final String TELEPORT_COMMAND_PERMISSION = "mineplex.core.teleport.teleport"; public static final String TELEPORT_LOCATION_COMMAND_PERMISSION = "mineplex.core.teleport.teleport.location"; public static final String TELEPORT_OTHER_COMMAND_PERMISSION = "mineplex.core.teleport.teleport.other"; public static final String TELEPORT_ALL_COMMAND_PERMISSION = "mineplex.core.teleport.teleport.all"; private Map _failedRedisLocates = new HashMap<>(); + private Map _failedRankLocates = new HashMap<>(); private LinkedList teleportList = new LinkedList<>(); private Map> _tpHistory = new HashMap<>(); @@ -57,38 +67,92 @@ public class Teleport extends MiniPlugin _serverName = getPlugin().getConfig().getString("serverstatus.name"); _clientManager = clientManager; - + + ServerCommandManager.getInstance().registerCommandType(RankLocate.class, command -> + { + runSync(() -> + { + PermissionGroup group = _clientManager.getPermissionManager().getGroup(command.getRankIdentifier()); + Set on = new HashSet<>(); + for (Player online : Bukkit.getOnlinePlayers()) + { + if (_clientManager.Get(online).getPrimaryGroup().equals(group)) + { + on.add(online.getName()); + } + } + if (!on.isEmpty()) + { + new RankLocateCallback(command, _serverName, on).publish(); + } + }); + }); + ServerCommandManager.getInstance().registerCommandType(RankLocateCallback.class, command -> + { + runSync(() -> + { + Player p = Bukkit.getPlayer(command.getUUID()); + + Integer taskId = _failedRankLocates.remove(command.getUUID()); + if (taskId != null) + { + getScheduler().cancelTask(taskId.intValue()); + UtilPlayer.message(p, F.main("Locate", "All Online:")); + } + + if (p == null) + { + return; + } + + UtilPlayer.message(p, C.cBlue + "- " + C.cGray + command.getServerName()); + for (String on : command.getOnline()) + { + ChildJsonMessage message = new JsonMessage("").extra(C.cGold + " - " + C.cYellow + on); + message.click(ClickEvent.RUN_COMMAND, "/server " + command.getServerName()); + message.hover(HoverEvent.SHOW_TEXT, "Teleport to " + command.getServerName()); + + message.sendToPlayer(p); + } + }); + }); ServerCommandManager.getInstance().registerCommandType("RedisLocate", RedisLocate.class, command -> { - Player target = Bukkit.getPlayerExact(command.getTarget()); - if (target != null) + runSync(() -> { - RedisLocateCallback callback = new RedisLocateCallback(command, _serverName, target.getName()); - callback.publish(); - } + Player target = Bukkit.getPlayerExact(command.getTarget()); + if (target != null) + { + RedisLocateCallback callback = new RedisLocateCallback(command, _serverName, target.getName()); + callback.publish(); + } + }); }); ServerCommandManager.getInstance().registerCommandType("RedisLocateCallback", RedisLocateCallback.class, callback -> { - Integer taskId = _failedRedisLocates.remove(callback.getUUID()); - if (taskId != null) + runSync(() -> { - getScheduler().cancelTask(taskId); - } - - Player player = Bukkit.getPlayer(callback.getReceivingPlayerId()); - - if (player != null) - { - ChildJsonMessage message = new JsonMessage("").extra(C.mHead + "Locate" + "> " + C.mBody + "Located [" + C.mElem - + callback.getLocatedPlayer() + C.mBody + "] at "); - - message.add(C.cBlue + callback.getServer()).click(ClickEvent.RUN_COMMAND, - "/server " + callback.getServer()); - - message.hover(HoverEvent.SHOW_TEXT, "Teleport to " + callback.getServer()); - - message.sendToPlayer(player); - } + Integer taskId = _failedRedisLocates.remove(callback.getUUID()); + if (taskId != null) + { + getScheduler().cancelTask(taskId.intValue()); + } + + Player player = Bukkit.getPlayer(callback.getReceivingPlayerId()); + + if (player != null) + { + ChildJsonMessage message = new JsonMessage("").extra(C.mHead + "Locate" + "> " + C.mBody + "Located [" + C.mElem + + callback.getLocatedPlayer() + C.mBody + "] at "); + + message.add(C.cBlue + callback.getServer()).click(ClickEvent.RUN_COMMAND, + "/server " + callback.getServer()); + + message.hover(HoverEvent.SHOW_TEXT, "Teleport to " + callback.getServer()); + + message.sendToPlayer(player); + } + }); }); generatePermissions(); @@ -99,6 +163,10 @@ public class Teleport extends MiniPlugin PermissionManager pm = _clientManager.getPermissionManager(); pm.setPermission(pm.getGroup("trainee"), GroupPermission.of(FIND_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("mc"), GroupPermission.of(FIND_MOD_COMMAND_PERMISSION), false, true); + pm.setPermission(pm.getGroup("admin"), GroupPermission.of(FIND_MOD_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("tm"), GroupPermission.of(FIND_TRAINEE_COMMAND_PERMISSION), false, true); + pm.setPermission(pm.getGroup("admin"), GroupPermission.of(FIND_TRAINEE_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("mod"), GroupPermission.of(TELEPORT_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(TELEPORT_LOCATION_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(TELEPORT_OTHER_COMMAND_PERMISSION), true, true); @@ -110,6 +178,8 @@ public class Teleport extends MiniPlugin { addCommand(new TeleportCommand(this)); addCommand(new LocateCommand(this)); + addCommand(new ModLocateCommand(this)); + addCommand(new TraineeLocateCommand(this)); } public void locatePlayer(final Player player, final String target) @@ -131,7 +201,26 @@ public class Teleport extends MiniPlugin UtilPlayer.message(player, F.main("Locate", C.mBody + "Failed to locate [" + C.mElem + target + C.mBody + "].")); }, 40L).getTaskId(); - _failedRedisLocates.put(locate.getUUID(), id); + _failedRedisLocates.put(locate.getUUID(), Integer.valueOf(id)); + } + + public void locateRank(final Player sender, final PermissionGroup group) + { + if (group == null) + { + UtilPlayer.message(sender, F.main("Locate", "That group does not exist!")); + return; + } + + RankLocate locate = new RankLocate(_serverName, sender.getName(), sender.getUniqueId(), group.getIdentifier()); + locate.publish(); + int id = getScheduler().runTaskLater(_plugin, () -> + { + _failedRankLocates.remove(locate.getUUID()); + UtilPlayer.message(sender, F.main("Locate", "There are no members of that group online!")); + }, 60L).getTaskId(); + + _failedRankLocates.put(locate.getUUID(), Integer.valueOf(id)); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/ModLocateCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/ModLocateCommand.java new file mode 100644 index 000000000..c2642c5f3 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/ModLocateCommand.java @@ -0,0 +1,20 @@ +package mineplex.core.teleport.command; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.teleport.Teleport; + +public class ModLocateCommand extends CommandBase +{ + public ModLocateCommand(Teleport plugin) + { + super(plugin, Teleport.FIND_MOD_COMMAND_PERMISSION, "mlocate", "mwhere", "mfind"); + } + + @Override + public void Execute(Player caller, String[] args) + { + Plugin.locateRank(caller, Plugin.getClientManager().getPermissionManager().getGroup("mod")); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/TraineeLocateCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/TraineeLocateCommand.java new file mode 100644 index 000000000..083e26889 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/TraineeLocateCommand.java @@ -0,0 +1,20 @@ +package mineplex.core.teleport.command; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.teleport.Teleport; + +public class TraineeLocateCommand extends CommandBase +{ + public TraineeLocateCommand(Teleport plugin) + { + super(plugin, Teleport.FIND_TRAINEE_COMMAND_PERMISSION, "tlocate", "twhere", "tfind"); + } + + @Override + public void Execute(Player caller, String[] args) + { + Plugin.locateRank(caller, Plugin.getClientManager().getPermissionManager().getGroup("trainee")); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/redis/RankLocate.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/redis/RankLocate.java new file mode 100644 index 000000000..299039e9d --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/redis/RankLocate.java @@ -0,0 +1,48 @@ +package mineplex.core.teleport.redis; + +import java.util.UUID; + +import mineplex.serverdata.commands.ServerCommand; + +public class RankLocate extends ServerCommand +{ + private final String _sendingServer; + private final String _senderName; + private final UUID _senderUUID; + private final UUID _uuid; + private final String _rankIdentifier; + + public RankLocate(String sendingServer, String senderName, UUID senderUUID, String rankIdentifier) + { + _sendingServer = sendingServer; + _senderName = senderName; + _senderUUID = senderUUID; + _uuid = UUID.randomUUID(); + _rankIdentifier = rankIdentifier; + } + + public String getSendingServer() + { + return _sendingServer; + } + + public String getSenderName() + { + return _senderName; + } + + public UUID getSenderUUID() + { + return _senderUUID; + } + + public UUID getUUID() + { + return _uuid; + } + + public String getRankIdentifier() + { + return _rankIdentifier; + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/redis/RankLocateCallback.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/redis/RankLocateCallback.java new file mode 100644 index 000000000..5720ffece --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/redis/RankLocateCallback.java @@ -0,0 +1,45 @@ +package mineplex.core.teleport.redis; + +import java.util.Set; +import java.util.UUID; + +import mineplex.serverdata.commands.ServerCommand; + +public class RankLocateCallback extends ServerCommand +{ + private String _serverName; + private Set _online; + private UUID _receivingPlayerUUID; + + private UUID _uuid; + + public RankLocateCallback(RankLocate command, String serverName, Set online) + { + _uuid = command.getUUID(); + _receivingPlayerUUID = command.getSenderUUID(); + _online = online; + _serverName = serverName; + + setTargetServers(command.getSendingServer()); + } + + public Set getOnline() + { + return _online; + } + + public String getServerName() + { + return _serverName; + } + + public UUID getReceivingPlayerUUID() + { + return _receivingPlayerUUID; + } + + public UUID getUUID() + { + return _uuid; + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/thereallyoldscoreboardapiweshouldremove/PlayerScoreboard.java b/Plugins/Mineplex.Core/src/mineplex/core/thereallyoldscoreboardapiweshouldremove/PlayerScoreboard.java index c6b4f5d7c..5914f891a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/thereallyoldscoreboardapiweshouldremove/PlayerScoreboard.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/thereallyoldscoreboardapiweshouldremove/PlayerScoreboard.java @@ -38,6 +38,10 @@ public class PlayerScoreboard for (PermissionGroup group : _manager.getClients().getPermissionManager().getGroups()) { + if (!group.canBePrimary()) + { + continue; + } if (!group.getDisplay(false, false, false, false).isEmpty()) { _scoreboard.registerNewTeam(group.getIdentifier()).setPrefix(group.getDisplay(true, true, true, false) + ChatColor.RESET + " "); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/updater/FileUpdater.java b/Plugins/Mineplex.Core/src/mineplex/core/updater/FileUpdater.java index 5685d5b9d..814279a15 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/updater/FileUpdater.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/updater/FileUpdater.java @@ -80,6 +80,7 @@ public class FileUpdater extends MiniPlugin pm.setPermission(pm.getGroup("mod"), GroupPermission.of(BVERSION_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(RESTART_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qam"), GroupPermission.of(RESTART_COMMAND_PERMISSION), false, true); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index 3c81e7998..bebd7ead1 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -507,7 +507,11 @@ public class ClansManager extends MiniClientPlugin implements IRelat pm.setPermission(pm.getGroup("cmod"), GroupPermission.of(SPEED_COMMAND_PERMISSION), false, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(SPEED_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(FORCE_JOIN_COMMAND_PERMISSION), true, true); - pm.setPermission(pm.getGroup("dev"), GroupPermission.of(AUTO_OP_PERMISSION), true, true); + pm.setPermission(pm.getGroup("admin"), GroupPermission.of(AUTO_OP_PERMISSION), true, true); + if (UtilServer.isTestServer()) + { + pm.setPermission(pm.getGroup("qam"), GroupPermission.of(AUTO_OP_PERMISSION), false, true); + } pm.setPermission(pm.getGroup("content"), GroupPermission.of(PREFIX_SHOWN_PERMISSION), true, true); pm.setPermission(pm.getGroup("content"), GroupPermission.of(JOIN_FULL_PERMISSION), true, true); pm.setPermission(pm.getGroup("builder"), GroupPermission.of(PREFIX_SHOWN_PERMISSION), true, true); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/restart/RestartManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/restart/RestartManager.java index cf73ef3c7..f4f73ea66 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/restart/RestartManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/restart/RestartManager.java @@ -83,6 +83,7 @@ public class RestartManager extends MiniPlugin PermissionManager pm = Managers.get(CoreClientManager.class).getPermissionManager(); pm.setPermission(pm.getGroup("cmod"), GroupPermission.of(RESTART_COMMAND_PERMISSION), false, true); + pm.setPermission(pm.getGroup("qam"), GroupPermission.of(RESTART_COMMAND_PERMISSION), false, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(RESTART_COMMAND_PERMISSION), true, true); } diff --git a/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java b/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java index 3033ddecb..cba2f1698 100644 --- a/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java +++ b/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java @@ -283,6 +283,10 @@ public class HubManager extends MiniPlugin implements IChatMessageFormatter { for (PermissionGroup group : _clientManager.getPermissionManager().getGroups()) { + if (!group.canBePrimary()) + { + continue; + } if (!group.getDisplay(false, false, false, false).isEmpty()) { scoreboard.getHandle().registerNewTeam(group.getIdentifier()).setPrefix(group.getDisplay(true, true, true, false) + ChatColor.RESET + " "); @@ -403,6 +407,10 @@ public class HubManager extends MiniPlugin implements IChatMessageFormatter pm.setPermission(pm.getGroup("admin"), GroupPermission.of(GADGET_TOGGLE_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(GAMEMODE_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(AUTO_OP_PERMISSION), true, true); + if (UtilServer.isTestServer()) + { + pm.setPermission(pm.getGroup("qam"), GroupPermission.of(AUTO_OP_PERMISSION), false, true); + } pm.setPermission(pm.getGroup("cmod"), GroupPermission.of(VANISH_PERMISSION), false, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(VANISH_PERMISSION), true, true); pm.setPermission(pm.getGroup("trainee"), GroupPermission.of(SPAWN_PM_PERMISSION), true, true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index b9be3c919..a60b05c09 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -483,6 +483,10 @@ public class ArcadeManager extends MiniPlugin implements IRelation { for (PermissionGroup group : _clientManager.getPermissionManager().getGroups()) { + if (!group.canBePrimary()) + { + return; + } if (!group.getDisplay(false, false, false, false).isEmpty()) { scoreboard.getHandle().registerNewTeam(group.getIdentifier()).setPrefix(group.getDisplay(true, true, true, false) + ChatColor.RESET + " "); @@ -619,9 +623,21 @@ public class ArcadeManager extends MiniPlugin implements IRelation pm.setPermission(pm.getGroup("admin"), GroupPermission.of(SET_GAME_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(START_GAME_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(STOP_GAME_COMMAND_PERMISSION), true, true); + if (UtilServer.isTestServer()) + { + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(GAME_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(SET_GAME_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(START_GAME_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(STOP_GAME_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("maplead"), GroupPermission.of(GAME_COMMAND_PERMISSION), false, true); + pm.setPermission(pm.getGroup("maplead"), GroupPermission.of(SET_GAME_COMMAND_PERMISSION), false, true); + pm.setPermission(pm.getGroup("maplead"), GroupPermission.of(START_GAME_COMMAND_PERMISSION), false, true); + pm.setPermission(pm.getGroup("maplead"), GroupPermission.of(STOP_GAME_COMMAND_PERMISSION), false, true); + } if (UtilServer.isTestServer() || UtilServer.isDevServer()) { - pm.setPermission(pm.getGroup("dev"), GroupPermission.of(AUTO_OP_PERMISSION), true, true); + pm.setPermission(pm.getGroup("admin"), GroupPermission.of(AUTO_OP_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qam"), GroupPermission.of(AUTO_OP_PERMISSION), false, true); } else { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 6d6a5097e..94e6dc7ca 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -537,7 +537,7 @@ public abstract class Game extends ListenerComponent implements Lifetimed pm.setPermission(pm.getGroup(debugCommand.getDefaultGroup()), debugCommand.getPermission(), true, true); if (UtilServer.isTestServer()) { - pm.setPermission(pm.getGroup("srmod"), debugCommand.getPermission(), true, true); + pm.setPermission(pm.getGroup("qa"), debugCommand.getPermission(), true, true); } _debugCommands.add(debugCommand); for (String string : debugCommand.Aliases()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/CaptureTheFlag.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/CaptureTheFlag.java index c7df57cac..8cd63ec27 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/CaptureTheFlag.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/CaptureTheFlag.java @@ -122,7 +122,7 @@ public class CaptureTheFlag extends TeamGame pm.setPermission(pm.getGroup("admin"), GroupPermission.of(SUDDEN_DEATH_COMMAND_PERMISSION), true, true); if (UtilServer.isTestServer()) { - pm.setPermission(pm.getGroup("srmod"), GroupPermission.of(SUDDEN_DEATH_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(SUDDEN_DEATH_COMMAND_PERMISSION), true, true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index 9acc0a99e..e846927cc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -106,7 +106,7 @@ public class EventModule extends MiniPlugin pm.setPermission(pm.getGroup("admin"), GroupPermission.of(SET_HOST_COMMAND_PERMISSION), true, true); if (_plugin.getConfig().getString("serverstatus.name").equals("SMTestServer-1")) { - pm.setPermission(pm.getGroup("srmod"), GroupPermission.of(SET_HOST_COMMAND_PERMISSION), true, true); + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(SET_HOST_COMMAND_PERMISSION), true, true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index c3a0c20ec..cc5e37ca0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -105,6 +105,11 @@ public class GameFlagManager implements Listener PermissionManager pm = Manager.GetClients().getPermissionManager(); pm.setPermission(pm.getGroup("dev"), GroupPermission.of(BYPASS_TELEPORT_KICK_PERMISSION), true, true); + if (UtilServer.isTestServer()) + { + pm.setPermission(pm.getGroup("qa"), GroupPermission.of(BYPASS_TELEPORT_KICK_PERMISSION), true, true); + pm.setPermission(pm.getGroup("admin"), GroupPermission.of(BYPASS_TELEPORT_KICK_PERMISSION), true, true); + } } @EventHandler diff --git a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/moderation/ModerationModule.java b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/moderation/ModerationModule.java index f3ef916ec..95781c65c 100644 --- a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/moderation/ModerationModule.java +++ b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/moderation/ModerationModule.java @@ -17,6 +17,7 @@ import mineplex.core.account.CoreClientManager; import mineplex.core.account.permissions.GroupPermission; import mineplex.core.account.permissions.PermissionManager; import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilServer; import mineplex.core.incognito.IncognitoManager; import mineplex.core.incognito.events.IncognitoStatusChangeEvent; import mineplex.core.teleport.event.MineplexTeleportEvent; @@ -56,7 +57,11 @@ public class ModerationModule extends MiniPlugin pm.setPermission(pm.getGroup("trainee"), GroupPermission.of(MODERATOR_MODE_COMMAND_PERMISSION), true, true); pm.setPermission(pm.getGroup("admin"), GroupPermission.of(MODERATOR_MODE_BYPASS_PERMISSION), true, true); - pm.setPermission(pm.getGroup("dev"), GroupPermission.of(AUTO_OP_PERMISSION), true, true); + pm.setPermission(pm.getGroup("admin"), GroupPermission.of(AUTO_OP_PERMISSION), true, true); + if (UtilServer.isTestServer()) + { + pm.setPermission(pm.getGroup("qam"), GroupPermission.of(AUTO_OP_PERMISSION), false, true); + } } @Override