From 7893d7a6912de0e694e46bcd24e8a1e329cbc545 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 30 Oct 2020 22:11:27 +0100 Subject: [PATCH 01/10] Added LiteLoader Blocking --- src/de/steamwar/bungeecore/BungeeCore.java | 4 ++-- src/de/steamwar/bungeecore/commands/ChallengeCommand.java | 4 ++-- src/de/steamwar/bungeecore/commands/FightCommand.java | 4 ++-- .../listeners/mods/{Fabric.java => ModLoaderBlocker.java} | 8 ++++++-- 4 files changed, 12 insertions(+), 8 deletions(-) rename src/de/steamwar/bungeecore/listeners/mods/{Fabric.java => ModLoaderBlocker.java} (86%) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 466f971..1606f03 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -22,7 +22,7 @@ package de.steamwar.bungeecore; import de.steamwar.bungeecore.commands.*; import de.steamwar.bungeecore.comms.SpigotReceiver; import de.steamwar.bungeecore.listeners.*; -import de.steamwar.bungeecore.listeners.mods.Fabric; +import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; import de.steamwar.bungeecore.listeners.mods.Forge; import de.steamwar.bungeecore.listeners.mods.LabyMod; import de.steamwar.bungeecore.sql.SQL; @@ -83,7 +83,7 @@ public class BungeeCore extends Plugin { new ChatListener(); new BanListener(); new CheckListener(); - new Fabric(); + new ModLoaderBlocker(); commands.put("/b", null); commands.put("/gs", null); diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 4b07579..28df922 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -20,7 +20,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; -import de.steamwar.bungeecore.listeners.mods.Fabric; +import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; import de.steamwar.bungeecore.sql.IgnoreSystem; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; @@ -47,7 +47,7 @@ public class ChallengeCommand extends BasicCommand { if (!(sender instanceof ProxiedPlayer)) return; - if(Fabric.isFabric((ProxiedPlayer) sender)) { + if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender)) { BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric nicht auf die Arenen darf?"); return; } diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 91af7b6..88e4229 100644 --- a/src/de/steamwar/bungeecore/commands/FightCommand.java +++ b/src/de/steamwar/bungeecore/commands/FightCommand.java @@ -20,7 +20,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; -import de.steamwar.bungeecore.listeners.mods.Fabric; +import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; @@ -128,7 +128,7 @@ public class FightCommand extends BasicCommand { if(!(sender instanceof ProxiedPlayer)) return; - if(Fabric.isFabric((ProxiedPlayer) sender)) { + if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender) && !precommand.equals("/bau testarena")) { BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric nicht auf die Arenen darf?"); return; } diff --git a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java b/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java similarity index 86% rename from src/de/steamwar/bungeecore/listeners/mods/Fabric.java rename to src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java index 12ec282..d067fb1 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java +++ b/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java @@ -31,7 +31,7 @@ import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.ServerSwitchEvent; import net.md_5.bungee.event.EventHandler; -public class Fabric extends BasicListener { +public class ModLoaderBlocker extends BasicListener { @EventHandler public void onPluginMessageEvent(PluginMessageEvent e){ @@ -46,6 +46,10 @@ public class Fabric extends BasicListener { ProxiedPlayer p = (ProxiedPlayer) sender; Storage.fabricPlayers.add(p); BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du hast Fabric installiert. Mit Fabric kannst du nicht auf die Arenen"); + }else if(new String(e.getData()).contains("LiteLoader")) { + ProxiedPlayer p = (ProxiedPlayer) sender; + Storage.fabricPlayers.add(p); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du hast LiteLoader installiert. Mit LireLoader kannst du nicht auf die Arenen"); } } @@ -60,7 +64,7 @@ public class Fabric extends BasicListener { && Subserver.getSubserver(event.getPlayer()).getType() == Servertype.ARENA && isFabric(event.getPlayer())) { event.getPlayer().connect(BungeeCore.get().getProxy().getServerInfo(BungeeCore.LOBBY_SERVER)); - BungeeCore.send(event.getPlayer(), BungeeCore.CHAT_PREFIX + "§cDu kannst nicht auf die Arena mit Fabric"); + BungeeCore.send(event.getPlayer(), BungeeCore.CHAT_PREFIX + "§cMit Fabric und LiteLoader kannst du nicht auf die Arenen"); } } From bffb3f6c9946795db0d3da5264bdcd9b4a33111d Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 30 Oct 2020 23:05:49 +0100 Subject: [PATCH 02/10] LireLoader --- src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java b/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java index d067fb1..af123d8 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java +++ b/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java @@ -49,7 +49,7 @@ public class ModLoaderBlocker extends BasicListener { }else if(new String(e.getData()).contains("LiteLoader")) { ProxiedPlayer p = (ProxiedPlayer) sender; Storage.fabricPlayers.add(p); - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du hast LiteLoader installiert. Mit LireLoader kannst du nicht auf die Arenen"); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du hast LiteLoader installiert. Mit LiteLoader kannst du nicht auf die Arenen"); } } From 2f257929a86e7fb366d6ce31f458b360c6215d7e Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 31 Oct 2020 11:11:11 +0100 Subject: [PATCH 03/10] LiteLoader --- src/de/steamwar/bungeecore/commands/FightCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 88e4229..1c6cd2e 100644 --- a/src/de/steamwar/bungeecore/commands/FightCommand.java +++ b/src/de/steamwar/bungeecore/commands/FightCommand.java @@ -129,7 +129,7 @@ public class FightCommand extends BasicCommand { return; if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender) && !precommand.equals("/bau testarena")) { - BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric nicht auf die Arenen darf?"); + BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric/LiteLoader nicht auf die Arenen darf?"); return; } From 6b589ec5de993bbf790151a4f6f47fa580074fac Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 1 Nov 2020 09:38:16 +0100 Subject: [PATCH 04/10] LiteLoader --- src/de/steamwar/bungeecore/commands/ChallengeCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 28df922..231081b 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -48,7 +48,7 @@ public class ChallengeCommand extends BasicCommand { return; if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender)) { - BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric nicht auf die Arenen darf?"); + BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric/LiteLoader nicht auf die Arenen darf?"); return; } From 8c3df0e1ddb0ffaa0460147da62326ddca0bf577 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 6 Nov 2020 13:40:59 +0100 Subject: [PATCH 05/10] Fix server order Signed-off-by: Lixfel --- .../bungeecore/comms/handlers/TablistNameHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/comms/handlers/TablistNameHandler.java b/src/de/steamwar/bungeecore/comms/handlers/TablistNameHandler.java index 6f04943..678d930 100644 --- a/src/de/steamwar/bungeecore/comms/handlers/TablistNameHandler.java +++ b/src/de/steamwar/bungeecore/comms/handlers/TablistNameHandler.java @@ -12,6 +12,9 @@ public class TablistNameHandler implements SpigotHandler { @Override public void handle(ByteArrayDataInput byteArrayDataInput) { ProxiedPlayer player = ProxyServer.getInstance().getPlayer(SteamwarUser.get(byteArrayDataInput.readInt()).getUuid()); - Subserver.getSubserver(player).getTablistNames().put(player, byteArrayDataInput.readUTF()); + Subserver subserver = Subserver.getSubserver(player.getServer().getInfo()); + if(subserver == null) + return; + subserver.getTablistNames().put(player, byteArrayDataInput.readUTF()); } } From 8682bb9b66cb913f632317462a86eab8a119bc34 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 20 Nov 2020 01:06:47 +0100 Subject: [PATCH 06/10] Add PollResult Command --- src/de/steamwar/bungeecore/BungeeCore.java | 1 + .../commands/PollresultCommand.java | 50 +++++++++++++++++++ .../bungeecore/listeners/PollSystem.java | 4 ++ .../steamwar/bungeecore/sql/PollAnswer.java | 28 +++++++++++ .../steamwar/messages/BungeeCore.properties | 4 ++ 5 files changed, 87 insertions(+) create mode 100644 src/de/steamwar/bungeecore/commands/PollresultCommand.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index a6a9cca..6252b19 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -119,6 +119,7 @@ public class BungeeCore extends Plugin { new RankCommand(); new IgnoreCommand(); new UnIgnoreCommand(); + new PollresultCommand(); if(!EVENT_MODE){ new WebregisterCommand(); diff --git a/src/de/steamwar/bungeecore/commands/PollresultCommand.java b/src/de/steamwar/bungeecore/commands/PollresultCommand.java new file mode 100644 index 0000000..f8412dc --- /dev/null +++ b/src/de/steamwar/bungeecore/commands/PollresultCommand.java @@ -0,0 +1,50 @@ +/* + 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.listeners.PollSystem; +import de.steamwar.bungeecore.sql.PollAnswer; +import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.connection.ProxiedPlayer; + +import java.util.Map; + +public class PollresultCommand extends BasicCommand { + + public PollresultCommand() { + super("pollresult", "bungeecore.pollresults"); + } + + @Override + public void execute(CommandSender sender, String[] strings) { + if(!(sender instanceof ProxiedPlayer)) + return; + ProxiedPlayer player = (ProxiedPlayer) sender; + + Map voted = PollAnswer.getCurrentResults(); + Message.send("POLLRESULT_HEADER", player, PollAnswer.getAllAnswered(), PollSystem.getQuestion()); + int i = 1; + for (Map.Entry e: voted.entrySet()) { + Message.send("POLLRESULT_LIST", sender, i, e.getKey(), e.getValue()); + i++; + } + } +} diff --git a/src/de/steamwar/bungeecore/listeners/PollSystem.java b/src/de/steamwar/bungeecore/listeners/PollSystem.java index 4572e27..3dcca63 100644 --- a/src/de/steamwar/bungeecore/listeners/PollSystem.java +++ b/src/de/steamwar/bungeecore/listeners/PollSystem.java @@ -78,4 +78,8 @@ public class PollSystem extends BasicListener { public static int answers(){ return answers.size(); } + + public static String getAnswer(int i) { + return answers.get(i); + } } diff --git a/src/de/steamwar/bungeecore/sql/PollAnswer.java b/src/de/steamwar/bungeecore/sql/PollAnswer.java index 043d1a6..f8f6b74 100644 --- a/src/de/steamwar/bungeecore/sql/PollAnswer.java +++ b/src/de/steamwar/bungeecore/sql/PollAnswer.java @@ -24,6 +24,8 @@ import de.steamwar.bungeecore.listeners.PollSystem; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; public class PollAnswer { @@ -53,6 +55,32 @@ public class PollAnswer { } } + public static Map getCurrentResults() { + ResultSet set = SQL.select("SELECT Count(UserID) AS Times, Answer FROM PollAnswer WHERE Question = ? GROUP BY Answer ORDER BY `Times` ASC", PollSystem.getQuestion()); + try { + Map retMap = new HashMap<>(); + while (set.next()) { + retMap.put(PollSystem.getAnswer(set.getInt("Answer")), set.getInt("Times")); + } + return retMap; + }catch (SQLException e) { + BungeeCore.log("Unable to get PollAnswer", e); + throw new SecurityException(); + } + } + + public static Integer getAllAnswered() { + ResultSet set = SQL.select("SELECT Count(UserID) AS Times FROM PollAnswer"); + try { + if(!set.next()) + throw new SecurityException("Could not get PollAnswers"); + return set.getInt("Times"); + }catch (SQLException e) { + BungeeCore.log("Unable to get PollAnswer", e); + throw new SecurityException(); + } + } + public boolean hasAnswered(){ return answer != 0; } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 6855cb7..5bcca7f 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -53,3 +53,7 @@ HELP_BAU_TESTARENA=§8/§ebau testarena §8- §7Starte eine Testarena HELP_BAU_TESTARENA_HOVER=§eTestarena starten HELP_BAU_BAU=§8/§ehelp bau §8- §7Hilfe zu nützlichen Werkzeugen HELP_BAU_BAU_HOVER=§eNützliche Zusatzfunktionen + +#PollresultCommand +POLLRESULT_HEADER=§e§lEs haben {0} abgestimmt auf die Frage: §f{1} +POLLRESULT_LIST=§e{0}. §7{1} mit {2} stimmen \ No newline at end of file From a3179483fde394351612b4246a7ab7e2370db334 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 20 Nov 2020 09:45:33 +0100 Subject: [PATCH 07/10] Changing Messages --- src/de/steamwar/bungeecore/commands/PollresultCommand.java | 4 +--- src/de/steamwar/bungeecore/sql/PollAnswer.java | 2 +- src/de/steamwar/messages/BungeeCore.properties | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/PollresultCommand.java b/src/de/steamwar/bungeecore/commands/PollresultCommand.java index f8412dc..bdcfb1b 100644 --- a/src/de/steamwar/bungeecore/commands/PollresultCommand.java +++ b/src/de/steamwar/bungeecore/commands/PollresultCommand.java @@ -41,10 +41,8 @@ public class PollresultCommand extends BasicCommand { Map voted = PollAnswer.getCurrentResults(); Message.send("POLLRESULT_HEADER", player, PollAnswer.getAllAnswered(), PollSystem.getQuestion()); - int i = 1; for (Map.Entry e: voted.entrySet()) { - Message.send("POLLRESULT_LIST", sender, i, e.getKey(), e.getValue()); - i++; + Message.send("POLLRESULT_LIST", sender, e.getKey(), e.getValue()); } } } diff --git a/src/de/steamwar/bungeecore/sql/PollAnswer.java b/src/de/steamwar/bungeecore/sql/PollAnswer.java index f8f6b74..72c462f 100644 --- a/src/de/steamwar/bungeecore/sql/PollAnswer.java +++ b/src/de/steamwar/bungeecore/sql/PollAnswer.java @@ -70,7 +70,7 @@ public class PollAnswer { } public static Integer getAllAnswered() { - ResultSet set = SQL.select("SELECT Count(UserID) AS Times FROM PollAnswer"); + ResultSet set = SQL.select("SELECT Count(UserID) AS Times FROM PollAnswer WHERE Question = ?", PollSystem.getQuestion()); try { if(!set.next()) throw new SecurityException("Could not get PollAnswers"); diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 5bcca7f..0bf5a04 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -55,5 +55,5 @@ HELP_BAU_BAU=§8/§ehelp bau §8- §7Hilfe zu nützlichen Werkzeugen HELP_BAU_BAU_HOVER=§eNützliche Zusatzfunktionen #PollresultCommand -POLLRESULT_HEADER=§e§lEs haben {0} abgestimmt auf die Frage: §f{1} -POLLRESULT_LIST=§e{0}. §7{1} mit {2} stimmen \ No newline at end of file +POLLRESULT_HEADER=§eEs haben {0} abgestimmt auf die Frage: §7{1} +POLLRESULT_LIST=§e{0}§8: §7{1} \ No newline at end of file From d9f16172350f91f95f2a105f9ee67d99d0e30100 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 22 Nov 2020 08:49:54 +0100 Subject: [PATCH 08/10] Fix chat-msgs Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/BungeeCore.java | 2 ++ src/de/steamwar/bungeecore/Message.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index a6a9cca..682741f 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -170,6 +170,8 @@ public class BungeeCore extends Plugin { send(player, ChatMessageType.SYSTEM, msg, onHover, onClick); } public static void send(ProxiedPlayer player, ChatMessageType type, String msg, String onHover, ClickEvent onClick){ + if(type == ChatMessageType.CHAT && player.getChatMode() != ProxiedPlayer.ChatMode.SHOWN) + return; TextComponent message = stringToText(msg); if(onHover != null) message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(onHover))); diff --git a/src/de/steamwar/bungeecore/Message.java b/src/de/steamwar/bungeecore/Message.java index 2646045..1e5e0c0 100644 --- a/src/de/steamwar/bungeecore/Message.java +++ b/src/de/steamwar/bungeecore/Message.java @@ -88,6 +88,8 @@ public class Message { } public static void send(String message, boolean prefixed, CommandSender sender, ChatMessageType type, String onHover, ClickEvent onClick, Object... params){ + if(type == ChatMessageType.CHAT && sender instanceof ProxiedPlayer && ((ProxiedPlayer)sender).getChatMode() != ProxiedPlayer.ChatMode.SHOWN) + return; TextComponent msg = parseToComponent(message, prefixed, sender, params); if(onHover != null) msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(onHover))); From 842c6e046ca5fc4271ffcf27a1badd51e10f5cb3 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 23 Nov 2020 18:58:32 +0100 Subject: [PATCH 09/10] Changing Messages --- src/de/steamwar/bungeecore/commands/PollresultCommand.java | 6 ++++++ src/de/steamwar/messages/BungeeCore.properties | 1 + 2 files changed, 7 insertions(+) diff --git a/src/de/steamwar/bungeecore/commands/PollresultCommand.java b/src/de/steamwar/bungeecore/commands/PollresultCommand.java index bdcfb1b..1d39e9e 100644 --- a/src/de/steamwar/bungeecore/commands/PollresultCommand.java +++ b/src/de/steamwar/bungeecore/commands/PollresultCommand.java @@ -37,6 +37,12 @@ public class PollresultCommand extends BasicCommand { public void execute(CommandSender sender, String[] strings) { if(!(sender instanceof ProxiedPlayer)) return; + + if(PollSystem.noCurrentPoll()) { + Message.send("POLLRESULT_NOPOLL", sender); + return; + } + ProxiedPlayer player = (ProxiedPlayer) sender; Map voted = PollAnswer.getCurrentResults(); diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 0bf5a04..e4cc7a2 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -55,5 +55,6 @@ HELP_BAU_BAU=§8/§ehelp bau §8- §7Hilfe zu nützlichen Werkzeugen HELP_BAU_BAU_HOVER=§eNützliche Zusatzfunktionen #PollresultCommand +POLLRESULT_NOPOLL=§cDerzeit läuft keine Umfrage. POLLRESULT_HEADER=§eEs haben {0} abgestimmt auf die Frage: §7{1} POLLRESULT_LIST=§e{0}§8: §7{1} \ No newline at end of file From 71ad90ea2f0c833e61a508aec2f62c6ca86bb0eb Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 27 Nov 2020 15:17:31 +0100 Subject: [PATCH 10/10] Fixing Error Logging --- src/de/steamwar/bungeecore/sql/PollAnswer.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/sql/PollAnswer.java b/src/de/steamwar/bungeecore/sql/PollAnswer.java index 72c462f..62fcee0 100644 --- a/src/de/steamwar/bungeecore/sql/PollAnswer.java +++ b/src/de/steamwar/bungeecore/sql/PollAnswer.java @@ -50,8 +50,7 @@ public class PollAnswer { return new PollAnswer(userID, PollSystem.getQuestion()); return new PollAnswer(rs); } catch (SQLException e) { - BungeeCore.log("Unable to get PollAnswer", e); - throw new SecurityException(); + throw new SecurityException("Unable to get PollAnswer", e); } } @@ -64,8 +63,7 @@ public class PollAnswer { } return retMap; }catch (SQLException e) { - BungeeCore.log("Unable to get PollAnswer", e); - throw new SecurityException(); + throw new SecurityException("Unable to get PollAnswer", e); } } @@ -76,8 +74,7 @@ public class PollAnswer { throw new SecurityException("Could not get PollAnswers"); return set.getInt("Times"); }catch (SQLException e) { - BungeeCore.log("Unable to get PollAnswer", e); - throw new SecurityException(); + throw new SecurityException("Unable to get PollAnswer", e); } }