Implement permission requests from admin team
This commit is contained in:
parent
87ac55de44
commit
aa79e9338d
@ -115,6 +115,10 @@ public class CoreClient
|
||||
|
||||
public void setPrimaryGroup(PermissionGroup group)
|
||||
{
|
||||
if (group != null && !group.canBePrimary())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_primary != null)
|
||||
{
|
||||
_lastPrimary = _primary;
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ public class QuestManager extends MiniDbClientPlugin<QuestClientData>
|
||||
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);
|
||||
}
|
||||
|
@ -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<UUID, Integer> _failedRedisLocates = new HashMap<>();
|
||||
private Map<UUID, Integer> _failedRankLocates = new HashMap<>();
|
||||
|
||||
private LinkedList<Teleporter> teleportList = new LinkedList<>();
|
||||
private Map<String, LinkedList<Location>> _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<String> 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
|
||||
|
@ -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<Teleport>
|
||||
{
|
||||
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"));
|
||||
}
|
||||
}
|
@ -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<Teleport>
|
||||
{
|
||||
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"));
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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<String> _online;
|
||||
private UUID _receivingPlayerUUID;
|
||||
|
||||
private UUID _uuid;
|
||||
|
||||
public RankLocateCallback(RankLocate command, String serverName, Set<String> online)
|
||||
{
|
||||
_uuid = command.getUUID();
|
||||
_receivingPlayerUUID = command.getSenderUUID();
|
||||
_online = online;
|
||||
_serverName = serverName;
|
||||
|
||||
setTargetServers(command.getSendingServer());
|
||||
}
|
||||
|
||||
public Set<String> getOnline()
|
||||
{
|
||||
return _online;
|
||||
}
|
||||
|
||||
public String getServerName()
|
||||
{
|
||||
return _serverName;
|
||||
}
|
||||
|
||||
public UUID getReceivingPlayerUUID()
|
||||
{
|
||||
return _receivingPlayerUUID;
|
||||
}
|
||||
|
||||
public UUID getUUID()
|
||||
{
|
||||
return _uuid;
|
||||
}
|
||||
}
|
@ -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 + " ");
|
||||
|
@ -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
|
||||
|
@ -507,7 +507,11 @@ public class ClansManager extends MiniClientPlugin<ClientClan> 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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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())
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user