From 3cfd3f5beb6200eed20b8a2d4e7c3147278b98c5 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 26 Sep 2021 23:34:15 +0200 Subject: [PATCH 01/13] Update Punishment system Simplify Punishment code overhead --- src/de/steamwar/bungeecore/BungeeCore.java | 8 + .../bungeecore/bot/commands/BanCommand.java | 6 +- .../bungeecore/bot/commands/MuteCommand.java | 7 +- .../bungeecore/bot/commands/UnbanCommand.java | 5 +- .../bot/listeners/IngameChatListener.java | 3 +- .../bungeecore/commands/BanCommand.java | 85 ----------- .../bungeecore/commands/MsgCommand.java | 5 +- .../bungeecore/commands/MuteCommand.java | 57 -------- .../commands/PunishmentCommand.java | 108 ++++++++++++++ .../bungeecore/commands/RCommand.java | 5 +- .../bungeecore/commands/UnbanCommand.java | 54 ------- .../bungeecore/listeners/BanListener.java | 6 +- .../bungeecore/listeners/ChatListener.java | 10 +- .../bungeecore/listeners/mods/Utils.java | 5 +- .../steamwar/bungeecore/sql/Punishment.java | 46 +++--- .../steamwar/bungeecore/sql/SteamwarUser.java | 138 ++++++++---------- .../steamwar/messages/BungeeCore.properties | 46 ++++-- 17 files changed, 261 insertions(+), 333 deletions(-) delete mode 100644 src/de/steamwar/bungeecore/commands/BanCommand.java delete mode 100644 src/de/steamwar/bungeecore/commands/MuteCommand.java create mode 100644 src/de/steamwar/bungeecore/commands/PunishmentCommand.java delete mode 100644 src/de/steamwar/bungeecore/commands/UnbanCommand.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 0b71cb5..2a725a6 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -20,6 +20,9 @@ package de.steamwar.bungeecore; import de.steamwar.bungeecore.bot.SteamwarDiscordBot; +import de.steamwar.bungeecore.bot.commands.BanCommand; +import de.steamwar.bungeecore.bot.commands.MuteCommand; +import de.steamwar.bungeecore.bot.commands.UnbanCommand; import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig; import de.steamwar.bungeecore.commands.*; import de.steamwar.bungeecore.comms.SpigotReceiver; @@ -28,6 +31,7 @@ import de.steamwar.bungeecore.listeners.mods.Forge; import de.steamwar.bungeecore.listeners.mods.LabyMod; import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; import de.steamwar.bungeecore.listeners.mods.WorldDownloader; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.Statement; import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.Team; @@ -130,6 +134,10 @@ public class BungeeCore extends Plugin { new StatCommand(); new VerifyCommand(); + // Punishment Commands: + new PunishmentCommand("ban", Punishment.PunishmentType.Ban); + new PunishmentCommand("mute", Punishment.PunishmentType.Mute); + if(!EVENT_MODE){ new BauCommand(); new WebregisterCommand(); diff --git a/src/de/steamwar/bungeecore/bot/commands/BanCommand.java b/src/de/steamwar/bungeecore/bot/commands/BanCommand.java index e55b97e..5e06cb6 100644 --- a/src/de/steamwar/bungeecore/bot/commands/BanCommand.java +++ b/src/de/steamwar/bungeecore/bot/commands/BanCommand.java @@ -20,6 +20,8 @@ package de.steamwar.bungeecore.bot.commands; import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.commands.PunishmentCommand; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import net.dv8tion.jda.api.events.interaction.SlashCommandEvent; import net.dv8tion.jda.api.interactions.commands.OptionType; @@ -49,7 +51,7 @@ public class BanCommand extends BasicDiscordCommand { return; } - Timestamp time = de.steamwar.bungeecore.commands.BanCommand.parseTime(null, event.getOption("time").getAsString()); + Timestamp time = PunishmentCommand.parseTime(null, event.getOption("time").getAsString()); if (time == null) { event.reply("Angegebene Zeit invalide").setEphemeral(true).queue(); return; @@ -58,7 +60,7 @@ public class BanCommand extends BasicDiscordCommand { String msg = event.getOption("reason").getAsString(); boolean isPerma = event.getOption("time").getAsString().equals("perma"); - target.ban(time, msg, sender.getId(), isPerma); + target.punish(Punishment.PunishmentType.Ban, time, msg, sender.getId(), isPerma); Message.team("BAN_TEAM_BANNED", new Message("PREFIX"), target.getUserName(), sender.getUserName(), new Message((isPerma ? "BAN_PERMA" : "BAN_UNTIL"), time), msg); event.reply("Erfolgreich " + target.getUserName() + (isPerma ? " permanent" : " bis " + time) + " gebannt").setEphemeral(true).queue(); } diff --git a/src/de/steamwar/bungeecore/bot/commands/MuteCommand.java b/src/de/steamwar/bungeecore/bot/commands/MuteCommand.java index 1c0bc96..7847316 100644 --- a/src/de/steamwar/bungeecore/bot/commands/MuteCommand.java +++ b/src/de/steamwar/bungeecore/bot/commands/MuteCommand.java @@ -20,7 +20,8 @@ package de.steamwar.bungeecore.bot.commands; import de.steamwar.bungeecore.Message; -import de.steamwar.bungeecore.commands.BanCommand; +import de.steamwar.bungeecore.commands.PunishmentCommand; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import net.dv8tion.jda.api.events.interaction.SlashCommandEvent; import net.dv8tion.jda.api.interactions.commands.OptionType; @@ -50,7 +51,7 @@ public class MuteCommand extends BasicDiscordCommand { return; } - Timestamp time = BanCommand.parseTime(null, event.getOption("time").getAsString()); + Timestamp time = PunishmentCommand.parseTime(null, event.getOption("time").getAsString()); if (time == null) { event.reply("Angegebene Zeit invalide").setEphemeral(true).complete(); return; @@ -59,7 +60,7 @@ public class MuteCommand extends BasicDiscordCommand { String msg = event.getOption("reason").getAsString(); boolean isPerma = event.getOption("time").getAsString().equals("perma"); - target.mute(time, msg, sender.getId(), isPerma); + target.punish(Punishment.PunishmentType.Mute, time, msg, sender.getId(), isPerma); Message.team("MUTE_TEAM_MUTED", new Message("PREFIX"), target.getUserName(), sender.getUserName(), new Message((isPerma ? "BAN_PERMA" : "BAN_UNTIL"), time), msg); event.reply("Erfolgreich " + target.getUserName() + (isPerma ? " permanent" : " bis " + time) + " gemutet").setEphemeral(true).queue(); } diff --git a/src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java b/src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java index 925423f..f8d6185 100644 --- a/src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java +++ b/src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java @@ -19,6 +19,7 @@ package de.steamwar.bungeecore.bot.commands; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import net.dv8tion.jda.api.events.interaction.SlashCommandEvent; import net.dv8tion.jda.api.interactions.commands.OptionType; @@ -47,12 +48,12 @@ public class UnbanCommand extends BasicDiscordCommand { return; } - if (!target.isBanned()) { + if (!target.isPunished(Punishment.PunishmentType.Ban)) { event.reply("Angegebener User ist nicht gebannt").setEphemeral(true).queue(); return; } - target.ban(Timestamp.from(new Date().toInstant()), "Unban", sender.getId(), false); + target.punish(Punishment.PunishmentType.Ban, Timestamp.from(new Date().toInstant()), "Unban", sender.getId(), false); event.reply("Erfolgreich " + target.getUserName() + " entbannt").setEphemeral(true).queue(); } } diff --git a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java index 7163985..e7b709d 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java @@ -22,6 +22,7 @@ package de.steamwar.bungeecore.bot.listeners; import de.steamwar.bungeecore.bot.SteamwarDiscordBot; import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig; import de.steamwar.bungeecore.listeners.ChatListener; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.UserGroup; import net.dv8tion.jda.api.MessageBuilder; @@ -50,7 +51,7 @@ public class IngameChatListener extends BasicDiscordListener { event.getMessage().delete().queue(); return; } - if (steamwarUser.isMuted() || steamwarUser.isBanned()) { + if (steamwarUser.isPunished(Punishment.PunishmentType.Mute) || steamwarUser.isPunished(Punishment.PunishmentType.Ban)) { event.getMessage().delete().queue(); return; } diff --git a/src/de/steamwar/bungeecore/commands/BanCommand.java b/src/de/steamwar/bungeecore/commands/BanCommand.java deleted file mode 100644 index 1b3f38d..0000000 --- a/src/de/steamwar/bungeecore/commands/BanCommand.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - This file is a part of the SteamWar software. - - Copyright (C) 2020 SteamWar.de-Serverteam - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ - -package de.steamwar.bungeecore.commands; - -import de.steamwar.bungeecore.Message; -import de.steamwar.bungeecore.sql.SteamwarUser; -import net.md_5.bungee.api.CommandSender; - -import java.sql.Timestamp; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.Instant; -import java.util.Date; - -public class BanCommand extends BasicCommand { - - public BanCommand() { - super("ban", "bungeecore.ban"); - } - - @Override - public void execute(CommandSender sender, String[] args) { - if(args.length < 3){ - Message.send("USAGE_BAN", sender); - return; - } - - SteamwarUser target = unsafeUser(sender, args[0]); - if(target == null) - return; - - Timestamp banTime = parseTime(sender, args[1]); - if(banTime == null) - return; - - StringBuilder banReason = new StringBuilder(); - for (int i = 2; i < args.length; i++){ - banReason.append(args[i]).append(" "); - } - boolean isPerma = args[1].equalsIgnoreCase("perma"); - String msg = banReason.toString(); - target.ban(banTime, msg, SteamwarUser.get(sender.getName()).getId(), isPerma); - Message.team("BAN_TEAM_BANNED", new Message("PREFIX"), target.getUserName(), sender.getName(), new Message((isPerma?"BAN_PERMA":"BAN_UNTIL"), banTime), msg); - } - - public static Timestamp parseTime(CommandSender sender, String arg){ - if(arg.equalsIgnoreCase("perma")) { - return Timestamp.from(Instant.ofEpochSecond(946674800)); - }else{ - SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy_HH:mm"); - try{ - Date parsedDate = dateFormat.parse(arg); - return new java.sql.Timestamp(parsedDate.getTime()); - }catch(ParseException e){ - dateFormat = new SimpleDateFormat("dd.MM.yyyy"); - try{ - Date parsedDate = dateFormat.parse(arg.split("_")[0]); - return new java.sql.Timestamp(parsedDate.getTime()); - }catch(ParseException exception){ - if (sender != null) { - Message.send("INVALID_TIME", sender); - } - return null; - } - } - } - } -} diff --git a/src/de/steamwar/bungeecore/commands/MsgCommand.java b/src/de/steamwar/bungeecore/commands/MsgCommand.java index 8ec0d38..13dbb27 100644 --- a/src/de/steamwar/bungeecore/commands/MsgCommand.java +++ b/src/de/steamwar/bungeecore/commands/MsgCommand.java @@ -22,6 +22,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.IgnoreSystem; +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; @@ -48,8 +49,8 @@ public class MsgCommand extends BasicCommand { } SteamwarUser user = SteamwarUser.get(player); - if(user.isMuted()){ - sender.sendMessage(user.muteMessage(player)); + if (user.isPunished(Punishment.PunishmentType.Mute)) { + sender.sendMessage(user.punishmentMessage(Punishment.PunishmentType.Mute, player)); return; } diff --git a/src/de/steamwar/bungeecore/commands/MuteCommand.java b/src/de/steamwar/bungeecore/commands/MuteCommand.java deleted file mode 100644 index 9ecfde1..0000000 --- a/src/de/steamwar/bungeecore/commands/MuteCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is a part of the SteamWar software. - - Copyright (C) 2020 SteamWar.de-Serverteam - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ - -package de.steamwar.bungeecore.commands; - -import de.steamwar.bungeecore.Message; -import de.steamwar.bungeecore.sql.SteamwarUser; -import net.md_5.bungee.api.CommandSender; - -import java.sql.Timestamp; - -public class MuteCommand extends BasicCommand { - - public MuteCommand() { - super("mute", "bungeecore.ban"); - } - - @Override - public void execute(CommandSender sender, String[] args) { - if(args.length < 3){ - Message.send("USAGE_MUTE", sender); - return; - } - - SteamwarUser target = unsafeUser(sender, args[0]); - if(target == null) - return; - - Timestamp muteTime = BanCommand.parseTime(sender, args[1]); - if(muteTime == null) - return; - - StringBuilder muteReason = new StringBuilder(); - for (int i = 2; i < args.length; i++){ - muteReason.append(args[i]).append(" "); - } - String msg = muteReason.toString(); - target.mute(muteTime, msg, SteamwarUser.get(sender.getName()).getId(), args[1].equalsIgnoreCase("perma")); - Message.team("MUTE_TEAM_MUTED", new Message("PREFIX"), target.getUserName(), sender.getName(), new Message((args[1].equalsIgnoreCase("perma")?"BAN_PERMA":"BAN_UNTIL"), muteTime), msg); - } -} diff --git a/src/de/steamwar/bungeecore/commands/PunishmentCommand.java b/src/de/steamwar/bungeecore/commands/PunishmentCommand.java new file mode 100644 index 0000000..6f425c1 --- /dev/null +++ b/src/de/steamwar/bungeecore/commands/PunishmentCommand.java @@ -0,0 +1,108 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bungeecore.commands; + +import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.sql.Punishment; +import de.steamwar.bungeecore.sql.SteamwarUser; +import net.md_5.bungee.api.CommandSender; + +import java.sql.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.util.Date; + +public class PunishmentCommand { + + public PunishmentCommand(String command, Punishment.PunishmentType punishmentType) { + new BasicCommand(command, "bungeecore.ban") { + @Override + public void execute(CommandSender sender, String[] args) { + if (args.length < 3) { + Message.send("PUNISHMENT_USAGE", sender, command); + return; + } + + SteamwarUser target = unsafeUser(sender, args[0]); + if (target == null) + return; + + Timestamp banTime = parseTime(sender, args[1]); + if (banTime == null) + return; + + StringBuilder reason = new StringBuilder(); + for (int i = 2; i < args.length; i++) { + reason.append(args[i]).append(" "); + } + boolean isPerma = args[1].equalsIgnoreCase("perma"); + String msg = reason.toString(); + target.punish(punishmentType, banTime, msg, SteamwarUser.get(sender.getName()).getId(), isPerma); + Message.team(punishmentType.getTeamMessage(), new Message("PREFIX"), target.getUserName(), sender.getName(), new Message((isPerma ? "PUNISHMENT_PERMA" : "PUNISHMENT_UNTIL"), banTime), msg); + } + }; + String antiCommand = "un" + command; + new BasicCommand(antiCommand, "bungeecore.ban") { + @Override + public void execute(CommandSender sender, String[] args) { + if (args.length < 1) { + Message.send("UNPUNISHMENT_USAGE", sender, antiCommand); + return; + } + + SteamwarUser target = existingUser(sender, args[0]); + if (target == null) + return; + + if (!target.isPunished(punishmentType)) { + Message.send(punishmentType.getUsageNotPunished(), sender); + return; + } + + Message.send(punishmentType.getUnpunishmentMessage(), sender, target.getUserName()); + target.punish(punishmentType, Timestamp.from(new Date().toInstant()), antiCommand, SteamwarUser.get(sender.getName()).getId(), false); + } + }; + } + + public static Timestamp parseTime(CommandSender sender, String arg) { + if (arg.equalsIgnoreCase("perma")) { + return Timestamp.from(Instant.ofEpochSecond(946674800)); + } else { + SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy_HH:mm"); + try { + Date parsedDate = dateFormat.parse(arg); + return new java.sql.Timestamp(parsedDate.getTime()); + } catch (ParseException e) { + dateFormat = new SimpleDateFormat("dd.MM.yyyy"); + try { + Date parsedDate = dateFormat.parse(arg.split("_")[0]); + return new java.sql.Timestamp(parsedDate.getTime()); + } catch (ParseException exception) { + if (sender != null) { + Message.send("INVALID_TIME", sender); + } + return null; + } + } + } + } +} diff --git a/src/de/steamwar/bungeecore/commands/RCommand.java b/src/de/steamwar/bungeecore/commands/RCommand.java index fef0031..7a208db 100644 --- a/src/de/steamwar/bungeecore/commands/RCommand.java +++ b/src/de/steamwar/bungeecore/commands/RCommand.java @@ -22,6 +22,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.IgnoreSystem; +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.connection.ProxiedPlayer; @@ -44,8 +45,8 @@ public class RCommand extends BasicCommand { } SteamwarUser user = SteamwarUser.get(player); - if(user.isMuted()){ - sender.sendMessage(user.muteMessage(player)); + if (user.isPunished(Punishment.PunishmentType.Mute)) { + sender.sendMessage(user.punishmentMessage(Punishment.PunishmentType.Mute, player)); return; } diff --git a/src/de/steamwar/bungeecore/commands/UnbanCommand.java b/src/de/steamwar/bungeecore/commands/UnbanCommand.java deleted file mode 100644 index 176029a..0000000 --- a/src/de/steamwar/bungeecore/commands/UnbanCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - This file is a part of the SteamWar software. - - Copyright (C) 2020 SteamWar.de-Serverteam - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ - -package de.steamwar.bungeecore.commands; - -import de.steamwar.bungeecore.Message; -import de.steamwar.bungeecore.sql.SteamwarUser; -import net.md_5.bungee.api.CommandSender; - -import java.sql.Timestamp; -import java.util.Date; - -public class UnbanCommand extends BasicCommand { - - public UnbanCommand() { - super("unban", "bungeecore.ban"); - } - - @Override - public void execute(CommandSender sender, String[] args) { - if(args.length < 1){ - Message.send("UNBAN_USAGE", sender); - return; - } - - SteamwarUser target = existingUser(sender, args[0]); - if(target == null) - return; - - if(!target.isBanned()) { - Message.send("UNBAN_NOT_BANNED", sender); - return; - } - - Message.send("UNBAN_UNBANNED", sender, target.getUserName()); - target.ban(Timestamp.from(new Date().toInstant()), "Unban", SteamwarUser.get(sender.getName()).getId(), false); - } -} diff --git a/src/de/steamwar/bungeecore/listeners/BanListener.java b/src/de/steamwar/bungeecore/listeners/BanListener.java index 2daabde..195cc19 100644 --- a/src/de/steamwar/bungeecore/listeners/BanListener.java +++ b/src/de/steamwar/bungeecore/listeners/BanListener.java @@ -41,10 +41,10 @@ public class BanListener extends BasicListener { @EventHandler public void onLogin(LoginEvent event) { SteamwarUser user = SteamwarUser.getOrCreate(event.getConnection()); - if(user.isBanned()) { + if (user.isPunished(Punishment.PunishmentType.Ban)) { user.updateBanIP(event.getConnection().getAddress().getAddress().getHostAddress()); event.setCancelled(true); - event.setCancelReason(user.banMessage(ProxyServer.getInstance().getPlayer(event.getConnection().getUniqueId()))); + event.setCancelReason(user.punishmentMessage(Punishment.PunishmentType.Ban, ProxyServer.getInstance().getPlayer(event.getConnection().getUniqueId()))); return; } @@ -55,7 +55,7 @@ public class BanListener extends BasicListener { boolean perma = false; for(BannedUserIPs banned : ips) { SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); - if(bannedUser.isBanned()) { + if (bannedUser.isPunished(Punishment.PunishmentType.Ban)) { Punishment ban = bannedUser.getPunishment(Punishment.PunishmentType.Ban); if(ban.isPerma()) { perma = true; diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index e0e4472..a371a2e 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -21,9 +21,9 @@ package de.steamwar.bungeecore.listeners; import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.bot.SteamwarDiscordBot; -import de.steamwar.bungeecore.bot.listeners.IngameChatListener; import de.steamwar.bungeecore.commands.TpCommand; import de.steamwar.bungeecore.comms.packets.PingPacket; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.Team; import de.steamwar.bungeecore.sql.UserGroup; @@ -145,8 +145,8 @@ public class ChatListener extends BasicListener { } SteamwarUser user = SteamwarUser.get(sender); - if(user.isMuted()){ - sender.sendMessage(user.muteMessage(sender)); + if (user.isPunished(Punishment.PunishmentType.Mute)) { + sender.sendMessage(user.punishmentMessage(Punishment.PunishmentType.Mute, sender)); e.setCancelled(true); return; } @@ -224,8 +224,8 @@ public class ChatListener extends BasicListener { } SteamwarUser user = SteamwarUser.get(sender); - if(user.isMuted()){ - sender.sendMessage(user.muteMessage(sender)); + if (user.isPunished(Punishment.PunishmentType.Mute)) { + sender.sendMessage(user.punishmentMessage(Punishment.PunishmentType.Mute, sender)); e.setCancelled(true); return; } diff --git a/src/de/steamwar/bungeecore/listeners/mods/Utils.java b/src/de/steamwar/bungeecore/listeners/mods/Utils.java index e6907c5..9ed160a 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/Utils.java +++ b/src/de/steamwar/bungeecore/listeners/mods/Utils.java @@ -23,6 +23,7 @@ import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.Mod; import de.steamwar.bungeecore.sql.Mod.ModType; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -75,7 +76,7 @@ class Utils { if(max == ModType.YELLOW) player.disconnect(BungeeCore.stringToText(Message.parse("MOD_YELLOW_SING", player, mods.get(0).getModName()))); else{ - user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), Message.parse("MOD_RED_SING", player, mods.get(0).getModName()), 0, false); + user.punish(Punishment.PunishmentType.Ban, Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), Message.parse("MOD_RED_SING", player, mods.get(0).getModName()), 0, false); BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen des Mods " + mods.get(0).getModName() + " gebannt."); } }else{ @@ -85,7 +86,7 @@ class Utils { if(max == ModType.YELLOW) player.disconnect(BungeeCore.stringToText(Message.parse("MOD_YELLOW_PLUR", player, sb.toString()))); else{ - user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), Message.parse("MOD_RED_PLUR", player, sb.toString()), 0, false); + user.punish(Punishment.PunishmentType.Ban, Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), Message.parse("MOD_RED_PLUR", player, sb.toString()), 0, false); BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen der Mods " + sb.toString() + " gebannt."); } } diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index 914e6b8..0bd0962 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -19,9 +19,8 @@ package de.steamwar.bungeecore.sql; -import de.steamwar.bungeecore.BungeeCore; -import de.steamwar.bungeecore.Message; -import net.md_5.bungee.api.connection.ProxiedPlayer; +import lombok.AllArgsConstructor; +import lombok.Getter; import java.sql.ResultSet; import java.sql.SQLException; @@ -39,7 +38,7 @@ public class Punishment { public static Punishment getPunishmentOfPlayer(int user, PunishmentType type) { return getPunishment.select(rs -> { - if(rs.next()) + if (rs.next()) return new Punishment(rs); return null; }, user, type.name()); @@ -116,35 +115,34 @@ public class Punishment { return perma; } - public void updateEndTime(int from, String newreason, Timestamp newUpdate, boolean perma) { - if(newreason.equals(reason) && newUpdate.equals(endTime) && this.perma == perma) - return; - ProxiedPlayer player = BungeeCore.get().getProxy().getPlayer(SteamwarUser.get(from).getUuid()); - String newReason = Message.parse("BAN_CHANGED", player, reason, - SteamwarUser.get(from).getUserName(), - getBantime(endTime, this.perma), - getBantime(newUpdate, perma), - newreason); - - update.update(newUpdate, newReason, perma, id); - this.reason = newReason; - this.perma = perma; - this.endTime = newUpdate; - } - public String getBantime(Timestamp endTime, boolean perma) { - if(perma) + if (perma) { return "permanent"; - else + } else { return endTime.toLocalDateTime().format(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")); + } } public boolean isCurrent() { return isPerma() || getEndTime().after(new Date()); } + @AllArgsConstructor + @Getter public enum PunishmentType { - Ban, - Mute; + Ban("BAN_TEAM_BANNED", "BANNED_MESSAGE_PERMA", "BANNED_MESSAGE_UNTIL", "UNBAN_NOT_BANNED", "UNBAN_UNBANNED"), + Mute( "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"), + AntiSchemAdd("ANTISCHEMADD_TEAM_ANTISCHEMADD", "ANTISCHEMADD_MESSAGE_PERMA", "ANTISCHEMADD_MESSAGE_UNTIL", "UNANTISCHEMADD_NOT_ANTISCHEMADD", "UNANTISCHEMADD_UNANTISCHEMADDED"), + AntiSchemAdded("ANTISCHEMADDED_TEAM_ANTISCHEMADDED", "ANTISCHEMADDED_MESSAGE_PERMA", "ANTISCHEMADDED_MESSAGE_UNTIL", "UNANTISCHEMADDED_NOT_ANTISCHEMADDED", "UNANTISCHEMADDED_UNANTISCHEMADDED"), + // AntiSchemDownload("UNANTISCHEMDOWNLOAD_NOT_ANTISCHEMDOWNLOADED"), + // AntiSchemUpload("UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED"), + // AntiBauJoin("UNANTIBAUJOIN_NOT_ANTIBAUJOINED"); + ; + + private String teamMessage; + private String playerMessagePerma; + private String playerMessageUntil; + private String usageNotPunished; + private String unpunishmentMessage; } } diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index 67c3596..f83d76c 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -97,25 +97,27 @@ public class SteamwarUser { usersById.put(id, this); usersByName.put(userName.toLowerCase(), this); usersByUUID.put(uuid, this); - if(discordId != null) + if (discordId != null) { usersByDiscord.put(discordId, this); + } punishments = Punishment.getPunishmentsOfPlayer(id); } - public static SteamwarUser getOrCreate(PendingConnection connection){ + public static SteamwarUser getOrCreate(PendingConnection connection) { SteamwarUser user = SteamwarUser.get(connection.getUniqueId()); - if(user != null){ + if (user != null) { String userName = connection.getName(); - if(!user.userName.equals(userName)){ + if (!user.userName.equals(userName)) { updateName.update(userName, user.id); WebregisterCommand.changeUsername(user.userName, userName); user.userName = userName; } - }else{ + } else { user = SteamwarUser.createUserInDatabase(connection.getUniqueId(), connection.getName()); - if(user == null) + if (user == null) { throw new SecurityException("user == null"); + } ConnectionListener.newPlayer(user.uuid); } @@ -124,7 +126,7 @@ public class SteamwarUser { return user; } - public static SteamwarUser getOrCreateOfflinePlayer(String name){ + public static SteamwarUser getOrCreateOfflinePlayer(String name) { SteamwarUser user = SteamwarUser.get(name); if (user != null) { return user; @@ -143,34 +145,37 @@ public class SteamwarUser { return get(uuid); } - public static SteamwarUser get(String userName){ + public static SteamwarUser get(String userName) { userName = userName.toLowerCase(); - if(usersByName.containsKey(userName)) + if (usersByName.containsKey(userName)) { return usersByName.get(userName); + } return byName.select(rs -> { - if(rs.next()) + if (rs.next()) return new SteamwarUser(rs); return null; }, userName); } - public static SteamwarUser get(UUID uuid){ - if(usersByUUID.containsKey(uuid)) + public static SteamwarUser get(UUID uuid) { + if (usersByUUID.containsKey(uuid)) { return usersByUUID.get(uuid); + } return byUUID.select(rs -> { - if(rs.next()) + if (rs.next()) return new SteamwarUser(rs); return null; }, uuid.toString()); } - public static SteamwarUser get(ProxiedPlayer player){ + public static SteamwarUser get(ProxiedPlayer player) { return get(player.getUniqueId()); } - public static SteamwarUser get(int id){ - if(usersById.containsKey(id)) + public static SteamwarUser get(int id) { + if (usersById.containsKey(id)) { return usersById.get(id); + } return byID.select(rs -> { rs.next(); return new SteamwarUser(rs); @@ -178,16 +183,16 @@ public class SteamwarUser { } public static SteamwarUser get(Long discordId) { - if(usersByDiscord.containsKey(discordId.toString())) + if (usersByDiscord.containsKey(discordId.toString())) return usersByDiscord.get(discordId.toString()); return byDiscord.select(rs -> { - if(rs.next()) + if (rs.next()) return new SteamwarUser(rs); return null; }, discordId); } - public static void clearCache(){ + public static void clearCache() { usersById.clear(); usersByName.clear(); usersByUUID.clear(); @@ -205,7 +210,7 @@ public class SteamwarUser { } } - public void setTeam(int team){ + public void setTeam(int team) { this.team = team; updateTeam.update(team, id); setLeader(false); @@ -227,7 +232,7 @@ public class SteamwarUser { return userGroup; } - public int getTeam(){ + public int getTeam() { return team; } @@ -243,89 +248,64 @@ public class SteamwarUser { usersByDiscord.remove(this.discordId); this.discordId = discordId; updateDiscord.update(discordId, id); - if(discordId != null) { + if (discordId != null) { usersByDiscord.put(discordId, this); } } - public boolean isBanned() { - if(!punishments.containsKey(Punishment.PunishmentType.Ban)) + public boolean isPunished(Punishment.PunishmentType punishment) { + if (!punishments.containsKey(punishment)) { return false; - if(!punishments.get(Punishment.PunishmentType.Ban).isCurrent()) { - deleteIPs.update(id); - punishments.remove(Punishment.PunishmentType.Ban); + } + if (!punishments.get(punishment).isCurrent()) { + if (punishment == Punishment.PunishmentType.Ban) { + deleteIPs.update(id); + } + punishments.remove(punishment); return false; } return true; } - public boolean isMuted(){ - if(!punishments.containsKey(Punishment.PunishmentType.Mute)) - return false; - if(!punishments.get(Punishment.PunishmentType.Mute).isCurrent()) { - punishments.remove(Punishment.PunishmentType.Mute); - return false; - } - return true; - } + public void punish(Punishment.PunishmentType punishment, Timestamp time, String banReason, int from, boolean perma) { + punishments.remove(punishment); + punishments.put(punishment, Punishment.createPunishment(id, from, punishment, banReason, time, perma)); - public TextComponent banMessage(ProxiedPlayer player){ - Punishment punishment = punishments.get(Punishment.PunishmentType.Ban); - if (punishment.isPerma()) { - return BungeeCore.stringToText(Message.parsePrefixed("BANNED_MESSAGE_PERMA", player, punishment.getReason())); - } else { - return BungeeCore.stringToText(Message.parsePrefixed("BANNED_MESSAGE_UNTIL", player, punishment.getEndTime().toLocalDateTime().format(DateTimeFormatter.ofPattern(Message.parse("TIMEFORMAT", player))), - punishment.getReason())); - } - } - - public TextComponent muteMessage(ProxiedPlayer player){ - Punishment punishment = punishments.get(Punishment.PunishmentType.Mute); - if (punishment.isPerma()) { - return BungeeCore.stringToText(Message.parsePrefixed("MUTED_MESSAGE_PERMA", player, punishment.getReason())); - } else { - return BungeeCore.stringToText(Message.parsePrefixed("MUTED_MESSAGE_UNTIL", player, punishment.getEndTime().toLocalDateTime().format(DateTimeFormatter.ofPattern(Message.parse("TIMEFORMAT", player))), punishment.getReason())); - } - } - - public void updateBanIP(String ip){ - BannedUserIPs.banIP(this, ip); - } - - public void ban(Timestamp time, String banReason, int from, boolean perma){ - if(isBanned()) { - punishments.get(Punishment.PunishmentType.Ban).updateEndTime(from, banReason, time, perma); + if (punishment != Punishment.PunishmentType.Ban) { return; } - punishments.remove(Punishment.PunishmentType.Ban); - punishments.put(Punishment.PunishmentType.Ban, Punishment.createPunishment(id, from, Punishment.PunishmentType.Ban, banReason, time, perma)); ProxiedPlayer player = ProxyServer.getInstance().getPlayer(uuid); - if(player != null){ + if (player != null) { updateBanIP(player.getAddress().getAddress().getHostAddress()); - player.disconnect(banMessage(player)); - for (BannedUserIPs banned: - BannedUserIPs.get(player.getAddress().getAddress().getHostAddress())) { + player.disconnect(punishmentMessage(punishment, player)); + for (BannedUserIPs banned : BannedUserIPs.get(player.getAddress().getAddress().getHostAddress())) { SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); - if(bannedUser.isBanned() && banned.getTimestamp().before(time)) - bannedUser.ban(time, banReason, from, perma); + if (isPunished(punishment) && banned.getTimestamp().before(time)) { + bannedUser.punish(punishment, time, banReason, from, perma); + } } - }else + } else { updateBanIP(""); + } } - public void mute(Timestamp time, String muteReason, int from, boolean perma){ - if(isMuted()) { - punishments.get(Punishment.PunishmentType.Mute).updateEndTime(from, muteReason, time, perma); - return; + public TextComponent punishmentMessage(Punishment.PunishmentType punishment, ProxiedPlayer player) { + Punishment currentPunishment = punishments.get(punishment); + if (currentPunishment.isPerma()) { + return BungeeCore.stringToText(Message.parsePrefixed(punishment.getPlayerMessagePerma(), player, currentPunishment.getReason())); + } else { + return BungeeCore.stringToText(Message.parsePrefixed(punishment.getPlayerMessageUntil(), player, currentPunishment.getEndTime().toLocalDateTime().format(DateTimeFormatter.ofPattern(Message.parse("TIMEFORMAT", player))), currentPunishment.getReason())); } - punishments.remove(Punishment.PunishmentType.Mute); - punishments.put(Punishment.PunishmentType.Mute, Punishment.createPunishment(id, from, Punishment.PunishmentType.Mute, muteReason, time, perma)); + } + + public void updateBanIP(String ip) { + BannedUserIPs.banIP(this, ip); } public double getOnlinetime() { return getPlaytime.select(rs -> { - if(rs.next()) + if (rs.next()) return rs.getBigDecimal("Playtime").doubleValue(); return 0.0; }, id); @@ -333,7 +313,7 @@ public class SteamwarUser { public Timestamp getFirstjoin() { return getFirstjoin.select(rs -> { - if(rs.next()) + if (rs.next()) return rs.getTimestamp("FirstJoin"); return null; }, id); diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 5d32af1..7632238 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -95,8 +95,6 @@ HELP_BAU_TESTARENA_HOVER=§eTestarena starten #Usage description of various commands USAGE_ALERT=§8/§7alert §8[§eNachricht§8] -USAGE_BAN=§8/§7ban §8[§eSpieler§8] [§edd§8.§emm§8.§eyyyy §7oder §edd§8.§emm§8.§eyyyy§8_§ehh§8:§emm §7oder §eperma§8] [§eGrund§8] -USAGE_MUTE=§8/§7mute §8[§eSpieler§8] [§edd§8.§emm§8.§eyyyy §7oder §edd§8.§emm§8.§eyyyy§8_§ehh§8:§emm §7oder §eperma§8] [§eGrund§8] USAGE_IGNORE=§8/§7ignore §8[§eSpieler§8] #ModListener @@ -110,21 +108,50 @@ ALERT=§f{0} STAT_SERVER=§7Server §e{0}§8: §7Load §e{1} §7Serveranzahl §e{2} #Ban&Mute-Command -BAN_TEAM_BANNED={0} §c{1} wurde von {2} {3} gebannt. §f§lGrund: §f{4} +PUNISHMENT_USAGE=§8/§7{0} §8[§eSpieler§8] [§edd§8.§emm§8.§eyyyy §7oder §edd§8.§emm§8.§eyyyy§8_§ehh§8:§emm §7oder §eperma§8] [§eGrund§8] +UNPUNISHMENT_USAGE=§8/§7{0} §8[§eSpieler§8] + +PUNISHMENT_UNTIL=bis zum {0} +PUNISHMENT_PERMA=permanent + +BAN_TEAM_BANNED={0} §c{1} wurde von {2} {3} gebannt. §f§lGrund§r: §f{4} BANNED_MESSAGE_PERMA=§cDu bist permanent gebannt. §r§lGrund§r: §c{0} BANNED_MESSAGE_UNTIL=§cDu bist bis zum {0} gebannt. §r§lGrund§r: §c{1} -MUTE_TEAM_MUTED={0} §c{1} wurde von {2} {3} gemuted. §f§lGrund: §f{4} +UNBAN_NOT_BANNED=§cDer Spieler ist nicht gebannt. +UNBAN_UNBANNED=Du hast {0} entbannt. + +MUTE_TEAM_MUTED={0} §c{1} wurde von {2} {3} gemuted. §f§lGrund§r: §f{4} MUTED_MESSAGE_PERMA=§cDu bist permanent gemuted. §r§lGrund§r: §c{0} MUTED_MESSAGE_UNTIL=§cDu bist bis zum {0} gemuted. §r§lGrund§r: §c{1} -BAN_CHANGED={0}verändert von {1} von {2} auf {3} wegen {4} -BAN_PERMA=permanent -BAN_UNTIL=bis zum {0} +UNMUTE_NOT_MUTED=§cDer Spieler ist nicht gemutet. +UNMUTE_UNMUTED=Du hast {0} entmutet. + +ANTISCHEMADD_TEAM_ANTISCHEMADD={0} §c{1} wurde von {2} {3} schem adden ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADD_MESSAGE_PERMA=§cDu bist permanent vom schem adden ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem adden ausgeschlossen. §f§lGrund§r: §f{4} +UNANTISCHEMADD_NOT_ANTISCHEMADD=§cDer Spieler ist nicht vom schem adden ausgeschlossen. +UNANTISCHEMADD_UNANTISCHEMADDED=Du hast {0} das schem adden zurückgegeben. + +ANTISCHEMADDED_TEAM_ANTISCHEMADDED={0} §c{1} wurde von {2} {3} schem add ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADDED_MESSAGE_PERMA=§cDu bist permanent vom schem add ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADDED_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem add ausgeschlossen. §f§lGrund§r: §f{4} +UNANTISCHEMADDED_NOT_ANTISCHEMADDED=§cDer Spieler ist nicht vom schem add ausgeschlossen. +UNANTISCHEMADDED_UNANTISCHEMADDED=Du hast {0} das schem add zurückgegeben. + +UNANTISCHEMDOWNLOAD_NOT_ANTISCHEMDOWNLOADED=§cDer Spieler ist nicht ausgeschlossen Schematics runterzuladen. + +UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED=§cDer Spieler ist nicht ausgeschlossen Schematics hochzuladen. + +UNANTIBAUJOIN_NOT_ANTIBAUJOINED=§cDer Spieler ist nicht vom joinen von Baus ausgeschlossen. + BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: §c BAN_AVOIDING_LIST={0} §e{1} §c BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung +#BugCommand BUG_MESSAGE=§7Dein Bugreport wurde gespeichert. +#IgnoreCommand IGNORE_YOURSELF=§cWie willst du dich selber ignorieren? IGNORE_ALREADY=§cDu ignorierst diesen Spieler bereits. IGNORE_MESSAGE=§7Du ignorierst nun §e{0}§8. @@ -423,11 +450,6 @@ TP_USAGE=§8/§7tp §8[§eSpieler§8] TP_USAGE_EVENT=§8/§7tp §8[§eSpieler §7oder §eTeam§8] TP_NOT_FOUND=§cKonnte das angegebene Ziel nicht finden. -#UnbanCommand -UNBAN_USAGE=§8/§7unban §8[§eSpieler§8] -UNBAN_NOT_BANNED=§cDer Spieler ist nicht gebannt. -UNBAN_UNBANNED=Du hast {0} entbannt. - #UnignoreCommand UNIGNORE_USAGE=§8/§7unignore §8[§eSpieler§8] UNIGNORE_NOT_PLAYER=§cDiesen Spieler gibt es nicht! From b5a9ecc9997ebde7a1af6c8790b7a6d236357c92 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 26 Sep 2021 23:36:41 +0200 Subject: [PATCH 02/13] Remove unintended imports --- src/de/steamwar/bungeecore/BungeeCore.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 2a725a6..accae59 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -20,9 +20,6 @@ package de.steamwar.bungeecore; import de.steamwar.bungeecore.bot.SteamwarDiscordBot; -import de.steamwar.bungeecore.bot.commands.BanCommand; -import de.steamwar.bungeecore.bot.commands.MuteCommand; -import de.steamwar.bungeecore.bot.commands.UnbanCommand; import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig; import de.steamwar.bungeecore.commands.*; import de.steamwar.bungeecore.comms.SpigotReceiver; @@ -111,8 +108,6 @@ public class BungeeCore extends Plugin { new JoinmeCommand(); new TpCommand(); new HelpCommand(); - new BanCommand(); - new UnbanCommand(); new DenyCommand("watchcat", "wc"); new TeamCommand(); new ServerTeamchatCommand(); @@ -121,7 +116,6 @@ public class BungeeCore extends Plugin { new EventreloadCommand(); new EventRescheduleCommand(); new PollCommand(); - new MuteCommand(); new BugCommand(); new WhoisCommand(); new RegelnCommand(); From a886936cf3f2b44c3c92b00e375fd237c29731b7 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 26 Sep 2021 23:38:43 +0200 Subject: [PATCH 03/13] Add grouping to messages --- src/de/steamwar/messages/BungeeCore.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 7632238..bcf0b15 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -120,6 +120,10 @@ BANNED_MESSAGE_UNTIL=§cDu bist bis zum {0} gebannt. §r§lGrund§r: §c{1} UNBAN_NOT_BANNED=§cDer Spieler ist nicht gebannt. UNBAN_UNBANNED=Du hast {0} entbannt. +BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: §c +BAN_AVOIDING_LIST={0} §e{1} §c +BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung + MUTE_TEAM_MUTED={0} §c{1} wurde von {2} {3} gemuted. §f§lGrund§r: §f{4} MUTED_MESSAGE_PERMA=§cDu bist permanent gemuted. §r§lGrund§r: §c{0} MUTED_MESSAGE_UNTIL=§cDu bist bis zum {0} gemuted. §r§lGrund§r: §c{1} @@ -144,10 +148,6 @@ UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED=§cDer Spieler ist nicht ausgeschlossen UNANTIBAUJOIN_NOT_ANTIBAUJOINED=§cDer Spieler ist nicht vom joinen von Baus ausgeschlossen. -BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: §c -BAN_AVOIDING_LIST={0} §e{1} §c -BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung - #BugCommand BUG_MESSAGE=§7Dein Bugreport wurde gespeichert. From 0b6b2c6b6b3158fe2ad06849d580bfb7ad1a2bbe Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 27 Sep 2021 08:47:56 +0200 Subject: [PATCH 04/13] Update Punishments and commands for each punishment --- src/de/steamwar/bungeecore/BungeeCore.java | 6 +++ .../steamwar/bungeecore/sql/Punishment.java | 8 ++-- .../steamwar/messages/BungeeCore.properties | 38 ++++++++++++++----- 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index accae59..ae333db 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -131,6 +131,12 @@ public class BungeeCore extends Plugin { // Punishment Commands: new PunishmentCommand("ban", Punishment.PunishmentType.Ban); new PunishmentCommand("mute", Punishment.PunishmentType.Mute); + new PunishmentCommand("antischemadd", Punishment.PunishmentType.AntiSchemAdd); + new PunishmentCommand("antischemadded", Punishment.PunishmentType.AntiSchemAdded); + new PunishmentCommand("antischemdownload", Punishment.PunishmentType.AntiSchemDownload); + new PunishmentCommand("antischemupload", Punishment.PunishmentType.AntiSchemUpload); + new PunishmentCommand("antibaujoin", Punishment.PunishmentType.AntiBauJoin); + new PunishmentCommand("antifightjoin", Punishment.PunishmentType.AntiFightJoin); if(!EVENT_MODE){ new BauCommand(); diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index 0bd0962..0352bbb 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -134,10 +134,10 @@ public class Punishment { Mute( "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"), AntiSchemAdd("ANTISCHEMADD_TEAM_ANTISCHEMADD", "ANTISCHEMADD_MESSAGE_PERMA", "ANTISCHEMADD_MESSAGE_UNTIL", "UNANTISCHEMADD_NOT_ANTISCHEMADD", "UNANTISCHEMADD_UNANTISCHEMADDED"), AntiSchemAdded("ANTISCHEMADDED_TEAM_ANTISCHEMADDED", "ANTISCHEMADDED_MESSAGE_PERMA", "ANTISCHEMADDED_MESSAGE_UNTIL", "UNANTISCHEMADDED_NOT_ANTISCHEMADDED", "UNANTISCHEMADDED_UNANTISCHEMADDED"), - // AntiSchemDownload("UNANTISCHEMDOWNLOAD_NOT_ANTISCHEMDOWNLOADED"), - // AntiSchemUpload("UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED"), - // AntiBauJoin("UNANTIBAUJOIN_NOT_ANTIBAUJOINED"); - ; + AntiSchemDownload("ANTISCHEMDOWNLOAD_TEAM_ANTISCHEMDOWNLOADED", "ANTISCHEMDOWNLOAD_MESSAGE_PERMA", "ANTISCHEMDOWNLOAD_MESSAGE_UNTIL", "UNANTISCHEMDOWNLOAD_NOT_ANTISCHEMDOWNLOADED", "UNANTISCHEMDOWNLOAD_UNANTISCHEMDOWNLOADED"), + AntiSchemUpload("ANTISCHEMUPLOAD_TEAM_ANTISCHEMUPLOADED", "ANTISCHEMUPLOAD_MESSAGE_PERMA", "ANTISCHEMUPLOAD_MESSAGE_UNTIL", "UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED", "UNANTISCHEMUPLOAD_ANTISCHEMUPLOADED"), + AntiBauJoin("ANTIBAUJOIN_TEAM_ANTIBAUJOINED", "ANTIBAUJOIN_MESSAGE_PERMA", "ANTIBAUJOIN_MESSAGE_UNTIL", "UNANTIBAUJOIN_NOT_ANTIBAUJOINED", "UNANTIBAUJOIN_ANTIBAUJOINED"), + AntiFightJoin("ANTIFIGHTJOIN_TEAM_ANTIFIGHTJOINED", "ANTIFIGHTJOIN_MESSAGE_PERMA", "ANTIFIGHTJOIN_MESSAGE_UNTIL", "UNANTIFIGHTJOIN_NOT_ANTIFIGHTJOINED", "UNANTIFIGHTJOIN_ANTIFIGHTJOINED"); private String teamMessage; private String playerMessagePerma; diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index bcf0b15..a98c5e5 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -130,23 +130,41 @@ MUTED_MESSAGE_UNTIL=§cDu bist bis zum {0} gemuted. §r§lGrund§r: §c{1} UNMUTE_NOT_MUTED=§cDer Spieler ist nicht gemutet. UNMUTE_UNMUTED=Du hast {0} entmutet. -ANTISCHEMADD_TEAM_ANTISCHEMADD={0} §c{1} wurde von {2} {3} schem adden ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADD_MESSAGE_PERMA=§cDu bist permanent vom schem adden ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem adden ausgeschlossen. §f§lGrund§r: §f{4} -UNANTISCHEMADD_NOT_ANTISCHEMADD=§cDer Spieler ist nicht vom schem adden ausgeschlossen. -UNANTISCHEMADD_UNANTISCHEMADDED=Du hast {0} das schem adden zurückgegeben. +ANTISCHEMADD_TEAM_ANTISCHEMADD={0} §c{1} wurde von {2} {3} schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADD_MESSAGE_PERMA=§cDu bist permanent vom schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{4} +UNANTISCHEMADD_NOT_ANTISCHEMADD=§cDer Spieler ist nicht vom schem geaddet werden ausgeschlossen. +UNANTISCHEMADD_UNANTISCHEMADDED=Du hast {0} das schem geaddet werden zurückgegeben. -ANTISCHEMADDED_TEAM_ANTISCHEMADDED={0} §c{1} wurde von {2} {3} schem add ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADDED_MESSAGE_PERMA=§cDu bist permanent vom schem add ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADDED_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem add ausgeschlossen. §f§lGrund§r: §f{4} -UNANTISCHEMADDED_NOT_ANTISCHEMADDED=§cDer Spieler ist nicht vom schem add ausgeschlossen. -UNANTISCHEMADDED_UNANTISCHEMADDED=Du hast {0} das schem add zurückgegeben. +ANTISCHEMADDED_TEAM_ANTISCHEMADDED={0} §c{1} wurde von {2} {3} schem adden ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADDED_MESSAGE_PERMA=§cDu bist permanent vom schem adden ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADDED_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem adden ausgeschlossen. §f§lGrund§r: §f{4} +UNANTISCHEMADDED_NOT_ANTISCHEMADDED=§cDer Spieler ist nicht vom schem adden ausgeschlossen. +UNANTISCHEMADDED_UNANTISCHEMADDED=Du hast {0} das schem adden wiederhergestellt. +ANTISCHEMDOWNLOAD_TEAM_ANTISCHEMDOWNLOADED={0} §c{1} wurde von {2} {3} schem download ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMDOWNLOAD_MESSAGE_PERMA=§cDu bist permanent vom schem download ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMDOWNLOAD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem download ausgeschlossen. §f§lGrund§r: §f{4} UNANTISCHEMDOWNLOAD_NOT_ANTISCHEMDOWNLOADED=§cDer Spieler ist nicht ausgeschlossen Schematics runterzuladen. +UNANTISCHEMDOWNLOAD_UNANTISCHEMDOWNLOADED=Du hast {0} das schem downloaden wiederhergestellt. +ANTISCHEMUPLOAD_TEAM_ANTISCHEMUPLOADED={0} §c{1} wurde von {2} {3} schem upload ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMUPLOAD_MESSAGE_PERMA=§cDu bist permanent vom schem upload ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMUPLOAD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem upload ausgeschlossen. §f§lGrund§r: §f{4} UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED=§cDer Spieler ist nicht ausgeschlossen Schematics hochzuladen. +UNANTISCHEMUPLOAD_ANTISCHEMUPLOADED=Du hast {0} das schem upload wiederhergestellt. +ANTIBAUJOIN_TEAM_ANTIBAUJOINED={0} §c{1} wurde von {2} {3} joinen von Baus ausgeschlossen. §f§lGrund§r: §f{4} +ANTIBAUJOIN_MESSAGE_PERMA=§cDu bist permanent vom joinen von Baus ausgeschlossen. §f§lGrund§r: §f{4} +ANTIBAUJOIN_MESSAGE_UNTIL=§cDu bist bis zum {0} vom joinen von Baus ausgeschlossen. §f§lGrund§r: §f{4} UNANTIBAUJOIN_NOT_ANTIBAUJOINED=§cDer Spieler ist nicht vom joinen von Baus ausgeschlossen. +UNANTIBAUJOIN_ANTIBAUJOINED=Du hast {0} das joinen von Baus wiederhergestellt. + +ANTIFIGHTJOIN_TEAM_ANTIFIGHTJOINED={0} §c{1} wurde von {2} {3} joinen von Fights ausgeschlossen. §f§lGrund§r: §f{4} +ANTIFIGHTJOIN_MESSAGE_PERMA=§cDu bist permanent vom joinen von Fights ausgeschlossen. §f§lGrund§r: §f{4} +ANTIFIGHTJOIN_MESSAGE_UNTIL=§cDu bist bis zum {0} vom joinen von Fights ausgeschlossen. §f§lGrund§r: §f{4} +UNANTIFIGHTJOIN_NOT_ANTIFIGHTJOINED=§cDer Spieler ist nicht vom joinen von Fights ausgeschlossen. +UNANTIFIGHTJOIN_ANTIFIGHTJOINED=Du hast {0} das joinen von Fights wiederhergestellt. #BugCommand BUG_MESSAGE=§7Dein Bugreport wurde gespeichert. From bb9627b74c62845ea16ddc9b7e436cd5297be3aa Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 27 Sep 2021 09:29:51 +0200 Subject: [PATCH 05/13] Add punishment implementations --- src/de/steamwar/bungeecore/BungeeCore.java | 8 ++++-- src/de/steamwar/bungeecore/Node.java | 3 +++ .../bot/config/SteamwarDiscordBotConfig.java | 2 ++ .../bungeecore/commands/BauCommand.java | 10 ++++++- .../bungeecore/commands/ChallengeCommand.java | 8 ++++++ .../bungeecore/commands/DevCommand.java | 9 +++++++ .../bungeecore/commands/FightCommand.java | 8 ++++++ .../bungeecore/commands/HistoricCommand.java | 9 +++++++ .../bungeecore/commands/MsgCommand.java | 3 +-- .../commands/PunishmentCommand.java | 3 +++ .../bungeecore/commands/RCommand.java | 3 +-- .../bungeecore/commands/RankedCommand.java | 14 ++++++++-- .../bungeecore/listeners/ChatListener.java | 6 ++--- .../listeners/ConnectionListener.java | 26 ++++++++++++++++--- .../steamwar/bungeecore/sql/Punishment.java | 1 - .../steamwar/bungeecore/sql/SteamwarUser.java | 8 ++++++ 16 files changed, 103 insertions(+), 18 deletions(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index ae333db..23660f8 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -162,7 +162,9 @@ public class BungeeCore extends Plugin { Team.clearCache(); }, 1, 1, TimeUnit.HOURS); - new SteamwarDiscordBot(); + if (SteamwarDiscordBotConfig.loaded) { + new SteamwarDiscordBot(); + } } @Override @@ -275,7 +277,9 @@ public class BungeeCore extends Plugin { ); ArenaMode.init(config.getSection("games")); - SteamwarDiscordBotConfig.loadConfig(config.getSection("discord")); + if (config.getSection("discord") != null) { + SteamwarDiscordBotConfig.loadConfig(config.getSection("discord")); + } final Configuration servers = config.getSection("servers"); for(final String serverName : servers.getKeys()){ diff --git a/src/de/steamwar/bungeecore/Node.java b/src/de/steamwar/bungeecore/Node.java index ea0a2ed..c5bed1e 100644 --- a/src/de/steamwar/bungeecore/Node.java +++ b/src/de/steamwar/bungeecore/Node.java @@ -194,6 +194,9 @@ public abstract class Node { } catch (IOException e) { BungeeCore.get().getLogger().log(Level.SEVERE, "Could not read cores of" + remote, e); c = 1; + } catch (NumberFormatException e) { + BungeeCore.get().getLogger().log(Level.SEVERE, "Could not read cores of" + remote, e); + c = 1; } cores = c; BungeeCore.get().getLogger().log(Level.INFO, "Adding node " + remote + " with " + cores + " cores."); diff --git a/src/de/steamwar/bungeecore/bot/config/SteamwarDiscordBotConfig.java b/src/de/steamwar/bungeecore/bot/config/SteamwarDiscordBotConfig.java index f69a3ac..34c65e8 100644 --- a/src/de/steamwar/bungeecore/bot/config/SteamwarDiscordBotConfig.java +++ b/src/de/steamwar/bungeecore/bot/config/SteamwarDiscordBotConfig.java @@ -29,6 +29,7 @@ import java.util.Map; public class SteamwarDiscordBotConfig { + public static boolean loaded = false; public static String TOKEN; public static String GUILD; public static String ANNOUNCEMENTS_CHANNEL; @@ -110,5 +111,6 @@ public class SteamwarDiscordBotConfig { for (String type : ranksSections.getKeys()) { RANKS.put(UserGroup.getUsergroup(type), ranksSections.getString(type)); } + loaded = true; } } diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index 2965f08..ae8282c 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -24,6 +24,7 @@ import de.steamwar.bungeecore.comms.packets.BaumemberUpdatePacket; import de.steamwar.bungeecore.inventory.SWInventory; import de.steamwar.bungeecore.inventory.SWItem; import de.steamwar.bungeecore.sql.BauweltMember; +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; @@ -38,8 +39,15 @@ public class BauCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!(sender instanceof ProxiedPlayer)) + if(!(sender instanceof ProxiedPlayer)) { return; + } + + ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; + SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); + if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiBauJoin)) { + return; + } ProxiedPlayer p = (ProxiedPlayer) sender; diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 3d4150d..03a8a3d 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -22,6 +22,8 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; import de.steamwar.bungeecore.sql.IgnoreSystem; +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.chat.ClickEvent; @@ -39,6 +41,12 @@ public class ChallengeCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { + ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; + SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); + if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiFightJoin)) { + return; + } + if(args.length < 1){ Message.send("CHALLENGE_USAGE", sender); return; diff --git a/src/de/steamwar/bungeecore/commands/DevCommand.java b/src/de/steamwar/bungeecore/commands/DevCommand.java index dcc4b7f..6fafeee 100644 --- a/src/de/steamwar/bungeecore/commands/DevCommand.java +++ b/src/de/steamwar/bungeecore/commands/DevCommand.java @@ -20,6 +20,8 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.Message; +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; @@ -45,6 +47,13 @@ public class DevCommand extends BasicCommand { if (!(sender instanceof ProxiedPlayer)) { return; } + + ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; + SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); + if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiBauJoin)) { + return; + } + String[] devServer = DevServerDir.list(); if (devServer == null || devServer.length == 0) { Message.send("DEV_NO_SERVER", sender); diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 984bc06..878e5af 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; @@ -163,6 +165,12 @@ public class FightCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { + ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; + SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); + if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiFightJoin)) { + return; + } + createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> { Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), null, false); arena.sendPlayer(player); diff --git a/src/de/steamwar/bungeecore/commands/HistoricCommand.java b/src/de/steamwar/bungeecore/commands/HistoricCommand.java index ebf9312..f727590 100644 --- a/src/de/steamwar/bungeecore/commands/HistoricCommand.java +++ b/src/de/steamwar/bungeecore/commands/HistoricCommand.java @@ -20,8 +20,11 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; +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.chat.ClickEvent; +import net.md_5.bungee.api.connection.ProxiedPlayer; import java.util.LinkedList; @@ -32,6 +35,12 @@ public class HistoricCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { + ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; + SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); + if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiFightJoin)) { + return; + } + FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), null, false); arena.sendPlayer(player); diff --git a/src/de/steamwar/bungeecore/commands/MsgCommand.java b/src/de/steamwar/bungeecore/commands/MsgCommand.java index 13dbb27..67f7013 100644 --- a/src/de/steamwar/bungeecore/commands/MsgCommand.java +++ b/src/de/steamwar/bungeecore/commands/MsgCommand.java @@ -49,8 +49,7 @@ public class MsgCommand extends BasicCommand { } SteamwarUser user = SteamwarUser.get(player); - if (user.isPunished(Punishment.PunishmentType.Mute)) { - sender.sendMessage(user.punishmentMessage(Punishment.PunishmentType.Mute, player)); + if (user.isPunishedWithMessage(player, Punishment.PunishmentType.Mute)) { return; } diff --git a/src/de/steamwar/bungeecore/commands/PunishmentCommand.java b/src/de/steamwar/bungeecore/commands/PunishmentCommand.java index 6f425c1..ce66981 100644 --- a/src/de/steamwar/bungeecore/commands/PunishmentCommand.java +++ b/src/de/steamwar/bungeecore/commands/PunishmentCommand.java @@ -22,6 +22,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; +import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.CommandSender; import java.sql.Timestamp; @@ -29,10 +30,12 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.Instant; import java.util.Date; +import java.util.logging.Level; public class PunishmentCommand { public PunishmentCommand(String command, Punishment.PunishmentType punishmentType) { + BungeeCord.getInstance().getLogger().log(Level.INFO, "CMD: " + command + " " + punishmentType); new BasicCommand(command, "bungeecore.ban") { @Override public void execute(CommandSender sender, String[] args) { diff --git a/src/de/steamwar/bungeecore/commands/RCommand.java b/src/de/steamwar/bungeecore/commands/RCommand.java index 7a208db..c9d70dd 100644 --- a/src/de/steamwar/bungeecore/commands/RCommand.java +++ b/src/de/steamwar/bungeecore/commands/RCommand.java @@ -45,8 +45,7 @@ public class RCommand extends BasicCommand { } SteamwarUser user = SteamwarUser.get(player); - if (user.isPunished(Punishment.PunishmentType.Mute)) { - sender.sendMessage(user.punishmentMessage(Punishment.PunishmentType.Mute, player)); + if (user.isPunishedWithMessage(player, Punishment.PunishmentType.Mute)) { return; } diff --git a/src/de/steamwar/bungeecore/commands/RankedCommand.java b/src/de/steamwar/bungeecore/commands/RankedCommand.java index 1a978b5..3fb70cf 100644 --- a/src/de/steamwar/bungeecore/commands/RankedCommand.java +++ b/src/de/steamwar/bungeecore/commands/RankedCommand.java @@ -21,6 +21,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.sql.Elo; +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; @@ -49,11 +50,20 @@ public class RankedCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { + if(!(sender instanceof ProxiedPlayer)) { + return; + } + + ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; + SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); + if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiFightJoin)) { + return; + } + if(args.length < 1){ getModes(sender, "/ranked "); return; - }else if(!(sender instanceof ProxiedPlayer)) - return; + } ArenaMode mode = FightCommand.getMode(sender, args[0]); if(mode == null) diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index a371a2e..c50c782 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -145,8 +145,7 @@ public class ChatListener extends BasicListener { } SteamwarUser user = SteamwarUser.get(sender); - if (user.isPunished(Punishment.PunishmentType.Mute)) { - sender.sendMessage(user.punishmentMessage(Punishment.PunishmentType.Mute, sender)); + if (user.isPunishedWithMessage(sender, Punishment.PunishmentType.Mute)) { e.setCancelled(true); return; } @@ -224,8 +223,7 @@ public class ChatListener extends BasicListener { } SteamwarUser user = SteamwarUser.get(sender); - if (user.isPunished(Punishment.PunishmentType.Mute)) { - sender.sendMessage(user.punishmentMessage(Punishment.PunishmentType.Mute, sender)); + if (user.isPunishedWithMessage(sender, Punishment.PunishmentType.Mute)) { e.setCancelled(true); return; } diff --git a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java index 9506ea2..53a11dd 100644 --- a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java +++ b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java @@ -27,6 +27,7 @@ import de.steamwar.bungeecore.bot.util.DiscordRanks; import de.steamwar.bungeecore.commands.ChallengeCommand; import de.steamwar.bungeecore.commands.CheckCommand; import de.steamwar.bungeecore.commands.MsgCommand; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.UserGroup; import net.md_5.bungee.api.AbstractReconnectHandler; @@ -34,10 +35,7 @@ import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; -import net.md_5.bungee.api.event.PlayerDisconnectEvent; -import net.md_5.bungee.api.event.PostLoginEvent; -import net.md_5.bungee.api.event.ServerDisconnectEvent; -import net.md_5.bungee.api.event.ServerKickEvent; +import net.md_5.bungee.api.event.*; import net.md_5.bungee.event.EventHandler; import java.util.*; @@ -144,4 +142,24 @@ public class ConnectionListener extends BasicListener { if(players.isEmpty() || (players.size() == 1 && players.contains(player))) ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), subserver::waitForTermination); } + + @EventHandler + public void onServerConnect(ServerConnectEvent e) { + ServerInfo server = e.getTarget(); + Subserver subserver = Subserver.getSubserver(server); + if (subserver == null) { + return; + } + SteamwarUser steamwarUser = SteamwarUser.get(e.getPlayer()); + + if (subserver.getType() == Servertype.BAUSERVER) { + if (steamwarUser.isPunishedWithMessage(e.getPlayer(), Punishment.PunishmentType.AntiBauJoin)) { + e.setCancelled(true); + } + } else { + if (steamwarUser.isPunishedWithMessage(e.getPlayer(), Punishment.PunishmentType.AntiFightJoin)) { + e.setCancelled(true); + } + } + } } diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index 0352bbb..c6ca242 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -34,7 +34,6 @@ public class Punishment { private static final Statement getPunishments = new Statement("SELECT * FROM Punishments WHERE PunishmentId IN (SELECT MAX(PunishmentId) FROM Punishments WHERE UserId = ? GROUP BY Type)"); private static final Statement getAllPunishments = new Statement("SELECT * FROM Punishments WHERE UserId = ? ORDER BY `PunishmentId` DESC"); private static final Statement insert = new Statement("INSERT INTO Punishments (UserId, Punisher, Type, Reason, EndTime, Perma) VALUES (?, ?, ?, ?, ?, ?)"); - private static final Statement update = new Statement("UPDATE Punishments SET EndTime = ?, Reason = ?, Perma = ? WHERE PunishmentId = ?"); public static Punishment getPunishmentOfPlayer(int user, PunishmentType type) { return getPunishment.select(rs -> { diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index f83d76c..bc66108 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -267,6 +267,14 @@ public class SteamwarUser { return true; } + public boolean isPunishedWithMessage(ProxiedPlayer player, Punishment.PunishmentType punishment) { + if (!isPunished(punishment)) { + return false; + } + player.sendMessage(punishmentMessage(punishment, player)); + return true; + } + public void punish(Punishment.PunishmentType punishment, Timestamp time, String banReason, int from, boolean perma) { punishments.remove(punishment); punishments.put(punishment, Punishment.createPunishment(id, from, punishment, banReason, time, perma)); From 3d49d907a463085473c65013453e4e18fb3ac3a4 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 27 Sep 2021 09:37:50 +0200 Subject: [PATCH 06/13] Fix messages --- .../steamwar/messages/BungeeCore.properties | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index a98c5e5..59755d0 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -131,38 +131,38 @@ UNMUTE_NOT_MUTED=§cDer Spieler ist nicht gemutet. UNMUTE_UNMUTED=Du hast {0} entmutet. ANTISCHEMADD_TEAM_ANTISCHEMADD={0} §c{1} wurde von {2} {3} schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADD_MESSAGE_PERMA=§cDu bist permanent vom schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADD_MESSAGE_PERMA=§cDu bist permanent vom schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{0} +ANTISCHEMADD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{1} UNANTISCHEMADD_NOT_ANTISCHEMADD=§cDer Spieler ist nicht vom schem geaddet werden ausgeschlossen. UNANTISCHEMADD_UNANTISCHEMADDED=Du hast {0} das schem geaddet werden zurückgegeben. ANTISCHEMADDED_TEAM_ANTISCHEMADDED={0} §c{1} wurde von {2} {3} schem adden ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADDED_MESSAGE_PERMA=§cDu bist permanent vom schem adden ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADDED_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem adden ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMADDED_MESSAGE_PERMA=§cDu bist permanent vom schem adden ausgeschlossen. §f§lGrund§r: §f{0} +ANTISCHEMADDED_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem adden ausgeschlossen. §f§lGrund§r: §f{1} UNANTISCHEMADDED_NOT_ANTISCHEMADDED=§cDer Spieler ist nicht vom schem adden ausgeschlossen. UNANTISCHEMADDED_UNANTISCHEMADDED=Du hast {0} das schem adden wiederhergestellt. ANTISCHEMDOWNLOAD_TEAM_ANTISCHEMDOWNLOADED={0} §c{1} wurde von {2} {3} schem download ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMDOWNLOAD_MESSAGE_PERMA=§cDu bist permanent vom schem download ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMDOWNLOAD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem download ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMDOWNLOAD_MESSAGE_PERMA=§cDu bist permanent vom schem download ausgeschlossen. §f§lGrund§r: §f{0} +ANTISCHEMDOWNLOAD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem download ausgeschlossen. §f§lGrund§r: §f{1} UNANTISCHEMDOWNLOAD_NOT_ANTISCHEMDOWNLOADED=§cDer Spieler ist nicht ausgeschlossen Schematics runterzuladen. UNANTISCHEMDOWNLOAD_UNANTISCHEMDOWNLOADED=Du hast {0} das schem downloaden wiederhergestellt. ANTISCHEMUPLOAD_TEAM_ANTISCHEMUPLOADED={0} §c{1} wurde von {2} {3} schem upload ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMUPLOAD_MESSAGE_PERMA=§cDu bist permanent vom schem upload ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMUPLOAD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem upload ausgeschlossen. §f§lGrund§r: §f{4} +ANTISCHEMUPLOAD_MESSAGE_PERMA=§cDu bist permanent vom schem upload ausgeschlossen. §f§lGrund§r: §f{0} +ANTISCHEMUPLOAD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem upload ausgeschlossen. §f§lGrund§r: §f{1} UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED=§cDer Spieler ist nicht ausgeschlossen Schematics hochzuladen. UNANTISCHEMUPLOAD_ANTISCHEMUPLOADED=Du hast {0} das schem upload wiederhergestellt. ANTIBAUJOIN_TEAM_ANTIBAUJOINED={0} §c{1} wurde von {2} {3} joinen von Baus ausgeschlossen. §f§lGrund§r: §f{4} -ANTIBAUJOIN_MESSAGE_PERMA=§cDu bist permanent vom joinen von Baus ausgeschlossen. §f§lGrund§r: §f{4} -ANTIBAUJOIN_MESSAGE_UNTIL=§cDu bist bis zum {0} vom joinen von Baus ausgeschlossen. §f§lGrund§r: §f{4} +ANTIBAUJOIN_MESSAGE_PERMA=§cDu bist permanent vom joinen von Baus ausgeschlossen. §f§lGrund§r: §f{0} +ANTIBAUJOIN_MESSAGE_UNTIL=§cDu bist bis zum {0} vom joinen von Baus ausgeschlossen. §f§lGrund§r: §f{1} UNANTIBAUJOIN_NOT_ANTIBAUJOINED=§cDer Spieler ist nicht vom joinen von Baus ausgeschlossen. UNANTIBAUJOIN_ANTIBAUJOINED=Du hast {0} das joinen von Baus wiederhergestellt. ANTIFIGHTJOIN_TEAM_ANTIFIGHTJOINED={0} §c{1} wurde von {2} {3} joinen von Fights ausgeschlossen. §f§lGrund§r: §f{4} -ANTIFIGHTJOIN_MESSAGE_PERMA=§cDu bist permanent vom joinen von Fights ausgeschlossen. §f§lGrund§r: §f{4} -ANTIFIGHTJOIN_MESSAGE_UNTIL=§cDu bist bis zum {0} vom joinen von Fights ausgeschlossen. §f§lGrund§r: §f{4} +ANTIFIGHTJOIN_MESSAGE_PERMA=§cDu bist permanent vom joinen von Fights ausgeschlossen. §f§lGrund§r: §f{0} +ANTIFIGHTJOIN_MESSAGE_UNTIL=§cDu bist bis zum {0} vom joinen von Fights ausgeschlossen. §f§lGrund§r: §f{1} UNANTIFIGHTJOIN_NOT_ANTIFIGHTJOINED=§cDer Spieler ist nicht vom joinen von Fights ausgeschlossen. UNANTIFIGHTJOIN_ANTIFIGHTJOINED=Du hast {0} das joinen von Fights wiederhergestellt. From 5918a2530af80fa83aa2c8b3fa16d3bc3b0462f3 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 27 Sep 2021 16:46:26 +0200 Subject: [PATCH 07/13] Fix Node NumberFormatException --- src/de/steamwar/bungeecore/Node.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/Node.java b/src/de/steamwar/bungeecore/Node.java index c5bed1e..ab53071 100644 --- a/src/de/steamwar/bungeecore/Node.java +++ b/src/de/steamwar/bungeecore/Node.java @@ -191,7 +191,7 @@ public abstract class Node { int c; try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { c = Integer.parseInt(bufferedReader.readLine()); - } catch (IOException e) { + } catch (IOException | NumberFormatException e) { BungeeCore.get().getLogger().log(Level.SEVERE, "Could not read cores of" + remote, e); c = 1; } catch (NumberFormatException e) { From 064796ec483fe8e22d62752770eb2014862a1565 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 27 Sep 2021 16:55:54 +0200 Subject: [PATCH 08/13] Fix Node NumberFormatException --- src/de/steamwar/bungeecore/Node.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/Node.java b/src/de/steamwar/bungeecore/Node.java index ab53071..465778c 100644 --- a/src/de/steamwar/bungeecore/Node.java +++ b/src/de/steamwar/bungeecore/Node.java @@ -194,9 +194,6 @@ public abstract class Node { } catch (IOException | NumberFormatException e) { BungeeCore.get().getLogger().log(Level.SEVERE, "Could not read cores of" + remote, e); c = 1; - } catch (NumberFormatException e) { - BungeeCore.get().getLogger().log(Level.SEVERE, "Could not read cores of" + remote, e); - c = 1; } cores = c; BungeeCore.get().getLogger().log(Level.INFO, "Adding node " + remote + " with " + cores + " cores."); From ecaba65f79cfbed0555fdc9de63d53f09e9c2e91 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 30 Sep 2021 13:47:21 +0200 Subject: [PATCH 09/13] Update Punishment, messages not final --- src/de/steamwar/bungeecore/BungeeCore.java | 9 ++-- .../bungeecore/commands/BauCommand.java | 6 --- .../bungeecore/commands/ChallengeCommand.java | 6 --- .../bungeecore/commands/DevCommand.java | 2 +- .../bungeecore/commands/FightCommand.java | 6 --- .../bungeecore/commands/HistoricCommand.java | 6 --- .../commands/PunishmentCommand.java | 7 +++ .../bungeecore/commands/RankedCommand.java | 6 --- .../listeners/ConnectionListener.java | 11 ----- .../steamwar/bungeecore/sql/Punishment.java | 9 ++-- .../steamwar/messages/BungeeCore.properties | 48 ++++++------------- 11 files changed, 29 insertions(+), 87 deletions(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 23660f8..3b67b64 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -131,12 +131,9 @@ public class BungeeCore extends Plugin { // Punishment Commands: new PunishmentCommand("ban", Punishment.PunishmentType.Ban); new PunishmentCommand("mute", Punishment.PunishmentType.Mute); - new PunishmentCommand("antischemadd", Punishment.PunishmentType.AntiSchemAdd); - new PunishmentCommand("antischemadded", Punishment.PunishmentType.AntiSchemAdded); - new PunishmentCommand("antischemdownload", Punishment.PunishmentType.AntiSchemDownload); - new PunishmentCommand("antischemupload", Punishment.PunishmentType.AntiSchemUpload); - new PunishmentCommand("antibaujoin", Punishment.PunishmentType.AntiBauJoin); - new PunishmentCommand("antifightjoin", Punishment.PunishmentType.AntiFightJoin); + new PunishmentCommand("noschemreceiving", Punishment.PunishmentType.NoSchemReceiving); + new PunishmentCommand("noschemsharing", Punishment.PunishmentType.NoSchemSharing); + new PunishmentCommand("nodev", Punishment.PunishmentType.NoDevServer); if(!EVENT_MODE){ new BauCommand(); diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index ae8282c..846af9c 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -43,12 +43,6 @@ public class BauCommand extends BasicCommand { return; } - ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; - SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); - if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiBauJoin)) { - return; - } - ProxiedPlayer p = (ProxiedPlayer) sender; if(args.length == 0){ diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 03a8a3d..91df5cc 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -41,12 +41,6 @@ public class ChallengeCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { - ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; - SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); - if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiFightJoin)) { - return; - } - if(args.length < 1){ Message.send("CHALLENGE_USAGE", sender); return; diff --git a/src/de/steamwar/bungeecore/commands/DevCommand.java b/src/de/steamwar/bungeecore/commands/DevCommand.java index 6fafeee..6a2a79d 100644 --- a/src/de/steamwar/bungeecore/commands/DevCommand.java +++ b/src/de/steamwar/bungeecore/commands/DevCommand.java @@ -50,7 +50,7 @@ public class DevCommand extends BasicCommand { ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); - if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiBauJoin)) { + if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.NoDevServer)) { return; } diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 878e5af..45e40a1 100644 --- a/src/de/steamwar/bungeecore/commands/FightCommand.java +++ b/src/de/steamwar/bungeecore/commands/FightCommand.java @@ -165,12 +165,6 @@ public class FightCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { - ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; - SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); - if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiFightJoin)) { - return; - } - createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> { Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), null, false); arena.sendPlayer(player); diff --git a/src/de/steamwar/bungeecore/commands/HistoricCommand.java b/src/de/steamwar/bungeecore/commands/HistoricCommand.java index f727590..c144795 100644 --- a/src/de/steamwar/bungeecore/commands/HistoricCommand.java +++ b/src/de/steamwar/bungeecore/commands/HistoricCommand.java @@ -35,12 +35,6 @@ public class HistoricCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { - ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; - SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); - if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiFightJoin)) { - return; - } - FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), null, false); arena.sendPlayer(player); diff --git a/src/de/steamwar/bungeecore/commands/PunishmentCommand.java b/src/de/steamwar/bungeecore/commands/PunishmentCommand.java index ce66981..d214e7b 100644 --- a/src/de/steamwar/bungeecore/commands/PunishmentCommand.java +++ b/src/de/steamwar/bungeecore/commands/PunishmentCommand.java @@ -24,6 +24,7 @@ import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.connection.ProxiedPlayer; import java.sql.Timestamp; import java.text.ParseException; @@ -39,6 +40,9 @@ public class PunishmentCommand { new BasicCommand(command, "bungeecore.ban") { @Override public void execute(CommandSender sender, String[] args) { + if (punishmentType == Punishment.PunishmentType.NoDevServer && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) { + return; + } if (args.length < 3) { Message.send("PUNISHMENT_USAGE", sender, command); return; @@ -66,6 +70,9 @@ public class PunishmentCommand { new BasicCommand(antiCommand, "bungeecore.ban") { @Override public void execute(CommandSender sender, String[] args) { + if (punishmentType == Punishment.PunishmentType.NoDevServer && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) { + return; + } if (args.length < 1) { Message.send("UNPUNISHMENT_USAGE", sender, antiCommand); return; diff --git a/src/de/steamwar/bungeecore/commands/RankedCommand.java b/src/de/steamwar/bungeecore/commands/RankedCommand.java index 3fb70cf..c4318be 100644 --- a/src/de/steamwar/bungeecore/commands/RankedCommand.java +++ b/src/de/steamwar/bungeecore/commands/RankedCommand.java @@ -54,12 +54,6 @@ public class RankedCommand extends BasicCommand { return; } - ProxiedPlayer proxiedPlayer = (ProxiedPlayer) sender; - SteamwarUser steamwarUser = SteamwarUser.get(proxiedPlayer); - if (steamwarUser.isPunishedWithMessage(proxiedPlayer, Punishment.PunishmentType.AntiFightJoin)) { - return; - } - if(args.length < 1){ getModes(sender, "/ranked "); return; diff --git a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java index 53a11dd..e006e8e 100644 --- a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java +++ b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java @@ -150,16 +150,5 @@ public class ConnectionListener extends BasicListener { if (subserver == null) { return; } - SteamwarUser steamwarUser = SteamwarUser.get(e.getPlayer()); - - if (subserver.getType() == Servertype.BAUSERVER) { - if (steamwarUser.isPunishedWithMessage(e.getPlayer(), Punishment.PunishmentType.AntiBauJoin)) { - e.setCancelled(true); - } - } else { - if (steamwarUser.isPunishedWithMessage(e.getPlayer(), Punishment.PunishmentType.AntiFightJoin)) { - e.setCancelled(true); - } - } } } diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index c6ca242..872e646 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -131,12 +131,9 @@ public class Punishment { public enum PunishmentType { Ban("BAN_TEAM_BANNED", "BANNED_MESSAGE_PERMA", "BANNED_MESSAGE_UNTIL", "UNBAN_NOT_BANNED", "UNBAN_UNBANNED"), Mute( "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"), - AntiSchemAdd("ANTISCHEMADD_TEAM_ANTISCHEMADD", "ANTISCHEMADD_MESSAGE_PERMA", "ANTISCHEMADD_MESSAGE_UNTIL", "UNANTISCHEMADD_NOT_ANTISCHEMADD", "UNANTISCHEMADD_UNANTISCHEMADDED"), - AntiSchemAdded("ANTISCHEMADDED_TEAM_ANTISCHEMADDED", "ANTISCHEMADDED_MESSAGE_PERMA", "ANTISCHEMADDED_MESSAGE_UNTIL", "UNANTISCHEMADDED_NOT_ANTISCHEMADDED", "UNANTISCHEMADDED_UNANTISCHEMADDED"), - AntiSchemDownload("ANTISCHEMDOWNLOAD_TEAM_ANTISCHEMDOWNLOADED", "ANTISCHEMDOWNLOAD_MESSAGE_PERMA", "ANTISCHEMDOWNLOAD_MESSAGE_UNTIL", "UNANTISCHEMDOWNLOAD_NOT_ANTISCHEMDOWNLOADED", "UNANTISCHEMDOWNLOAD_UNANTISCHEMDOWNLOADED"), - AntiSchemUpload("ANTISCHEMUPLOAD_TEAM_ANTISCHEMUPLOADED", "ANTISCHEMUPLOAD_MESSAGE_PERMA", "ANTISCHEMUPLOAD_MESSAGE_UNTIL", "UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED", "UNANTISCHEMUPLOAD_ANTISCHEMUPLOADED"), - AntiBauJoin("ANTIBAUJOIN_TEAM_ANTIBAUJOINED", "ANTIBAUJOIN_MESSAGE_PERMA", "ANTIBAUJOIN_MESSAGE_UNTIL", "UNANTIBAUJOIN_NOT_ANTIBAUJOINED", "UNANTIBAUJOIN_ANTIBAUJOINED"), - AntiFightJoin("ANTIFIGHTJOIN_TEAM_ANTIFIGHTJOINED", "ANTIFIGHTJOIN_MESSAGE_PERMA", "ANTIFIGHTJOIN_MESSAGE_UNTIL", "UNANTIFIGHTJOIN_NOT_ANTIFIGHTJOINED", "UNANTIFIGHTJOIN_ANTIFIGHTJOINED"); + NoSchemReceiving("NOSCHEMRECEIVING_TEAM_NOSCHEMRECEIVING", "NOSCHEMRECEIVING_MESSAGE_PERMA", "NOSCHEMRECEIVING_MESSAGE_UNTIL", "UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING", "UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING"), + NoSchemSharing("NOSCHEMSHARING_TEAM_NOSCHEMSHARING", "NOSCHEMSHARING_MESSAGE_PERMA", "NOSCHEMSHARING_MESSAGE_UNTIL", "UNNOSCHEMSHARING_NOT_NOSCHEMSHARING", "UNNOSCHEMSHARING_UNNOSCHEMSHARING"), + NoDevServer("NODEVSERVER_TEAM_NODEVSERVER", "NODEVSERVER_MESSAGE_PERMA", "NODEVSERVER_MESSAGE_UNTIL", "UNNODEVSERVER_NOT_NODEVSERVER", "UNNODEVSERVER_UNNODEVSERVER"); private String teamMessage; private String playerMessagePerma; diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 59755d0..2fc7b51 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -130,41 +130,23 @@ MUTED_MESSAGE_UNTIL=§cDu bist bis zum {0} gemuted. §r§lGrund§r: §c{1} UNMUTE_NOT_MUTED=§cDer Spieler ist nicht gemutet. UNMUTE_UNMUTED=Du hast {0} entmutet. -ANTISCHEMADD_TEAM_ANTISCHEMADD={0} §c{1} wurde von {2} {3} schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADD_MESSAGE_PERMA=§cDu bist permanent vom schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{0} -ANTISCHEMADD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem geaddet werden ausgeschlossen. §f§lGrund§r: §f{1} -UNANTISCHEMADD_NOT_ANTISCHEMADD=§cDer Spieler ist nicht vom schem geaddet werden ausgeschlossen. -UNANTISCHEMADD_UNANTISCHEMADDED=Du hast {0} das schem geaddet werden zurückgegeben. +NOSCHEMRECEIVING_TEAM_NOSCHEMRECEIVING={0} §c{1} wurde von {2} {3} vom schem erhalten ausgeschlossen. §f§lGrund§r: §f{4} +NOSCHEMRECEIVING_MESSAGE_PERMA=§cDu bist permanent vom erhalten von schems ausgeschlossen. §f§lGrund§r: §f{0} +NOSCHEMRECEIVING_MESSAGE_UNTIL=§cDu bist bis zum {0} vom erhalten von schems ausgeschlossen. §f§lGrund§r: §f{1} +UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING=§cDer Spieler ist nicht vom erhalten von schems ausgeschlossen. +UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING=Du hast {0} das schems erhalten zurückgegeben. -ANTISCHEMADDED_TEAM_ANTISCHEMADDED={0} §c{1} wurde von {2} {3} schem adden ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMADDED_MESSAGE_PERMA=§cDu bist permanent vom schem adden ausgeschlossen. §f§lGrund§r: §f{0} -ANTISCHEMADDED_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem adden ausgeschlossen. §f§lGrund§r: §f{1} -UNANTISCHEMADDED_NOT_ANTISCHEMADDED=§cDer Spieler ist nicht vom schem adden ausgeschlossen. -UNANTISCHEMADDED_UNANTISCHEMADDED=Du hast {0} das schem adden wiederhergestellt. +NOSCHEMSHARING_TEAM_NOSCHEMSHARING={0} §c{1} wurde von {2} {3} vom schem verteilen ausgeschlossen. §f§lGrund§r: §f{4} +NOSCHEMSHARING_MESSAGE_PERMA=§cDu bist permanent vom verteilen von schems ausgeschlossen. §f§lGrund§r: §f{0} +NOSCHEMSHARING_MESSAGE_UNTIL=§cDu bist bis zum {0} vom verteilen von schems ausgeschlossen. §f§lGrund§r: §f{1} +UNNOSCHEMSHARING_NOT_NOSCHEMSHARING=§cDer Spieler ist nicht vom verteilen von schems ausgeschlossen. +UNNOSCHEMSHARING_UNNOSCHEMSHARING=Du hast {0} das schems verteilen zurückgegeben. -ANTISCHEMDOWNLOAD_TEAM_ANTISCHEMDOWNLOADED={0} §c{1} wurde von {2} {3} schem download ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMDOWNLOAD_MESSAGE_PERMA=§cDu bist permanent vom schem download ausgeschlossen. §f§lGrund§r: §f{0} -ANTISCHEMDOWNLOAD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem download ausgeschlossen. §f§lGrund§r: §f{1} -UNANTISCHEMDOWNLOAD_NOT_ANTISCHEMDOWNLOADED=§cDer Spieler ist nicht ausgeschlossen Schematics runterzuladen. -UNANTISCHEMDOWNLOAD_UNANTISCHEMDOWNLOADED=Du hast {0} das schem downloaden wiederhergestellt. - -ANTISCHEMUPLOAD_TEAM_ANTISCHEMUPLOADED={0} §c{1} wurde von {2} {3} schem upload ausgeschlossen. §f§lGrund§r: §f{4} -ANTISCHEMUPLOAD_MESSAGE_PERMA=§cDu bist permanent vom schem upload ausgeschlossen. §f§lGrund§r: §f{0} -ANTISCHEMUPLOAD_MESSAGE_UNTIL=§cDu bist bis zum {0} vom schem upload ausgeschlossen. §f§lGrund§r: §f{1} -UNANTISCHEMUPLOAD_NOT_ANTISCHEMUPLOADED=§cDer Spieler ist nicht ausgeschlossen Schematics hochzuladen. -UNANTISCHEMUPLOAD_ANTISCHEMUPLOADED=Du hast {0} das schem upload wiederhergestellt. - -ANTIBAUJOIN_TEAM_ANTIBAUJOINED={0} §c{1} wurde von {2} {3} joinen von Baus ausgeschlossen. §f§lGrund§r: §f{4} -ANTIBAUJOIN_MESSAGE_PERMA=§cDu bist permanent vom joinen von Baus ausgeschlossen. §f§lGrund§r: §f{0} -ANTIBAUJOIN_MESSAGE_UNTIL=§cDu bist bis zum {0} vom joinen von Baus ausgeschlossen. §f§lGrund§r: §f{1} -UNANTIBAUJOIN_NOT_ANTIBAUJOINED=§cDer Spieler ist nicht vom joinen von Baus ausgeschlossen. -UNANTIBAUJOIN_ANTIBAUJOINED=Du hast {0} das joinen von Baus wiederhergestellt. - -ANTIFIGHTJOIN_TEAM_ANTIFIGHTJOINED={0} §c{1} wurde von {2} {3} joinen von Fights ausgeschlossen. §f§lGrund§r: §f{4} -ANTIFIGHTJOIN_MESSAGE_PERMA=§cDu bist permanent vom joinen von Fights ausgeschlossen. §f§lGrund§r: §f{0} -ANTIFIGHTJOIN_MESSAGE_UNTIL=§cDu bist bis zum {0} vom joinen von Fights ausgeschlossen. §f§lGrund§r: §f{1} -UNANTIFIGHTJOIN_NOT_ANTIFIGHTJOINED=§cDer Spieler ist nicht vom joinen von Fights ausgeschlossen. -UNANTIFIGHTJOIN_ANTIFIGHTJOINED=Du hast {0} das joinen von Fights wiederhergestellt. +NODEVSERVER_TEAM_NODEVSERVER={0} §c{1} wurde von {2} {3} vom dev server ausgeschlossen. §f§lGrund§r: §f{4} +NODEVSERVER_MESSAGE_PERMA=§cDu bist permanent vom dev server ausgeschlossen. §f§lGrund§r: §f{0} +NODEVSERVER_MESSAGE_UNTIL=§cDu bist bis zum {0} vom dev server ausgeschlossen. §f§lGrund§r: §f{1} +UNNODEVSERVER_NOT_NODEVSERVER=§cDer Spieler ist nicht vom dev server ausgeschlossen. +UNNODEVSERVER_UNNODEVSERVER=Du hast {0} das das joinen des dev servers zurückgegeben. #BugCommand BUG_MESSAGE=§7Dein Bugreport wurde gespeichert. From 4f7ccf20283a2d1bf7651df25fe2ae7b73dfcb8f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 2 Oct 2021 21:24:32 +0200 Subject: [PATCH 10/13] Fix stuff --- .../bungeecore/commands/FightCommand.java | 2 -- .../bungeecore/commands/HistoricCommand.java | 8 +++---- .../commands/PunishmentCommand.java | 7 ++----- .../bungeecore/commands/RankedCommand.java | 1 - .../listeners/ConnectionListener.java | 15 ++++--------- .../steamwar/bungeecore/sql/Punishment.java | 21 ++++++++++--------- 6 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 45e40a1..984bc06 100644 --- a/src/de/steamwar/bungeecore/commands/FightCommand.java +++ b/src/de/steamwar/bungeecore/commands/FightCommand.java @@ -21,8 +21,6 @@ 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; diff --git a/src/de/steamwar/bungeecore/commands/HistoricCommand.java b/src/de/steamwar/bungeecore/commands/HistoricCommand.java index c144795..0ddfef2 100644 --- a/src/de/steamwar/bungeecore/commands/HistoricCommand.java +++ b/src/de/steamwar/bungeecore/commands/HistoricCommand.java @@ -19,12 +19,12 @@ package de.steamwar.bungeecore.commands; -import de.steamwar.bungeecore.*; -import de.steamwar.bungeecore.sql.Punishment; -import de.steamwar.bungeecore.sql.SteamwarUser; +import de.steamwar.bungeecore.ArenaMode; +import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.Subserver; +import de.steamwar.bungeecore.SubserverSystem; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.ClickEvent; -import net.md_5.bungee.api.connection.ProxiedPlayer; import java.util.LinkedList; diff --git a/src/de/steamwar/bungeecore/commands/PunishmentCommand.java b/src/de/steamwar/bungeecore/commands/PunishmentCommand.java index d214e7b..eda5c8b 100644 --- a/src/de/steamwar/bungeecore/commands/PunishmentCommand.java +++ b/src/de/steamwar/bungeecore/commands/PunishmentCommand.java @@ -22,7 +22,6 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; -import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -31,16 +30,14 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.Instant; import java.util.Date; -import java.util.logging.Level; public class PunishmentCommand { public PunishmentCommand(String command, Punishment.PunishmentType punishmentType) { - BungeeCord.getInstance().getLogger().log(Level.INFO, "CMD: " + command + " " + punishmentType); new BasicCommand(command, "bungeecore.ban") { @Override public void execute(CommandSender sender, String[] args) { - if (punishmentType == Punishment.PunishmentType.NoDevServer && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) { + if (punishmentType.isNeedsAdmin() && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) { return; } if (args.length < 3) { @@ -70,7 +67,7 @@ public class PunishmentCommand { new BasicCommand(antiCommand, "bungeecore.ban") { @Override public void execute(CommandSender sender, String[] args) { - if (punishmentType == Punishment.PunishmentType.NoDevServer && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) { + if (punishmentType.isNeedsAdmin() && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) { return; } if (args.length < 1) { diff --git a/src/de/steamwar/bungeecore/commands/RankedCommand.java b/src/de/steamwar/bungeecore/commands/RankedCommand.java index c4318be..f1649cb 100644 --- a/src/de/steamwar/bungeecore/commands/RankedCommand.java +++ b/src/de/steamwar/bungeecore/commands/RankedCommand.java @@ -21,7 +21,6 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.sql.Elo; -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; diff --git a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java index e006e8e..9506ea2 100644 --- a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java +++ b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java @@ -27,7 +27,6 @@ import de.steamwar.bungeecore.bot.util.DiscordRanks; import de.steamwar.bungeecore.commands.ChallengeCommand; import de.steamwar.bungeecore.commands.CheckCommand; import de.steamwar.bungeecore.commands.MsgCommand; -import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.UserGroup; import net.md_5.bungee.api.AbstractReconnectHandler; @@ -35,7 +34,10 @@ import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; -import net.md_5.bungee.api.event.*; +import net.md_5.bungee.api.event.PlayerDisconnectEvent; +import net.md_5.bungee.api.event.PostLoginEvent; +import net.md_5.bungee.api.event.ServerDisconnectEvent; +import net.md_5.bungee.api.event.ServerKickEvent; import net.md_5.bungee.event.EventHandler; import java.util.*; @@ -142,13 +144,4 @@ public class ConnectionListener extends BasicListener { if(players.isEmpty() || (players.size() == 1 && players.contains(player))) ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), subserver::waitForTermination); } - - @EventHandler - public void onServerConnect(ServerConnectEvent e) { - ServerInfo server = e.getTarget(); - Subserver subserver = Subserver.getSubserver(server); - if (subserver == null) { - return; - } - } } diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index 872e646..02b2dea 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -129,16 +129,17 @@ public class Punishment { @AllArgsConstructor @Getter public enum PunishmentType { - Ban("BAN_TEAM_BANNED", "BANNED_MESSAGE_PERMA", "BANNED_MESSAGE_UNTIL", "UNBAN_NOT_BANNED", "UNBAN_UNBANNED"), - Mute( "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"), - NoSchemReceiving("NOSCHEMRECEIVING_TEAM_NOSCHEMRECEIVING", "NOSCHEMRECEIVING_MESSAGE_PERMA", "NOSCHEMRECEIVING_MESSAGE_UNTIL", "UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING", "UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING"), - NoSchemSharing("NOSCHEMSHARING_TEAM_NOSCHEMSHARING", "NOSCHEMSHARING_MESSAGE_PERMA", "NOSCHEMSHARING_MESSAGE_UNTIL", "UNNOSCHEMSHARING_NOT_NOSCHEMSHARING", "UNNOSCHEMSHARING_UNNOSCHEMSHARING"), - NoDevServer("NODEVSERVER_TEAM_NODEVSERVER", "NODEVSERVER_MESSAGE_PERMA", "NODEVSERVER_MESSAGE_UNTIL", "UNNODEVSERVER_NOT_NODEVSERVER", "UNNODEVSERVER_UNNODEVSERVER"); + Ban(false, "BAN_TEAM_BANNED", "BANNED_MESSAGE_PERMA", "BANNED_MESSAGE_UNTIL", "UNBAN_NOT_BANNED", "UNBAN_UNBANNED"), + Mute( false, "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"), + NoSchemReceiving(false, "NOSCHEMRECEIVING_TEAM_NOSCHEMRECEIVING", "NOSCHEMRECEIVING_MESSAGE_PERMA", "NOSCHEMRECEIVING_MESSAGE_UNTIL", "UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING", "UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING"), + NoSchemSharing(false, "NOSCHEMSHARING_TEAM_NOSCHEMSHARING", "NOSCHEMSHARING_MESSAGE_PERMA", "NOSCHEMSHARING_MESSAGE_UNTIL", "UNNOSCHEMSHARING_NOT_NOSCHEMSHARING", "UNNOSCHEMSHARING_UNNOSCHEMSHARING"), + NoDevServer(true, "NODEVSERVER_TEAM_NODEVSERVER", "NODEVSERVER_MESSAGE_PERMA", "NODEVSERVER_MESSAGE_UNTIL", "UNNODEVSERVER_NOT_NODEVSERVER", "UNNODEVSERVER_UNNODEVSERVER"); - private String teamMessage; - private String playerMessagePerma; - private String playerMessageUntil; - private String usageNotPunished; - private String unpunishmentMessage; + private final boolean needsAdmin; + private final String teamMessage; + private final String playerMessagePerma; + private final String playerMessageUntil; + private final String usageNotPunished; + private final String unpunishmentMessage; } } From 0f5087c76c81a33fab21aaf18695c0b5fd82b90d Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 6 Oct 2021 11:28:11 +0200 Subject: [PATCH 11/13] Add Punishment.PunishmentType.NoSchemSubmitting --- src/de/steamwar/bungeecore/BungeeCore.java | 1 + src/de/steamwar/bungeecore/sql/Punishment.java | 1 + src/de/steamwar/messages/BungeeCore.properties | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index f8b0ec2..4167c11 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -135,6 +135,7 @@ public class BungeeCore extends Plugin { new PunishmentCommand("mute", Punishment.PunishmentType.Mute); new PunishmentCommand("noschemreceiving", Punishment.PunishmentType.NoSchemReceiving); new PunishmentCommand("noschemsharing", Punishment.PunishmentType.NoSchemSharing); + new PunishmentCommand("noschemsubmitting", Punishment.PunishmentType.NoSchemSubmitting); new PunishmentCommand("nodev", Punishment.PunishmentType.NoDevServer); if(!EVENT_MODE){ diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index 02b2dea..c021f64 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -133,6 +133,7 @@ public class Punishment { Mute( false, "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"), NoSchemReceiving(false, "NOSCHEMRECEIVING_TEAM_NOSCHEMRECEIVING", "NOSCHEMRECEIVING_MESSAGE_PERMA", "NOSCHEMRECEIVING_MESSAGE_UNTIL", "UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING", "UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING"), NoSchemSharing(false, "NOSCHEMSHARING_TEAM_NOSCHEMSHARING", "NOSCHEMSHARING_MESSAGE_PERMA", "NOSCHEMSHARING_MESSAGE_UNTIL", "UNNOSCHEMSHARING_NOT_NOSCHEMSHARING", "UNNOSCHEMSHARING_UNNOSCHEMSHARING"), + NoSchemSubmitting(true, "NOSCHEMSUBMITTING_TEAM_NOSCHEMSUBMITTING", "NOSCHEMSUBMITTING_MESSAGE_PERMA", "NOSCHEMSUBMITTING_MESSAGE_UNTIL", "UNNOSCHEMSUBMITTING_NOT_NOSCHEMSUBMITTING", "UNNOSCHEMSUBMITTING_UNNOSCHEMSUBMITTING"), NoDevServer(true, "NODEVSERVER_TEAM_NODEVSERVER", "NODEVSERVER_MESSAGE_PERMA", "NODEVSERVER_MESSAGE_UNTIL", "UNNODEVSERVER_NOT_NODEVSERVER", "UNNODEVSERVER_UNNODEVSERVER"); private final boolean needsAdmin; diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 2fc7b51..483a2a2 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -142,6 +142,12 @@ NOSCHEMSHARING_MESSAGE_UNTIL=§cDu bist bis zum {0} vom verteilen von schems aus UNNOSCHEMSHARING_NOT_NOSCHEMSHARING=§cDer Spieler ist nicht vom verteilen von schems ausgeschlossen. UNNOSCHEMSHARING_UNNOSCHEMSHARING=Du hast {0} das schems verteilen zurückgegeben. +NOSCHEMSUBMITTING_TEAM_NOSCHEMSUBMITTING={0} §c{1} wurde von {2} {3} vom schem einreichen ausgeschlossen. §f§lGrund§r: §f{4} +NOSCHEMSUBMITTING_MESSAGE_PERMA=§cDu bist permanent vom einreichen von schems ausgeschlossen. §f§lGrund§r: §f{0} +NOSCHEMSUBMITTING_MESSAGE_UNTIL=§cDu bist bis zum {0} vom einreichen von schems ausgeschlossen. §f§lGrund§r: §f{1} +UNNOSCHEMSUBMITTING_NOT_NOSCHEMSUBMITTING=§cDer Spieler ist nicht vom einreichen von schems ausgeschlossen. +UNNOSCHEMSUBMITTING_UNNOSCHEMSUBMITTING=Du hast {0} das schems einreichen zurückgegeben. + NODEVSERVER_TEAM_NODEVSERVER={0} §c{1} wurde von {2} {3} vom dev server ausgeschlossen. §f§lGrund§r: §f{4} NODEVSERVER_MESSAGE_PERMA=§cDu bist permanent vom dev server ausgeschlossen. §f§lGrund§r: §f{0} NODEVSERVER_MESSAGE_UNTIL=§cDu bist bis zum {0} vom dev server ausgeschlossen. §f§lGrund§r: §f{1} From 2ef2f81496dd12e5fcf4dcca32298f81a564d6c3 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 7 Oct 2021 10:28:53 +0200 Subject: [PATCH 12/13] Update imports --- src/de/steamwar/bungeecore/commands/BauCommand.java | 1 - src/de/steamwar/bungeecore/commands/ChallengeCommand.java | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index 846af9c..b555494 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -24,7 +24,6 @@ import de.steamwar.bungeecore.comms.packets.BaumemberUpdatePacket; import de.steamwar.bungeecore.inventory.SWInventory; import de.steamwar.bungeecore.inventory.SWItem; import de.steamwar.bungeecore.sql.BauweltMember; -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; diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 91df5cc..1025eea 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -22,14 +22,13 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; import de.steamwar.bungeecore.sql.IgnoreSystem; -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.chat.ClickEvent; import net.md_5.bungee.api.connection.ProxiedPlayer; -import java.util.*; +import java.util.ArrayList; +import java.util.LinkedList; import static de.steamwar.bungeecore.Storage.challenges; From fe2c6fc0b5cc9ed69152edb5f2d7ee3e9e18de37 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 7 Oct 2021 10:55:59 +0200 Subject: [PATCH 13/13] Update messages --- .../bungeecore/bot/commands/BanCommand.java | 2 +- .../bungeecore/bot/commands/MuteCommand.java | 2 +- .../steamwar/bungeecore/sql/Punishment.java | 12 ++-- .../steamwar/messages/BungeeCore.properties | 60 +++++++++---------- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/de/steamwar/bungeecore/bot/commands/BanCommand.java b/src/de/steamwar/bungeecore/bot/commands/BanCommand.java index 5e06cb6..e328997 100644 --- a/src/de/steamwar/bungeecore/bot/commands/BanCommand.java +++ b/src/de/steamwar/bungeecore/bot/commands/BanCommand.java @@ -61,7 +61,7 @@ public class BanCommand extends BasicDiscordCommand { boolean isPerma = event.getOption("time").getAsString().equals("perma"); target.punish(Punishment.PunishmentType.Ban, time, msg, sender.getId(), isPerma); - Message.team("BAN_TEAM_BANNED", new Message("PREFIX"), target.getUserName(), sender.getUserName(), new Message((isPerma ? "BAN_PERMA" : "BAN_UNTIL"), time), msg); + Message.team("BAN_TEAM", new Message("PREFIX"), target.getUserName(), sender.getUserName(), new Message((isPerma ? "BAN_PERMA" : "BAN_UNTIL"), time), msg); event.reply("Erfolgreich " + target.getUserName() + (isPerma ? " permanent" : " bis " + time) + " gebannt").setEphemeral(true).queue(); } } diff --git a/src/de/steamwar/bungeecore/bot/commands/MuteCommand.java b/src/de/steamwar/bungeecore/bot/commands/MuteCommand.java index 7847316..086cf77 100644 --- a/src/de/steamwar/bungeecore/bot/commands/MuteCommand.java +++ b/src/de/steamwar/bungeecore/bot/commands/MuteCommand.java @@ -61,7 +61,7 @@ public class MuteCommand extends BasicDiscordCommand { boolean isPerma = event.getOption("time").getAsString().equals("perma"); target.punish(Punishment.PunishmentType.Mute, time, msg, sender.getId(), isPerma); - Message.team("MUTE_TEAM_MUTED", new Message("PREFIX"), target.getUserName(), sender.getUserName(), new Message((isPerma ? "BAN_PERMA" : "BAN_UNTIL"), time), msg); + Message.team("MUTE_TEAM", new Message("PREFIX"), target.getUserName(), sender.getUserName(), new Message((isPerma ? "BAN_PERMA" : "BAN_UNTIL"), time), msg); event.reply("Erfolgreich " + target.getUserName() + (isPerma ? " permanent" : " bis " + time) + " gemutet").setEphemeral(true).queue(); } } diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index c021f64..7f9a24e 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -129,12 +129,12 @@ public class Punishment { @AllArgsConstructor @Getter public enum PunishmentType { - Ban(false, "BAN_TEAM_BANNED", "BANNED_MESSAGE_PERMA", "BANNED_MESSAGE_UNTIL", "UNBAN_NOT_BANNED", "UNBAN_UNBANNED"), - Mute( false, "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"), - NoSchemReceiving(false, "NOSCHEMRECEIVING_TEAM_NOSCHEMRECEIVING", "NOSCHEMRECEIVING_MESSAGE_PERMA", "NOSCHEMRECEIVING_MESSAGE_UNTIL", "UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING", "UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING"), - NoSchemSharing(false, "NOSCHEMSHARING_TEAM_NOSCHEMSHARING", "NOSCHEMSHARING_MESSAGE_PERMA", "NOSCHEMSHARING_MESSAGE_UNTIL", "UNNOSCHEMSHARING_NOT_NOSCHEMSHARING", "UNNOSCHEMSHARING_UNNOSCHEMSHARING"), - NoSchemSubmitting(true, "NOSCHEMSUBMITTING_TEAM_NOSCHEMSUBMITTING", "NOSCHEMSUBMITTING_MESSAGE_PERMA", "NOSCHEMSUBMITTING_MESSAGE_UNTIL", "UNNOSCHEMSUBMITTING_NOT_NOSCHEMSUBMITTING", "UNNOSCHEMSUBMITTING_UNNOSCHEMSUBMITTING"), - NoDevServer(true, "NODEVSERVER_TEAM_NODEVSERVER", "NODEVSERVER_MESSAGE_PERMA", "NODEVSERVER_MESSAGE_UNTIL", "UNNODEVSERVER_NOT_NODEVSERVER", "UNNODEVSERVER_UNNODEVSERVER"); + Ban(false, "BAN_TEAM", "BAN_PERMA", "BAN_UNTIL", "UNBAN_ERROR", "UNBAN"), + Mute( false, "MUTE_TEAM", "MUTE_PERMA", "MUTE_UNTIL", "UNMUTE_ERROR", "UNMUTE"), + 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"); 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 483a2a2..cc7d8af 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -114,45 +114,45 @@ UNPUNISHMENT_USAGE=§8/§7{0} §8[§eSpieler§8] PUNISHMENT_UNTIL=bis zum {0} PUNISHMENT_PERMA=permanent -BAN_TEAM_BANNED={0} §c{1} wurde von {2} {3} gebannt. §f§lGrund§r: §f{4} -BANNED_MESSAGE_PERMA=§cDu bist permanent gebannt. §r§lGrund§r: §c{0} -BANNED_MESSAGE_UNTIL=§cDu bist bis zum {0} gebannt. §r§lGrund§r: §c{1} -UNBAN_NOT_BANNED=§cDer Spieler ist nicht gebannt. -UNBAN_UNBANNED=Du hast {0} entbannt. +BAN_TEAM={0} §e{1} §7wurde von §e{2} {3} §e§lgebannt§8. §7Grund§8: §f{4} +BAN_PERMA=§7Du bist §epermanent §e§lgebannt§8. §7Grund§8: §e{0} +BAN_UNTIL=§7Du bist §ebis zum {0} §e§lgebannt§8. §7Grund§8: §e{1} +UNBAN_ERROR=§cDer Spieler ist nicht gebannt. +UNBAN=§7Du hast §e{0} §e§lentbannt. BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: §c BAN_AVOIDING_LIST={0} §e{1} §c BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung -MUTE_TEAM_MUTED={0} §c{1} wurde von {2} {3} gemuted. §f§lGrund§r: §f{4} -MUTED_MESSAGE_PERMA=§cDu bist permanent gemuted. §r§lGrund§r: §c{0} -MUTED_MESSAGE_UNTIL=§cDu bist bis zum {0} gemuted. §r§lGrund§r: §c{1} -UNMUTE_NOT_MUTED=§cDer Spieler ist nicht gemutet. -UNMUTE_UNMUTED=Du hast {0} entmutet. +MUTE_TEAM={0} §e{1} §7wurde von §e{2} {3} §e§lgemuted§8. §7Grund§8: §f{4} +MUTE_PERMA=§7Du bist §epermanent §e§lgemuted§8. §7Grund§8: §e{0} +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_NOSCHEMRECEIVING={0} §c{1} wurde von {2} {3} vom schem erhalten ausgeschlossen. §f§lGrund§r: §f{4} -NOSCHEMRECEIVING_MESSAGE_PERMA=§cDu bist permanent vom erhalten von schems ausgeschlossen. §f§lGrund§r: §f{0} -NOSCHEMRECEIVING_MESSAGE_UNTIL=§cDu bist bis zum {0} vom erhalten von schems ausgeschlossen. §f§lGrund§r: §f{1} -UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING=§cDer Spieler ist nicht vom erhalten von schems ausgeschlossen. -UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING=Du hast {0} das schems erhalten zurückgegeben. +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} +UNNOSCHEMRECEIVING_ERROR=§cDer Spieler ist nicht vom Erhalten von Schematics ausgeschlossen. +UNNOSCHEMRECEIVING=§e{0} §7darf nun wieder §e§lSchematics erhalten§8. -NOSCHEMSHARING_TEAM_NOSCHEMSHARING={0} §c{1} wurde von {2} {3} vom schem verteilen ausgeschlossen. §f§lGrund§r: §f{4} -NOSCHEMSHARING_MESSAGE_PERMA=§cDu bist permanent vom verteilen von schems ausgeschlossen. §f§lGrund§r: §f{0} -NOSCHEMSHARING_MESSAGE_UNTIL=§cDu bist bis zum {0} vom verteilen von schems ausgeschlossen. §f§lGrund§r: §f{1} -UNNOSCHEMSHARING_NOT_NOSCHEMSHARING=§cDer Spieler ist nicht vom verteilen von schems ausgeschlossen. -UNNOSCHEMSHARING_UNNOSCHEMSHARING=Du hast {0} das schems verteilen zurückgegeben. +NOSCHEMSHARING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematicverteilen 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. -NOSCHEMSUBMITTING_TEAM_NOSCHEMSUBMITTING={0} §c{1} wurde von {2} {3} vom schem einreichen ausgeschlossen. §f§lGrund§r: §f{4} -NOSCHEMSUBMITTING_MESSAGE_PERMA=§cDu bist permanent vom einreichen von schems ausgeschlossen. §f§lGrund§r: §f{0} -NOSCHEMSUBMITTING_MESSAGE_UNTIL=§cDu bist bis zum {0} vom einreichen von schems ausgeschlossen. §f§lGrund§r: §f{1} -UNNOSCHEMSUBMITTING_NOT_NOSCHEMSUBMITTING=§cDer Spieler ist nicht vom einreichen von schems ausgeschlossen. -UNNOSCHEMSUBMITTING_UNNOSCHEMSUBMITTING=Du hast {0} das schems einreichen zurückgegeben. +NOSCHEMSUBMITTING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematiceinsenden 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. -NODEVSERVER_TEAM_NODEVSERVER={0} §c{1} wurde von {2} {3} vom dev server ausgeschlossen. §f§lGrund§r: §f{4} -NODEVSERVER_MESSAGE_PERMA=§cDu bist permanent vom dev server ausgeschlossen. §f§lGrund§r: §f{0} -NODEVSERVER_MESSAGE_UNTIL=§cDu bist bis zum {0} vom dev server ausgeschlossen. §f§lGrund§r: §f{1} -UNNODEVSERVER_NOT_NODEVSERVER=§cDer Spieler ist nicht vom dev server ausgeschlossen. -UNNODEVSERVER_UNNODEVSERVER=Du hast {0} das das joinen des dev servers zurückgegeben. +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} +UNNODEVSERVER_ERROR=§cDer Spieler ist nicht vom Devserver ausgeschlossen. +UNNODEVSERVER=§e{0} §7darf nun wieder dem §e§lDevserver beitreten§8. #BugCommand BUG_MESSAGE=§7Dein Bugreport wurde gespeichert.