Merge remote-tracking branch 'refs/remotes/origin/develop' into update/moba-cosmetics
This commit is contained in:
commit
330ed28992
@ -42,7 +42,7 @@ public class AccountRepository extends MinecraftRepository
|
|||||||
|
|
||||||
private static String CREATE_RANKS_TABLE = "CREATE TABLE IF NOT EXISTS accountRanks (id INT NOT NULL AUTO_INCREMENT, accountId INT NOT NULL, rankIdentifier VARCHAR(40), primaryGroup BOOL, PRIMARY KEY(id), INDEX accountIndex (accountId), INDEX rankIndex (rankIdentifier), UNIQUE INDEX additionalIndex (accountId, rankIdentifier, primaryGroup), FOREIGN KEY (accountId) REFERENCES accounts(id));";
|
private static String CREATE_RANKS_TABLE = "CREATE TABLE IF NOT EXISTS accountRanks (id INT NOT NULL AUTO_INCREMENT, accountId INT NOT NULL, rankIdentifier VARCHAR(40), primaryGroup BOOL, PRIMARY KEY(id), INDEX accountIndex (accountId), INDEX rankIndex (rankIdentifier), UNIQUE INDEX additionalIndex (accountId, rankIdentifier, primaryGroup), FOREIGN KEY (accountId) REFERENCES accounts(id));";
|
||||||
private static String UPDATE_PRIMARY_RANK = "UPDATE accountRanks SET rankIdentifier=? WHERE accountId=? AND primaryGroup=true;";
|
private static String UPDATE_PRIMARY_RANK = "UPDATE accountRanks SET rankIdentifier=? WHERE accountId=? AND primaryGroup=true;";
|
||||||
private static String ADD_PRIMARY_RANK = "INSERT INTO accountRanks (accountId, rankIdentifier, primaryGroup) VALUES (?, NULL, true);";
|
private static String ADD_PRIMARY_RANK = "INSERT INTO accountRanks (accountId, rankIdentifier, primaryGroup) VALUES (?, 'NULL', true);";
|
||||||
private static String ADD_ADDITIONAL_RANK = "INSERT INTO accountRanks (accountId, rankIdentifier, primaryGroup) VALUES (?, ?, false);";
|
private static String ADD_ADDITIONAL_RANK = "INSERT INTO accountRanks (accountId, rankIdentifier, primaryGroup) VALUES (?, ?, false);";
|
||||||
private static String REMOVE_ADDITIONAL_RANK = "DELETE FROM accountRanks WHERE accountId=? AND rankIdentifier=? AND primaryGroup=false;";
|
private static String REMOVE_ADDITIONAL_RANK = "DELETE FROM accountRanks WHERE accountId=? AND rankIdentifier=? AND primaryGroup=false;";
|
||||||
private static String REMOVE_ADDITIONAL_RANKS = "DELETE FROM accountRanks WHERE accountId=? AND primaryGroup=false;";
|
private static String REMOVE_ADDITIONAL_RANKS = "DELETE FROM accountRanks WHERE accountId=? AND primaryGroup=false;";
|
||||||
@ -100,11 +100,10 @@ public class AccountRepository extends MinecraftRepository
|
|||||||
statement.execute("SELECT * FROM accountRanks WHERE accountId=" + accountId + ";");
|
statement.execute("SELECT * FROM accountRanks WHERE accountId=" + accountId + ";");
|
||||||
try (ResultSet rankSet = statement.getResultSet())
|
try (ResultSet rankSet = statement.getResultSet())
|
||||||
{
|
{
|
||||||
boolean anyRows = false;
|
|
||||||
while (rankSet.next())
|
while (rankSet.next())
|
||||||
{
|
{
|
||||||
anyRows = true;
|
String identifier = rankSet.getString("rankIdentifier");
|
||||||
PermissionGroup group = PermissionGroup.valueOf(rankSet.getString("rankIdentifier"));
|
PermissionGroup group = identifier.equals("NULL") ? null : PermissionGroup.valueOf(identifier);
|
||||||
boolean primary = rankSet.getBoolean("primaryGroup");
|
boolean primary = rankSet.getBoolean("primaryGroup");
|
||||||
|
|
||||||
if (primary)
|
if (primary)
|
||||||
@ -112,14 +111,12 @@ public class AccountRepository extends MinecraftRepository
|
|||||||
primaryRank = group;
|
primaryRank = group;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (group != null)
|
||||||
{
|
{
|
||||||
extraRanks.add(group);
|
extraRanks.add(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!anyRows)
|
|
||||||
{
|
|
||||||
statement.execute(UPDATE_PRIMARY_RANK.replace("?", "" + accountId));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +236,7 @@ public class AccountRepository extends MinecraftRepository
|
|||||||
{
|
{
|
||||||
if (!rs.next() || rs.getInt(1) == 0)
|
if (!rs.next() || rs.getInt(1) == 0)
|
||||||
{
|
{
|
||||||
s.execute(ADD_PRIMARY_RANK.replace("?", "" + accountId));
|
s.execute(ADD_PRIMARY_RANK.replace("?", String.valueOf(accountId)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,13 +338,7 @@ public class AccountRepository extends MinecraftRepository
|
|||||||
{
|
{
|
||||||
try (Statement s = c.createStatement())
|
try (Statement s = c.createStatement())
|
||||||
{
|
{
|
||||||
try (ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM accountRanks WHERE accountId=" + accountId + " AND primaryGroup=true;"))
|
int primaryFound = 0;
|
||||||
{
|
|
||||||
if (!rs.next())
|
|
||||||
{
|
|
||||||
s.execute(ADD_PRIMARY_RANK.replace("?", "" + accountId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try (ResultSet rs = s.executeQuery("SELECT * FROM accountRanks WHERE accountId=" + accountId + ";"))
|
try (ResultSet rs = s.executeQuery("SELECT * FROM accountRanks WHERE accountId=" + accountId + ";"))
|
||||||
{
|
{
|
||||||
while (rs.next())
|
while (rs.next())
|
||||||
@ -356,11 +347,19 @@ public class AccountRepository extends MinecraftRepository
|
|||||||
{
|
{
|
||||||
removed.add(PermissionGroup.valueOf(rs.getString("rankIdentifier")));
|
removed.add(PermissionGroup.valueOf(rs.getString("rankIdentifier")));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
primaryFound++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (primaryFound < 1)
|
||||||
|
{
|
||||||
|
s.execute(ADD_PRIMARY_RANK.replace("?", String.valueOf(accountId)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
executeUpdate(c, UPDATE_PRIMARY_RANK, () -> {}, new ColumnVarChar("rankIdentifier", 255, "PLAYER"), new ColumnInt("accountId", accountId));
|
executeUpdate(c, UPDATE_PRIMARY_RANK, () -> {}, new ColumnVarChar("rankIdentifier", 255, PermissionGroup.PLAYER.name()), new ColumnInt("accountId", accountId));
|
||||||
executeUpdate(c, REMOVE_ADDITIONAL_RANKS, () -> success.set(false), new ColumnInt("accountId", accountId));
|
executeUpdate(c, REMOVE_ADDITIONAL_RANKS, () -> success.set(false), new ColumnInt("accountId", accountId));
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
@ -405,9 +404,16 @@ public class AccountRepository extends MinecraftRepository
|
|||||||
while (rs.next())
|
while (rs.next())
|
||||||
{
|
{
|
||||||
if (rs.getBoolean("primaryGroup"))
|
if (rs.getBoolean("primaryGroup"))
|
||||||
|
{
|
||||||
|
if (rs.getString("rankIdentifier").equals("NULL"))
|
||||||
|
{
|
||||||
|
primary.set(null);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
primary.set(PermissionGroup.valueOf(rs.getString("rankIdentifier")));
|
primary.set(PermissionGroup.valueOf(rs.getString("rankIdentifier")));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
additional.add(PermissionGroup.valueOf(rs.getString("rankIdentifier")));
|
additional.add(PermissionGroup.valueOf(rs.getString("rankIdentifier")));
|
||||||
|
@ -179,9 +179,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
KIT_UNLOCK_COMMAND,
|
KIT_UNLOCK_COMMAND,
|
||||||
TAUNT_COMMAND,
|
TAUNT_COMMAND,
|
||||||
GAME_COMMAND,
|
GAME_COMMAND,
|
||||||
SET_GAME_COMMAND,
|
|
||||||
START_GAME_COMMAND,
|
|
||||||
STOP_GAME_COMMAND,
|
|
||||||
AUTO_OP,
|
AUTO_OP,
|
||||||
KIT_ACCESS,
|
KIT_ACCESS,
|
||||||
FEATURED_SERVER,
|
FEATURED_SERVER,
|
||||||
@ -627,19 +624,10 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
PermissionGroup.CONTENT.setPermission(Perm.KIT_UNLOCK_COMMAND, true, true);
|
PermissionGroup.CONTENT.setPermission(Perm.KIT_UNLOCK_COMMAND, true, true);
|
||||||
PermissionGroup.PLAYER.setPermission(Perm.TAUNT_COMMAND, true, true);
|
PermissionGroup.PLAYER.setPermission(Perm.TAUNT_COMMAND, true, true);
|
||||||
PermissionGroup.ADMIN.setPermission(Perm.GAME_COMMAND, true, true);
|
PermissionGroup.ADMIN.setPermission(Perm.GAME_COMMAND, true, true);
|
||||||
PermissionGroup.ADMIN.setPermission(Perm.SET_GAME_COMMAND, true, true);
|
|
||||||
PermissionGroup.ADMIN.setPermission(Perm.START_GAME_COMMAND, true, true);
|
|
||||||
PermissionGroup.ADMIN.setPermission(Perm.STOP_GAME_COMMAND, true, true);
|
|
||||||
if (UtilServer.isTestServer())
|
if (UtilServer.isTestServer())
|
||||||
{
|
{
|
||||||
PermissionGroup.QA.setPermission(Perm.GAME_COMMAND, true, true);
|
PermissionGroup.QA.setPermission(Perm.GAME_COMMAND, true, true);
|
||||||
PermissionGroup.QA.setPermission(Perm.SET_GAME_COMMAND, true, true);
|
|
||||||
PermissionGroup.QA.setPermission(Perm.START_GAME_COMMAND, true, true);
|
|
||||||
PermissionGroup.QA.setPermission(Perm.STOP_GAME_COMMAND, true, true);
|
|
||||||
PermissionGroup.MAPLEAD.setPermission(Perm.GAME_COMMAND, false, true);
|
PermissionGroup.MAPLEAD.setPermission(Perm.GAME_COMMAND, false, true);
|
||||||
PermissionGroup.MAPLEAD.setPermission(Perm.SET_GAME_COMMAND, false, true);
|
|
||||||
PermissionGroup.MAPLEAD.setPermission(Perm.START_GAME_COMMAND, false, true);
|
|
||||||
PermissionGroup.MAPLEAD.setPermission(Perm.STOP_GAME_COMMAND, false, true);
|
|
||||||
}
|
}
|
||||||
if (UtilServer.isTestServer() || UtilServer.isDevServer())
|
if (UtilServer.isTestServer() || UtilServer.isDevServer())
|
||||||
{
|
{
|
||||||
@ -925,6 +913,17 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean canPlayerUseGameCmd(Player player)
|
||||||
|
{
|
||||||
|
if (!GetClients().Get(player).hasPermission(Perm.GAME_COMMAND) && !(_gameHostManager.isEventServer() && _gameHostManager.isAdmin(player, false)))
|
||||||
|
{
|
||||||
|
player.sendMessage(F.main("Game", "You are not allowed to use game commands."));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void StaffIncognito(IncognitoStatusChangeEvent event)
|
public void StaffIncognito(IncognitoStatusChangeEvent event)
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,8 @@ package nautilus.game.arcade.command;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.command.MultiCommandBase;
|
import mineplex.core.command.MultiCommandBase;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
@ -14,17 +16,26 @@ import static nautilus.game.arcade.command.SetCommand.SOURCE_PREFIX;
|
|||||||
|
|
||||||
public class GameCommand extends MultiCommandBase<ArcadeManager>
|
public class GameCommand extends MultiCommandBase<ArcadeManager>
|
||||||
{
|
{
|
||||||
|
public enum Perm implements Permission
|
||||||
|
{
|
||||||
|
GAME_COMMAND_DUMMY_PERM,
|
||||||
|
}
|
||||||
|
|
||||||
public GameCommand(ArcadeManager plugin)
|
public GameCommand(ArcadeManager plugin)
|
||||||
{
|
{
|
||||||
super(plugin, ArcadeManager.Perm.GAME_COMMAND, "game");
|
super(plugin, Perm.GAME_COMMAND_DUMMY_PERM, "game");
|
||||||
|
|
||||||
AddCommand(new StartCommand(Plugin));
|
AddCommand(new StartCommand(Plugin));
|
||||||
AddCommand(new StopCommand(Plugin));
|
AddCommand(new StopCommand(Plugin));
|
||||||
AddCommand(new SetCommand(Plugin));
|
AddCommand(new SetCommand(Plugin));
|
||||||
|
|
||||||
|
PermissionGroup.PLAYER.setPermission(Perm.GAME_COMMAND_DUMMY_PERM, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void Help(Player caller, String[] args)
|
protected void Help(Player caller, String[] args)
|
||||||
|
{
|
||||||
|
if (!Plugin.canPlayerUseGameCmd(caller))
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main("Game", "Available Commands"));
|
UtilPlayer.message(caller, F.main("Game", "Available Commands"));
|
||||||
UtilPlayer.message(caller, F.help("/game start", "Start the current game", ChatColor.DARK_RED));
|
UtilPlayer.message(caller, F.help("/game start", "Start the current game", ChatColor.DARK_RED));
|
||||||
@ -32,3 +43,4 @@ public class GameCommand extends MultiCommandBase<ArcadeManager>
|
|||||||
caller.sendMessage(F.help(String.format("/game set <gametype> [%s(gamemode)] [%s(mapsource)] [%s(mapname)]", MODE_PREFIX, SOURCE_PREFIX, MAP_PREFIX), "Set the current game or next game", ChatColor.DARK_RED));
|
caller.sendMessage(F.help(String.format("/game set <gametype> [%s(gamemode)] [%s(mapsource)] [%s(mapname)]", MODE_PREFIX, SOURCE_PREFIX, MAP_PREFIX), "Set the current game or next game", ChatColor.DARK_RED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
@ -26,12 +26,17 @@ public class SetCommand extends CommandBase<ArcadeManager>
|
|||||||
|
|
||||||
public SetCommand(ArcadeManager plugin)
|
public SetCommand(ArcadeManager plugin)
|
||||||
{
|
{
|
||||||
super(plugin, ArcadeManager.Perm.SET_GAME_COMMAND, "set");
|
super(plugin, GameCommand.Perm.GAME_COMMAND_DUMMY_PERM, "set");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Execute(Player caller, String[] args)
|
public void Execute(Player caller, String[] args)
|
||||||
{
|
{
|
||||||
|
if (!Plugin.canPlayerUseGameCmd(caller))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Plugin.GetGame() == null)
|
if (Plugin.GetGame() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -13,12 +13,17 @@ public class StartCommand extends CommandBase<ArcadeManager>
|
|||||||
{
|
{
|
||||||
public StartCommand(ArcadeManager plugin)
|
public StartCommand(ArcadeManager plugin)
|
||||||
{
|
{
|
||||||
super(plugin, ArcadeManager.Perm.START_GAME_COMMAND, "start");
|
super(plugin, GameCommand.Perm.GAME_COMMAND_DUMMY_PERM, "start");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Execute(Player caller, String[] args)
|
public void Execute(Player caller, String[] args)
|
||||||
{
|
{
|
||||||
|
if (!Plugin.canPlayerUseGameCmd(caller))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Plugin.GetGame() == null || Plugin.GetGame().GetState() == GameState.Loading)
|
if (Plugin.GetGame() == null || Plugin.GetGame().GetState() == GameState.Loading)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main("Game", "The game is currently loading, it cannot be started!"));
|
UtilPlayer.message(caller, F.main("Game", "The game is currently loading, it cannot be started!"));
|
||||||
|
@ -14,12 +14,17 @@ public class StopCommand extends CommandBase<ArcadeManager>
|
|||||||
{
|
{
|
||||||
public StopCommand(ArcadeManager plugin)
|
public StopCommand(ArcadeManager plugin)
|
||||||
{
|
{
|
||||||
super(plugin, ArcadeManager.Perm.STOP_GAME_COMMAND, "stop");
|
super(plugin, GameCommand.Perm.GAME_COMMAND_DUMMY_PERM, "stop");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Execute(Player caller, String[] args)
|
public void Execute(Player caller, String[] args)
|
||||||
{
|
{
|
||||||
|
if (!Plugin.canPlayerUseGameCmd(caller))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Plugin.GetGame() == null)
|
if (Plugin.GetGame() == null)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main("Game", "There is no game to stop!"));
|
UtilPlayer.message(caller, F.main("Game", "There is no game to stop!"));
|
||||||
|
@ -5,7 +5,6 @@ import org.bukkit.entity.Player;
|
|||||||
import mineplex.core.Managers;
|
import mineplex.core.Managers;
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
|
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
|
||||||
public class DebugCommand extends CommandBase<ArcadeManager>
|
public class DebugCommand extends CommandBase<ArcadeManager>
|
||||||
|
@ -537,9 +537,13 @@ public abstract class Game extends ListenerComponent implements Lifetimed
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Enum<T> & Permission> void registerDebugCommand(String commandName, T permission, DebugCommandExecutor executor)
|
public <T extends Enum<T> & Permission> void registerDebugCommand(String commandName, T permission, PermissionGroup defaultRank, DebugCommandExecutor executor)
|
||||||
{
|
{
|
||||||
DebugCommand command = new DebugCommand(commandName, permission, executor);
|
DebugCommand command = new DebugCommand(commandName, permission, executor);
|
||||||
|
if (defaultRank != null)
|
||||||
|
{
|
||||||
|
defaultRank.setPermission(permission, true, true);
|
||||||
|
}
|
||||||
if (UtilServer.isTestServer())
|
if (UtilServer.isTestServer())
|
||||||
{
|
{
|
||||||
PermissionGroup.QA.setPermission(permission, true, true);
|
PermissionGroup.QA.setPermission(permission, true, true);
|
||||||
|
@ -46,6 +46,7 @@ import org.bukkit.metadata.FixedMetadataValue;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.NautHashMap;
|
import mineplex.core.common.util.NautHashMap;
|
||||||
@ -274,13 +275,13 @@ public class Bridge extends TeamGame implements OreObsfucation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
registerDebugCommand("bridge", Perm.DEBUG_BRIDGE_COMMAND, (caller, args) ->
|
registerDebugCommand("bridge", Perm.DEBUG_BRIDGE_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
caller.sendMessage(F.main("Debug", "Spawning the bridges."));
|
caller.sendMessage(F.main("Debug", "Spawning the bridges."));
|
||||||
_bridgeTime = 3000;
|
_bridgeTime = 3000;
|
||||||
});
|
});
|
||||||
|
|
||||||
registerDebugCommand("bridgeinfo", Perm.DEBUG_BRIDGEINFO_COMMAND, (caller, args) ->
|
registerDebugCommand("bridgeinfo", Perm.DEBUG_BRIDGEINFO_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
if (_animation == null || !(_animation instanceof CustomBridgeAnimation))
|
if (_animation == null || !(_animation instanceof CustomBridgeAnimation))
|
||||||
{
|
{
|
||||||
|
@ -108,7 +108,7 @@ public class EventModule extends MiniPlugin
|
|||||||
PermissionGroup.ADMIN.setPermission(Perm.SET_HOST_COMMAND, true, true);
|
PermissionGroup.ADMIN.setPermission(Perm.SET_HOST_COMMAND, true, true);
|
||||||
if (_plugin.getConfig().getString("serverstatus.name").equals("SMTestServer-1"))
|
if (_plugin.getConfig().getString("serverstatus.name").equals("SMTestServer-1"))
|
||||||
{
|
{
|
||||||
PermissionGroup.QA.setPermission(Perm.SET_HOST_COMMAND, true, true);
|
PermissionGroup.SRMOD.setPermission(Perm.SET_HOST_COMMAND, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ import com.mineplex.anticheat.checks.move.Speed;
|
|||||||
|
|
||||||
import mineplex.core.Managers;
|
import mineplex.core.Managers;
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.antihack.AntiHack;
|
import mineplex.core.antihack.AntiHack;
|
||||||
import mineplex.core.common.Pair;
|
import mineplex.core.common.Pair;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
@ -173,7 +174,7 @@ public class Moba extends TeamGame
|
|||||||
.setGiveCompassToAlive(false)
|
.setGiveCompassToAlive(false)
|
||||||
.register(this);
|
.register(this);
|
||||||
|
|
||||||
registerDebugCommand("kit", Perm.DEBUG_KIT_COMMAND, (caller, args) ->
|
registerDebugCommand("kit", Perm.DEBUG_KIT_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -44,7 +45,7 @@ public class GoldManager implements Listener
|
|||||||
|
|
||||||
_playerGold = new HashMap<>();
|
_playerGold = new HashMap<>();
|
||||||
|
|
||||||
host.registerDebugCommand("gold", Perm.DEBUG_GOLD_COMMAND, (caller, args) ->
|
host.registerDebugCommand("gold", Perm.DEBUG_GOLD_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
if (args.length < 1)
|
if (args.length < 1)
|
||||||
{
|
{
|
||||||
|
@ -15,6 +15,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
@ -51,7 +52,7 @@ public class MinionManager implements Listener
|
|||||||
_waves = new HashSet<>();
|
_waves = new HashSet<>();
|
||||||
_enabled = true;
|
_enabled = true;
|
||||||
|
|
||||||
host.registerDebugCommand("removeminions", Perm.DEBUG_REMOVEMINIONS_COMMAND, (caller, args) ->
|
host.registerDebugCommand("removeminions", Perm.DEBUG_REMOVEMINIONS_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
for (MinionWave wave : _waves)
|
for (MinionWave wave : _waves)
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
@ -68,13 +69,13 @@ public class MobaProgression implements Listener
|
|||||||
_roleViewers = new HashMap<>();
|
_roleViewers = new HashMap<>();
|
||||||
_roleShop = new MobaRoleShop(host.getArcadeManager());
|
_roleShop = new MobaRoleShop(host.getArcadeManager());
|
||||||
|
|
||||||
host.registerDebugCommand("fakeexp", Perm.DEBUG_FAKEEXP_COMMAND, (caller, args) ->
|
host.registerDebugCommand("fakeexp", Perm.DEBUG_FAKEEXP_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
int exp = Integer.parseInt(args[0]);
|
int exp = Integer.parseInt(args[0]);
|
||||||
_host.GetGems(caller).put("Fake Exp", new GemData(exp, false));
|
_host.GetGems(caller).put("Fake Exp", new GemData(exp, false));
|
||||||
caller.sendMessage(F.main("Debug", "Gave you " + F.elem(exp) + " fake exp."));
|
caller.sendMessage(F.main("Debug", "Gave you " + F.elem(exp) + " fake exp."));
|
||||||
});
|
});
|
||||||
host.registerDebugCommand("setmobalevel", Perm.DEBUG_SETMOBALEVEL_COMMAND, (caller, args) ->
|
host.registerDebugCommand("setmobalevel", Perm.DEBUG_SETMOBALEVEL_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
MobaRole role = MobaRole.valueOf(args[0].toUpperCase());
|
MobaRole role = MobaRole.valueOf(args[0].toUpperCase());
|
||||||
int exp = getExpFor(Integer.parseInt(args[1]) - 1);
|
int exp = getExpFor(Integer.parseInt(args[1]) - 1);
|
||||||
|
@ -25,6 +25,7 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
@ -194,7 +195,7 @@ public class MobaTraining extends Moba
|
|||||||
(int) (Math.ceil(subject.getHealth() / 2D)))
|
(int) (Math.ceil(subject.getHealth() / 2D)))
|
||||||
.register(this);
|
.register(this);
|
||||||
|
|
||||||
registerDebugCommand("skip", Perm.DEBUG_SKIP_COMMAND, (caller, args) ->
|
registerDebugCommand("skip", Perm.DEBUG_SKIP_COMMAND, PermissionGroup.PLAYER, (caller, args) ->
|
||||||
{
|
{
|
||||||
if (!safeFunction.apply(caller))
|
if (!safeFunction.apply(caller))
|
||||||
{
|
{
|
||||||
|
@ -33,6 +33,7 @@ import org.bukkit.scheduler.BukkitRunnable;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.blockrestore.BlockRestore;
|
import mineplex.core.blockrestore.BlockRestore;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
@ -147,7 +148,7 @@ public abstract class SuperSmash extends Game
|
|||||||
|
|
||||||
new PerkSpreadsheetModule(this, "SMASH_KITS");
|
new PerkSpreadsheetModule(this, "SMASH_KITS");
|
||||||
|
|
||||||
registerDebugCommand("cooldown", Perm.DEBUG_COOLDOWN_COMMAND, (caller, args) ->
|
registerDebugCommand("cooldown", Perm.DEBUG_COOLDOWN_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
for (Player other : UtilServer.getPlayers())
|
for (Player other : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
@ -156,16 +157,16 @@ public abstract class SuperSmash extends Game
|
|||||||
|
|
||||||
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " reset cooldowns!");
|
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " reset cooldowns!");
|
||||||
});
|
});
|
||||||
registerDebugCommand("nextsmash", Perm.DEBUG_NEXTSMASH_COMMAND, (caller, args) ->
|
registerDebugCommand("nextsmash", Perm.DEBUG_NEXTSMASH_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
_nextPowerup = System.currentTimeMillis() + 1000;
|
_nextPowerup = System.currentTimeMillis() + 1000;
|
||||||
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " spawned a smash crystal!");
|
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " spawned a smash crystal!");
|
||||||
});
|
});
|
||||||
registerDebugCommand("smash", Perm.DEBUG_SMASH_COMMAND, (caller, args) ->
|
registerDebugCommand("smash", Perm.DEBUG_SMASH_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
giveSmashItem(caller);
|
giveSmashItem(caller);
|
||||||
});
|
});
|
||||||
registerDebugCommand("kit", Perm.DEBUG_KIT_COMMAND, (caller, args) ->
|
registerDebugCommand("kit", Perm.DEBUG_KIT_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
String kit = "";
|
String kit = "";
|
||||||
|
|
||||||
@ -187,7 +188,7 @@ public abstract class SuperSmash extends Game
|
|||||||
|
|
||||||
caller.sendMessage(F.main("Kit", "Sorry that is not a kit!"));
|
caller.sendMessage(F.main("Kit", "Sorry that is not a kit!"));
|
||||||
});
|
});
|
||||||
registerDebugCommand("lives", Perm.DEBUG_LIVES_COMMAND, (caller, args) ->
|
registerDebugCommand("lives", Perm.DEBUG_LIVES_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " reset their lives!");
|
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " reset their lives!");
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ import org.bukkit.potion.PotionEffectType;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.MapUtil;
|
import mineplex.core.common.util.MapUtil;
|
||||||
@ -213,7 +214,7 @@ public class SpeedBuilders extends SoloGame
|
|||||||
.setGiveCompassToAlive(false)
|
.setGiveCompassToAlive(false)
|
||||||
.register(this);
|
.register(this);
|
||||||
|
|
||||||
registerDebugCommand("setnext", Perm.DEBUG_SETNEXT_COMMAND, (caller, args) ->
|
registerDebugCommand("setnext", Perm.DEBUG_SETNEXT_COMMAND, PermissionGroup.BUILDER, (caller, args) ->
|
||||||
{
|
{
|
||||||
if (!UtilServer.isTestServer())
|
if (!UtilServer.isTestServer())
|
||||||
{
|
{
|
||||||
|
@ -29,6 +29,7 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
@ -194,12 +195,12 @@ public class TypeWars extends TeamGame
|
|||||||
.giveHotbarItem()
|
.giveHotbarItem()
|
||||||
.register(this);
|
.register(this);
|
||||||
|
|
||||||
registerDebugCommand("money", Perm.DEBUG_MONEY_COMMAND, (caller, args) ->
|
registerDebugCommand("money", Perm.DEBUG_MONEY_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
_moneyMap.put(caller, 1000);
|
_moneyMap.put(caller, 1000);
|
||||||
UtilPlayer.message(caller, F.main("Money", "You got some Money"));
|
UtilPlayer.message(caller, F.main("Money", "You got some Money"));
|
||||||
});
|
});
|
||||||
registerDebugCommand("boss", Perm.DEBUG_BOSS_COMMAND, (caller, args) ->
|
registerDebugCommand("boss", Perm.DEBUG_BOSS_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
if (!IsPlaying(caller))
|
if (!IsPlaying(caller))
|
||||||
return;
|
return;
|
||||||
|
@ -71,6 +71,7 @@ import org.bukkit.scoreboard.Objective;
|
|||||||
import org.spigotmc.ActivationRange;
|
import org.spigotmc.ActivationRange;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.boosters.event.BoosterItemGiveEvent;
|
import mineplex.core.boosters.event.BoosterItemGiveEvent;
|
||||||
import mineplex.core.common.Pair;
|
import mineplex.core.common.Pair;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -311,7 +312,7 @@ public abstract class UHC extends Game
|
|||||||
|
|
||||||
registerQuestTrackers(new TameQuestTracker(this));
|
registerQuestTrackers(new TameQuestTracker(this));
|
||||||
|
|
||||||
registerDebugCommand("startpvp", Perm.DEBUG_STARTPVP_COMMAND, (caller, args) ->
|
registerDebugCommand("startpvp", Perm.DEBUG_STARTPVP_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
if (!IsLive())
|
if (!IsLive())
|
||||||
{
|
{
|
||||||
@ -331,7 +332,7 @@ public abstract class UHC extends Game
|
|||||||
UtilPlayer.message(caller, F.main("Debug", "Started PvP"));
|
UtilPlayer.message(caller, F.main("Debug", "Started PvP"));
|
||||||
});
|
});
|
||||||
|
|
||||||
registerDebugCommand("worldinfo", Perm.DEBUG_WORLDINFO_COMMAND, (caller, args) ->
|
registerDebugCommand("worldinfo", Perm.DEBUG_WORLDINFO_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
if (args == null || args.length == 0)
|
if (args == null || args.length == 0)
|
||||||
{
|
{
|
||||||
@ -439,16 +440,16 @@ public abstract class UHC extends Game
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
registerDebugCommand("uhcgames", Perm.DEBUG_UHCGAMES_COMMAND, (caller, args) ->
|
registerDebugCommand("uhcgames", Perm.DEBUG_UHCGAMES_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main("Debug", "As of now, there have been " + _gamesRun + " games played"));
|
UtilPlayer.message(caller, F.main("Debug", "As of now, there have been " + _gamesRun + " games played"));
|
||||||
});
|
});
|
||||||
registerDebugCommand("uhcgc", Perm.DEBUG_GC_COMMAND, (caller, args) ->
|
registerDebugCommand("uhcgc", Perm.DEBUG_GC_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
System.gc();
|
System.gc();
|
||||||
UtilPlayer.message(caller, F.main("Debug", "Cleaned up!"));
|
UtilPlayer.message(caller, F.main("Debug", "Cleaned up!"));
|
||||||
});
|
});
|
||||||
registerDebugCommand("setcombatlogtimeout", Perm.DEBUG_SETCOMBATLOGTIMEOUT_COMMAND, (caller, args) ->
|
registerDebugCommand("setcombatlogtimeout", Perm.DEBUG_SETCOMBATLOGTIMEOUT_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
CombatLogModule module = getModule(CombatLogModule.class);
|
CombatLogModule module = getModule(CombatLogModule.class);
|
||||||
if (module == null)
|
if (module == null)
|
||||||
@ -474,14 +475,14 @@ public abstract class UHC extends Game
|
|||||||
UtilPlayer.message(caller, F.main("Debug", "That's not a number!"));
|
UtilPlayer.message(caller, F.main("Debug", "That's not a number!"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
registerDebugCommand("dm", Perm.DEBUG_DEATHMATCH_COMMAND, (caller, args) ->
|
registerDebugCommand("dm", Perm.DEBUG_DEATHMATCH_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
SAFE_TIME = 0;
|
SAFE_TIME = 0;
|
||||||
MINING_TIME = 1000;
|
MINING_TIME = 1000;
|
||||||
startPreDeathmatch();
|
startPreDeathmatch();
|
||||||
UtilPlayer.message(caller, F.main("Debug", "Starting deathmatch"));
|
UtilPlayer.message(caller, F.main("Debug", "Starting deathmatch"));
|
||||||
});
|
});
|
||||||
registerDebugCommand("uhcentities", Perm.DEBUG_ENTITIES_COMMAND, (caller, args) ->
|
registerDebugCommand("uhcentities", Perm.DEBUG_ENTITIES_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
for (Entity entity : caller.getNearbyEntities(5.0, 5.0, 5.0))
|
for (Entity entity : caller.getNearbyEntities(5.0, 5.0, 5.0))
|
||||||
{
|
{
|
||||||
@ -497,7 +498,7 @@ public abstract class UHC extends Game
|
|||||||
caller.sendMessage(debug);
|
caller.sendMessage(debug);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
registerDebugCommand("uhcchunk", Perm.DEBUG_CHUNK_COMMAND, (caller, args) ->
|
registerDebugCommand("uhcchunk", Perm.DEBUG_CHUNK_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
net.minecraft.server.v1_8_R3.Chunk chunk = ((CraftChunk) caller.getLocation().getChunk()).getHandle();
|
net.minecraft.server.v1_8_R3.Chunk chunk = ((CraftChunk) caller.getLocation().getChunk()).getHandle();
|
||||||
try
|
try
|
||||||
@ -539,7 +540,7 @@ public abstract class UHC extends Game
|
|||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
registerDebugCommand("uhcallchunks", Perm.DEBUG_CALLCHUNKS_COMMAND, (caller, args) ->
|
registerDebugCommand("uhcallchunks", Perm.DEBUG_CALLCHUNKS_COMMAND, PermissionGroup.DEV, (caller, args) ->
|
||||||
{
|
{
|
||||||
for (net.minecraft.server.v1_8_R3.Chunk chunk : ((CraftWorld) caller.getWorld()).getHandle().chunkProviderServer.chunks.values())
|
for (net.minecraft.server.v1_8_R3.Chunk chunk : ((CraftWorld) caller.getWorld()).getHandle().chunkProviderServer.chunks.values())
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.event.player.PlayerLoginEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.NautHashMap;
|
import mineplex.core.common.util.NautHashMap;
|
||||||
@ -39,7 +40,7 @@ public class RejoinModule extends Module
|
|||||||
@Override
|
@Override
|
||||||
protected void setup()
|
protected void setup()
|
||||||
{
|
{
|
||||||
getGame().registerDebugCommand("rejoin", Perm.DEBUG_REJOIN_COMMAND, (caller, args) ->
|
getGame().registerDebugCommand("rejoin", Perm.DEBUG_REJOIN_COMMAND, PermissionGroup.ADMIN, (caller, args) ->
|
||||||
{
|
{
|
||||||
if (args.length < 1)
|
if (args.length < 1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user