diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 1a4ea14..be53135 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -132,6 +132,7 @@ public class BungeeCore extends Plugin { new PunishmentCommand("noschemsharing", Punishment.PunishmentType.NoSchemSharing); new PunishmentCommand("noschemsubmitting", Punishment.PunishmentType.NoSchemSubmitting); new PunishmentCommand("nodev", Punishment.PunishmentType.NoDevServer); + new PunishmentCommand("nofight", Punishment.PunishmentType.NoFightServer); if(!EVENT_MODE){ new BauCommand(); diff --git a/src/de/steamwar/bungeecore/commands/ArenaCommand.java b/src/de/steamwar/bungeecore/commands/ArenaCommand.java index d88950f..66caf9f 100644 --- a/src/de/steamwar/bungeecore/commands/ArenaCommand.java +++ b/src/de/steamwar/bungeecore/commands/ArenaCommand.java @@ -23,6 +23,8 @@ import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Servertype; import de.steamwar.bungeecore.Subserver; import de.steamwar.bungeecore.SubserverSystem; +import de.steamwar.bungeecore.sql.Punishment; +import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; @@ -40,6 +42,11 @@ public class ArenaCommand extends BasicCommand { return; ProxiedPlayer player = (ProxiedPlayer) sender; + SteamwarUser steamwarUser = SteamwarUser.get(player); + if (steamwarUser.isPunishedWithMessage(player, Punishment.PunishmentType.NoFightServer)) { + return; + } + ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", args)); if(server == null) { Message.send("ARENA_NOT_FOUND", player); diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 736d78d..f94f04a 100644 --- a/src/de/steamwar/bungeecore/commands/FightCommand.java +++ b/src/de/steamwar/bungeecore/commands/FightCommand.java @@ -21,6 +21,8 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; +import de.steamwar.bungeecore.sql.Punishment; +import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.ClickEvent; @@ -128,6 +130,12 @@ public class FightCommand extends BasicCommand { return; ProxiedPlayer player = (ProxiedPlayer) sender; + + SteamwarUser steamwarUser = SteamwarUser.get(player); + if (steamwarUser.isPunishedWithMessage(player, Punishment.PunishmentType.NoFightServer)) { + return; + } + if(alreadyInArena(player)) return; diff --git a/src/de/steamwar/bungeecore/commands/HistoricCommand.java b/src/de/steamwar/bungeecore/commands/HistoricCommand.java index f07a6a3..c13c33e 100644 --- a/src/de/steamwar/bungeecore/commands/HistoricCommand.java +++ b/src/de/steamwar/bungeecore/commands/HistoricCommand.java @@ -19,7 +19,10 @@ package de.steamwar.bungeecore.commands; -import de.steamwar.bungeecore.*; +import de.steamwar.bungeecore.ArenaMode; +import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.ServerStarter; +import de.steamwar.bungeecore.Subserver; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.ClickEvent; diff --git a/src/de/steamwar/bungeecore/commands/ReplayCommand.java b/src/de/steamwar/bungeecore/commands/ReplayCommand.java index 9ff3876..feb033a 100644 --- a/src/de/steamwar/bungeecore/commands/ReplayCommand.java +++ b/src/de/steamwar/bungeecore/commands/ReplayCommand.java @@ -24,6 +24,7 @@ import de.steamwar.bungeecore.inventory.SWItem; import de.steamwar.bungeecore.inventory.SWListInv; import de.steamwar.bungeecore.inventory.SWStreamInv; import de.steamwar.bungeecore.sql.Fight; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SchematicType; import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.CommandSender; @@ -45,6 +46,11 @@ public class ReplayCommand extends BasicCommand { return; ProxiedPlayer player = (ProxiedPlayer) sender; + SteamwarUser steamwarUser = SteamwarUser.get(player); + if (steamwarUser.isPunishedWithMessage(player, Punishment.PunishmentType.NoFightServer)) { + return; + } + new SWStreamInv<>(player, Message.parse("REPLAY_TITLE", player), (click, fight) -> { SteamwarUser user = SteamwarUser.get(player.getUniqueId()); ArenaMode mode = fight.getGameMode(); diff --git a/src/de/steamwar/bungeecore/commands/TpCommand.java b/src/de/steamwar/bungeecore/commands/TpCommand.java index c3a81b2..33bd7bb 100644 --- a/src/de/steamwar/bungeecore/commands/TpCommand.java +++ b/src/de/steamwar/bungeecore/commands/TpCommand.java @@ -20,10 +20,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; -import de.steamwar.bungeecore.sql.BauweltMember; -import de.steamwar.bungeecore.sql.Event; -import de.steamwar.bungeecore.sql.SteamwarUser; -import de.steamwar.bungeecore.sql.Team; +import de.steamwar.bungeecore.sql.*; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; @@ -50,6 +47,7 @@ public class TpCommand extends BasicCommand { public void execute(CommandSender sender, String[] args) { if(!(sender instanceof ProxiedPlayer)) return; + if(!onTp((ProxiedPlayer) sender, args)) Message.send("TP_NOT_FOUND", sender); } @@ -91,6 +89,14 @@ public class TpCommand extends BasicCommand { if(server == null || server == player.getServer().getInfo()) return false; + // Check if player is allowed to join fights + if (Subserver.getSubserver(server).getType() == Servertype.ARENA) { + SteamwarUser steamwarUser = SteamwarUser.get(player); + if (steamwarUser.isPunishedWithMessage(player, Punishment.PunishmentType.NoFightServer)) { + return true; + } + } + teleport(player, server); return true; } diff --git a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java index 90365cd..825d80e 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java +++ b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java @@ -42,6 +42,8 @@ public class Fabric extends BasicListener { private final Set neededMods = new HashSet<>(); + public static final Map checkedPlayers = new HashMap<>(); + { neededMods.add("java"); neededMods.add("minecraft"); @@ -108,8 +110,17 @@ public class Fabric extends BasicListener { } if(Utils.handleMods(player,mods)) { + if (checkedPlayers.containsKey(player)) { + long current = checkedPlayers.get(player); + if (current != dataString.hashCode()) { + banPlayer(user, player); + return; + } + } else { + Message.send("MODIFICATION_CHECK_SUCCESS", player); + checkedPlayers.put(player, dataString.hashCode()); + } Storage.fabricPlayers.remove(player); - Message.send("MODIFICATION_CHECK_SUCCESS", player); } } diff --git a/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java b/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java index a4d54e6..134c7f8 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java +++ b/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java @@ -58,6 +58,7 @@ public class ModLoaderBlocker extends BasicListener { @EventHandler public void onDisconnect(PlayerDisconnectEvent e){ + Fabric.checkedPlayers.remove(e.getPlayer()); Storage.fabricPlayers.remove(e.getPlayer()); } diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index 7f9a24e..c2344a6 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -134,7 +134,9 @@ public class Punishment { NoSchemReceiving(false, "NOSCHEMRECEIVING_TEAM", "NOSCHEMRECEIVING_PERMA", "NOSCHEMRECEIVING_UNTIL", "UNNOSCHEMRECEIVING_ERROR", "UNNOSCHEMRECEIVING"), NoSchemSharing(false, "NOSCHEMSHARING_TEAM", "NOSCHEMSHARING_PERMA", "NOSCHEMSHARING_UNTIL", "UNNOSCHEMSHARING_ERROR", "UNNOSCHEMSHARING"), NoSchemSubmitting(true, "NOSCHEMSUBMITTING_TEAM", "NOSCHEMSUBMITTING_PERMA", "NOSCHEMSUBMITTING_UNTIL", "UNNOSCHEMSUBMITTING_ERROR", "UNNOSCHEMSUBMITTING"), - NoDevServer(true, "NODEVSERVER_TEAM", "NODEVSERVER_PERMA", "NODEVSERVER_UNTIL", "UNNODEVSERVER_ERROR", "UNNODEVSERVER"); + NoDevServer(true, "NODEVSERVER_TEAM", "NODEVSERVER_PERMA", "NODEVSERVER_UNTIL", "UNNODEVSERVER_ERROR", "UNNODEVSERVER"), + NoFightServer(false, "NOFIGHTSERVER_TEAM", "NOFIGHTSERVER_PERMA", "NOFIGHTSERVER_UNTIL", "UNNOFIGHTSERVER_ERROR", "UNNOFIGHTSERVER"), + ; private final boolean needsAdmin; private final String teamMessage; diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index d57c5e9..8542153 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -130,29 +130,35 @@ MUTE_UNTIL=§7Du bist §ebis zum {0} §e§lgemuted§8. §7Grund§8: §e{1} UNMUTE_ERROR=§cDer Spieler ist nicht gemuted. UNMUTE=§7Du hast §e{0} §e§lentmuted. -NOSCHEMRECEIVING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematicerhalten ausgeschlossen§8. §7Grund§8: §f{4} -NOSCHEMRECEIVING_PERMA=§7Du bist §epermanent §7vom Erhalten von §e§lSchematics ausgeschlossen§8. §7Grund§8: §e{0} -NOSCHEMRECEIVING_UNTIL=§7Du bist §ebis zum {0} §7vom Erhalten von §e§lSchematics ausgeschlossen§8. §7Grund§8: §e{1} +NOSCHEMRECEIVING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematicerhalten§7 ausgeschlossen§8. §7Grund§8: §f{4} +NOSCHEMRECEIVING_PERMA=§7Du bist §epermanent §7vom Erhalten von §e§lSchematics§7 ausgeschlossen§8. §7Grund§8: §e{0} +NOSCHEMRECEIVING_UNTIL=§7Du bist §ebis zum {0} §7vom Erhalten von §e§lSchematics§7 ausgeschlossen§8. §7Grund§8: §e{1} UNNOSCHEMRECEIVING_ERROR=§cDer Spieler ist nicht vom Erhalten von Schematics ausgeschlossen. -UNNOSCHEMRECEIVING=§e{0} §7darf nun wieder §e§lSchematics erhalten§8. +UNNOSCHEMRECEIVING=§e{0} §7darf nun wieder §e§lSchematics§7 erhalten§8. -NOSCHEMSHARING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematicverteilen ausgeschlossen§8. §7Grund§8: §f{4} +NOSCHEMSHARING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematicverteilen§7 ausgeschlossen§8. §7Grund§8: §f{4} NOSCHEMSHARING_PERMA=§7Du bist §epermanent §7vom §e§lVerteilen von Schematics§7 ausgeschlossen§8. §7Grund§8: §e{0} NOSCHEMSHARING_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lVerteilen von Schematics§7 ausgeschlossen§8. §7Grund§8: §e{1} UNNOSCHEMSHARING_ERROR=§cDer Spieler ist nicht vom Verteilen von Schematics ausgeschlossen. -UNNOSCHEMSHARING=§e{0} §7darf nun wieder §e§lSchematics verteilen§8. +UNNOSCHEMSHARING=§e{0} §7darf nun wieder §e§lSchematics§7 verteilen§8. -NOSCHEMSUBMITTING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematiceinsenden ausgeschlossen§8. §7Grund§8: §f{4} +NOSCHEMSUBMITTING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematiceinsenden§7 ausgeschlossen§8. §7Grund§8: §f{4} NOSCHEMSUBMITTING_PERMA=§7Du bist §epermanent §7vom §e§lEinsenden von Schematics§7 ausgeschlossen§8. §7Grund§8: §e{0} NOSCHEMSUBMITTING_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lEinsenden von Schematics§7 ausgeschlossen§8. §7Grund§8: §e{1} UNNOSCHEMSUBMITTING_ERROR=§cDer Spieler ist nicht vom Einsenden von Schematics ausgeschlossen. -UNNOSCHEMSUBMITTING=§e{0} §7darf nun wieder §e§lSchematis einsenden§8. +UNNOSCHEMSUBMITTING=§e{0} §7darf nun wieder §e§lSchematis§7 einsenden§8. -NODEVSERVER_TEAM={0} §e{1} §7hat §e{2} §7mit Grund §f{4}§7 zu generft und hat daher §e§lDevserververbot §7erhalten§8, §e{3} -NODEVSERVER_PERMA=§7Du bist §epermanent §7vom §e§lDevserver §7ausgeschlossen§8. §7Grund§8: §e{0} -NODEVSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lDevserver §7ausgeschlossen§8. §7Grund§8: §e{1} +NODEVSERVER_TEAM={0} §e{1} §7hat §e{2} §7mit Grund §f{4}§7 zu generft und hat daher §e§lDevserververbot§7 erhalten§8, §f{3} +NODEVSERVER_PERMA=§7Du bist §epermanent §7vom §e§lDevserver§7 ausgeschlossen§8. §7Grund§8: §e{0} +NODEVSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lDevserver§7 ausgeschlossen§8. §7Grund§8: §e{1} UNNODEVSERVER_ERROR=§cDer Spieler ist nicht vom Devserver ausgeschlossen. -UNNODEVSERVER=§e{0} §7darf nun wieder dem §e§lDevserver beitreten§8. +UNNODEVSERVER=§e{0} §7darf nun wieder dem §e§lDevserver§7 beitreten§8. + +NOFIGHTSERVER_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lKämpfen§7 ausgeschlossen§8. §7Grund§8: §f{4} +NOFIGHTSERVER_PERMA=§7Du bist §epermanent §7vom §e§lKämpfen§7 ausgeschlossen§8. §7Grund§8: §e{0} +NOFIGHTSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lKämpfen§7 ausgeschlossen§8. §7Grund§8: §e{1} +UNNOFIGHTSERVER_ERROR=§cDer Spieler ist nicht vom Kämpfen ausgeschlossen. +UNNOFIGHTSERVER=§e{0} §7darf nun wieder §e§lKämpfen§7 beitreten§8. #BugCommand BUG_MESSAGE=§7Dein Bugreport wurde gespeichert.