From 1e2f2441abcc963c092aad58f11144d28ff7cc9d Mon Sep 17 00:00:00 2001 From: Jan9103 Date: Thu, 11 Jun 2020 12:48:56 +0200 Subject: [PATCH 1/9] Ignore-System initial push --- src/de/steamwar/bungeecore/BungeeCore.java | 2 + src/de/steamwar/bungeecore/IgnoreSystem.java | 157 ++++++++++++++++++ .../bungeecore/commands/ChallengeCommand.java | 10 ++ .../bungeecore/commands/IgnoreCommand.java | 32 ++++ .../bungeecore/commands/MsgCommand.java | 4 + .../bungeecore/commands/UnIgnoreCommand.java | 29 ++++ .../listeners/ConnectionListener.java | 3 + 7 files changed, 237 insertions(+) create mode 100644 src/de/steamwar/bungeecore/IgnoreSystem.java create mode 100644 src/de/steamwar/bungeecore/commands/IgnoreCommand.java create mode 100644 src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 85d43d7..367fddd 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -51,6 +51,8 @@ public class BungeeCore extends Plugin { public void onEnable(){ setInstance(this); loadConfig(); + + IgnoreSystem.folder = new File(getDataFolder() + "/ignoreSystem/"); //folder where the playerdata from the "/ignore" system is saved new ErrorLogger(); new ConnectionListener(); diff --git a/src/de/steamwar/bungeecore/IgnoreSystem.java b/src/de/steamwar/bungeecore/IgnoreSystem.java new file mode 100644 index 0000000..4444f75 --- /dev/null +++ b/src/de/steamwar/bungeecore/IgnoreSystem.java @@ -0,0 +1,157 @@ +package de.steamwar.bungeecore; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.UUID; + +import net.md_5.bungee.api.connection.ProxiedPlayer; + +public class IgnoreSystem{ + private static HashMap ignorers = new HashMap(); + public static File folder; //FileSystem-Folder: ../ignoreSystem/ + + //TODO load and unLoad functions - Filesystem + + public static boolean isIgnored(UUID ignorer, UUID ignored) { + if (!ignorers.containsKey(ignorer)) + ignorers.put(ignorer, new IgnoreSystem(ignorer)); + return ignorers.get(ignorer).isIgnoring(ignored); + } + + public static void load(UUID id) { + if (!ignorers.containsKey(id)) + ignorers.put(id, new IgnoreSystem(id)); + } + + public static void onStop() { + ignorers.forEach((u,i) -> { + i.saveId(u); + }); + } + + public static void save(UUID id) { + if (ignorers.containsKey(id)) + ignorers.get(id).saveId(id); + } + + public static void unLoad(UUID id) { + if (ignorers.containsKey(id)) + ignorers.remove(id); + } + + public static void ignore(ProxiedPlayer victim, ProxiedPlayer offender) { + if (victim==null || offender==null) return; + if (!ignorers.containsKey(victim.getUniqueId())) + ignorers.put(victim.getUniqueId(), new IgnoreSystem(victim.getUniqueId())); + ignorers.get(victim.getUniqueId()).ignore(offender.getUniqueId()); + } + + public static void unIgnore(ProxiedPlayer victim, ProxiedPlayer offender) { + if (victim==null || offender==null) return; + if (!ignorers.containsKey(victim.getUniqueId())) + ignorers.put(victim.getUniqueId(), new IgnoreSystem(victim.getUniqueId())); + ignorers.get(victim.getUniqueId()).unIgnore(offender.getUniqueId()); + } + + //--------Ignoring-Player-Instance-Below----------------------------- + + /** + * List of Ignored Players + */ + private ArrayList ignored; + + /** + * is THIS instance ignoring [id] + * @param id the person, which might get ignored + */ + public boolean isIgnoring(UUID id) { + return ignored.contains(id); + } + + /** + * + * @param id + */ + public IgnoreSystem(UUID id) { + ignored = new ArrayList(); + File f = new File(folder+id.toString()+".cfg"); + if (f.exists()) { + try { + FileReader fr = new FileReader(f); + int a=0; + String current=""; + try { + while ((a=fr.read())!=-1) { + char c = (char) a; + if (c=='\n') { + if (current!="") + ignored.add(UUID.fromString(current)); + current=""; + }else + current+=c; + } + } catch (IOException e) { + e.printStackTrace(); + } + } catch (FileNotFoundException e) {} //impossible + } + } + + /** + * start ignoring someone + * @param id annoying person + */ + public void ignore(UUID id) { + if (!ignored.contains(id)) + ignored.add(id); + } + + /** + * stop ignoring someone + * @param id forgiven person + */ + public void unIgnore(UUID id) { + if (ignored.contains(id)) + ignored.remove(id); + } + + /** + * Save this Users-Data to a File + * @param id UUID of Player -> Filename + */ + public void saveId(UUID id) { + File f = new File(folder+id.toString()+".cfg"); + if (!f.exists()) { + try { + f.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + return; + } + } + if (ignored.size()<1) { + f.delete(); + return; + } + try { + FileWriter fw = new FileWriter(f); + String s = ""; + for (UUID i : ignored) + s+=i.toString()+'\n'; + char[] o = s.toCharArray(); + char[] i=new char[o.length+1]; + for (int k=0;k Date: Thu, 25 Jun 2020 11:37:59 +0200 Subject: [PATCH 2/9] moved to SQL TODO: create SQL-Table: UserIgnoreSystem(String a) --- src/de/steamwar/bungeecore/BungeeCore.java | 2 - src/de/steamwar/bungeecore/IgnoreSystem.java | 157 ------------------ .../bungeecore/commands/ChallengeCommand.java | 1 + .../bungeecore/commands/IgnoreCommand.java | 4 +- .../bungeecore/commands/MsgCommand.java | 2 +- .../bungeecore/commands/UnIgnoreCommand.java | 4 +- .../listeners/ConnectionListener.java | 3 - .../steamwar/bungeecore/sql/IgnoreSystem.java | 26 +++ 8 files changed, 32 insertions(+), 167 deletions(-) delete mode 100644 src/de/steamwar/bungeecore/IgnoreSystem.java create mode 100644 src/de/steamwar/bungeecore/sql/IgnoreSystem.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 367fddd..aaa88a2 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -52,8 +52,6 @@ public class BungeeCore extends Plugin { setInstance(this); loadConfig(); - IgnoreSystem.folder = new File(getDataFolder() + "/ignoreSystem/"); //folder where the playerdata from the "/ignore" system is saved - new ErrorLogger(); new ConnectionListener(); new Forge(); diff --git a/src/de/steamwar/bungeecore/IgnoreSystem.java b/src/de/steamwar/bungeecore/IgnoreSystem.java deleted file mode 100644 index 4444f75..0000000 --- a/src/de/steamwar/bungeecore/IgnoreSystem.java +++ /dev/null @@ -1,157 +0,0 @@ -package de.steamwar.bungeecore; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.UUID; - -import net.md_5.bungee.api.connection.ProxiedPlayer; - -public class IgnoreSystem{ - private static HashMap ignorers = new HashMap(); - public static File folder; //FileSystem-Folder: ../ignoreSystem/ - - //TODO load and unLoad functions - Filesystem - - public static boolean isIgnored(UUID ignorer, UUID ignored) { - if (!ignorers.containsKey(ignorer)) - ignorers.put(ignorer, new IgnoreSystem(ignorer)); - return ignorers.get(ignorer).isIgnoring(ignored); - } - - public static void load(UUID id) { - if (!ignorers.containsKey(id)) - ignorers.put(id, new IgnoreSystem(id)); - } - - public static void onStop() { - ignorers.forEach((u,i) -> { - i.saveId(u); - }); - } - - public static void save(UUID id) { - if (ignorers.containsKey(id)) - ignorers.get(id).saveId(id); - } - - public static void unLoad(UUID id) { - if (ignorers.containsKey(id)) - ignorers.remove(id); - } - - public static void ignore(ProxiedPlayer victim, ProxiedPlayer offender) { - if (victim==null || offender==null) return; - if (!ignorers.containsKey(victim.getUniqueId())) - ignorers.put(victim.getUniqueId(), new IgnoreSystem(victim.getUniqueId())); - ignorers.get(victim.getUniqueId()).ignore(offender.getUniqueId()); - } - - public static void unIgnore(ProxiedPlayer victim, ProxiedPlayer offender) { - if (victim==null || offender==null) return; - if (!ignorers.containsKey(victim.getUniqueId())) - ignorers.put(victim.getUniqueId(), new IgnoreSystem(victim.getUniqueId())); - ignorers.get(victim.getUniqueId()).unIgnore(offender.getUniqueId()); - } - - //--------Ignoring-Player-Instance-Below----------------------------- - - /** - * List of Ignored Players - */ - private ArrayList ignored; - - /** - * is THIS instance ignoring [id] - * @param id the person, which might get ignored - */ - public boolean isIgnoring(UUID id) { - return ignored.contains(id); - } - - /** - * - * @param id - */ - public IgnoreSystem(UUID id) { - ignored = new ArrayList(); - File f = new File(folder+id.toString()+".cfg"); - if (f.exists()) { - try { - FileReader fr = new FileReader(f); - int a=0; - String current=""; - try { - while ((a=fr.read())!=-1) { - char c = (char) a; - if (c=='\n') { - if (current!="") - ignored.add(UUID.fromString(current)); - current=""; - }else - current+=c; - } - } catch (IOException e) { - e.printStackTrace(); - } - } catch (FileNotFoundException e) {} //impossible - } - } - - /** - * start ignoring someone - * @param id annoying person - */ - public void ignore(UUID id) { - if (!ignored.contains(id)) - ignored.add(id); - } - - /** - * stop ignoring someone - * @param id forgiven person - */ - public void unIgnore(UUID id) { - if (ignored.contains(id)) - ignored.remove(id); - } - - /** - * Save this Users-Data to a File - * @param id UUID of Player -> Filename - */ - public void saveId(UUID id) { - File f = new File(folder+id.toString()+".cfg"); - if (!f.exists()) { - try { - f.createNewFile(); - } catch (IOException e) { - e.printStackTrace(); - return; - } - } - if (ignored.size()<1) { - f.delete(); - return; - } - try { - FileWriter fw = new FileWriter(f); - String s = ""; - for (UUID i : ignored) - s+=i.toString()+'\n'; - char[] o = s.toCharArray(); - char[] i=new char[o.length+1]; - for (int k=0;k it cant contain 'z' + + public static boolean isIgnored(UUID ignorer, UUID ignored) { + try { + return !(SQL.select("SELECT * FROM UserIgnoreSystem WHERE a = ?", ignorer.toString()+"z"+ignored.toString())).next(); + } catch (SQLException e) {return false;} + } + public static void ignore(UUID victim, UUID offender) { + if (victim==null || offender==null) return; + if (!isIgnored(victim,offender)) + SQL.update("INSERT INTO UserIgnoreSystem (a) VALUES (?)",victim.toString()+"z"+offender.toString()); + } + public static void unIgnore(UUID victim, UUID offender) { + if (victim==null || offender==null) return; + SQL.update("DELETE FROM UserIgnoreSystem WHERE a = " + victim.toString()+"z"+offender.toString()); + } +} \ No newline at end of file From d9efeefd2b5c407e4914fb33b2bc20ecf05394ed Mon Sep 17 00:00:00 2001 From: Jan9103 Date: Thu, 25 Jun 2020 11:43:05 +0200 Subject: [PATCH 3/9] Command-Permission-Updated --- src/de/steamwar/bungeecore/commands/ChallengeCommand.java | 5 +---- src/de/steamwar/bungeecore/commands/IgnoreCommand.java | 4 ++-- src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 476e933..663145e 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -24,10 +24,7 @@ public class ChallengeCommand extends BasicCommand { return; } - if (!(sender instanceof ProxiedPlayer)) { - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "You cant run this from the Console.."); - return; - } + if (!(sender instanceof ProxiedPlayer)) {return;} ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); if(target == null){ diff --git a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java index 273c506..328cd4a 100644 --- a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java @@ -9,7 +9,7 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; public class IgnoreCommand extends BasicCommand { public IgnoreCommand() { - super("ignore", "steamwar.ignore"); + super("ignore", null); } @Override @@ -21,7 +21,7 @@ public class IgnoreCommand extends BasicCommand { BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); return; }else if(target.equals(p)){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber Ignorieren?"); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber ignorieren?"); return; }else { IgnoreSystem.ignore(p.getUniqueId(), target.getUniqueId()); diff --git a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java index 32c7ff6..3ed130c 100644 --- a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java @@ -9,7 +9,7 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; public class UnIgnoreCommand extends BasicCommand { public UnIgnoreCommand() { - super("unignore", "steamwar.ignore"); + super("unignore", null); } @Override From bfd0b11e47df69bbe983f5aeafd0aba06f3e32d4 Mon Sep 17 00:00:00 2001 From: Jan9103 Date: Thu, 25 Jun 2020 11:46:43 +0200 Subject: [PATCH 4/9] Steamwar-User statt Proxied Player --- src/de/steamwar/bungeecore/commands/IgnoreCommand.java | 9 +++++---- src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java index 328cd4a..f9d2b8c 100644 --- a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java @@ -2,6 +2,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.sql.IgnoreSystem; +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.connection.ProxiedPlayer; @@ -16,16 +17,16 @@ public class IgnoreCommand extends BasicCommand { public void execute(CommandSender s, String[] args) { if (!(s instanceof ProxiedPlayer)) return; ProxiedPlayer p = (ProxiedPlayer) s; - ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); + SteamwarUser target = SteamwarUser.get(args[0]); if(target == null){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler wurde nicht in der Datenbank gefunden!"); return; }else if(target.equals(p)){ BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber ignorieren?"); return; }else { - IgnoreSystem.ignore(p.getUniqueId(), target.getUniqueId()); - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du ignorierst nun " + target.getDisplayName() + "."); + IgnoreSystem.ignore(p.getUniqueId(), target.getUuid()); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du ignorierst nun " + target.getUserName() + "."); } } diff --git a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java index 3ed130c..c75f27e 100644 --- a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java @@ -2,8 +2,8 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.sql.IgnoreSystem; +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.connection.ProxiedPlayer; public class UnIgnoreCommand extends BasicCommand { @@ -16,13 +16,13 @@ public class UnIgnoreCommand extends BasicCommand { public void execute(CommandSender s, String[] args) { if (!(s instanceof ProxiedPlayer)) return; ProxiedPlayer p = (ProxiedPlayer) s; - ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); + SteamwarUser target = SteamwarUser.get(args[0]); if(target == null){ BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); return; }else { - IgnoreSystem.unIgnore(p.getUniqueId(), target.getUniqueId()); - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du beachtest nun " + target.getDisplayName() + " wieder."); + IgnoreSystem.unIgnore(p.getUniqueId(), target.getUuid()); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du beachtest nun " + target.getUserName() + " wieder."); } } From e01c1200566ff07b8f16a81707b306f0d8df9736 Mon Sep 17 00:00:00 2001 From: Jan9103 Date: Tue, 30 Jun 2020 07:42:01 +0200 Subject: [PATCH 5/9] ignore system --- src/de/steamwar/bungeecore/commands/IgnoreCommand.java | 1 - src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java index f9d2b8c..21b00bf 100644 --- a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java @@ -4,7 +4,6 @@ import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.sql.IgnoreSystem; 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.connection.ProxiedPlayer; public class IgnoreCommand extends BasicCommand { diff --git a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java index c75f27e..3191c00 100644 --- a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java @@ -26,4 +26,4 @@ public class UnIgnoreCommand extends BasicCommand { } } -} +} \ No newline at end of file From 5b4cb4fc108c07dc6a1376bce4ac02a4b1d3a0ee Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 8 Jul 2020 16:30:44 +0200 Subject: [PATCH 6/9] /r included --- .../steamwar/bungeecore/commands/RCommand.java | 6 +++++- .../bungeecore/commands/UnIgnoreCommand.java | 16 ++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/RCommand.java b/src/de/steamwar/bungeecore/commands/RCommand.java index 2ff68d2..e2136d5 100644 --- a/src/de/steamwar/bungeecore/commands/RCommand.java +++ b/src/de/steamwar/bungeecore/commands/RCommand.java @@ -1,6 +1,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.sql.IgnoreSystem; import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -31,7 +32,10 @@ public class RCommand extends BasicCommand { BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu hast bisher mit niemandem geschrieben!"); return; } - + if (IgnoreSystem.isIgnored(target.getUniqueId(), player.getUniqueId())) { + BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!"); + return; + } if(!target.isConnected()){ BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); return; diff --git a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java index 3191c00..b172203 100644 --- a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java @@ -16,14 +16,14 @@ public class UnIgnoreCommand extends BasicCommand { public void execute(CommandSender s, String[] args) { if (!(s instanceof ProxiedPlayer)) return; ProxiedPlayer p = (ProxiedPlayer) s; - SteamwarUser target = SteamwarUser.get(args[0]); - if(target == null){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); - return; - }else { - IgnoreSystem.unIgnore(p.getUniqueId(), target.getUuid()); - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du beachtest nun " + target.getUserName() + " wieder."); - } + SteamwarUser t = SteamwarUser.get(args[0]); + if(t == null){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); + return; + }else { + IgnoreSystem.unIgnore(p.getUniqueId(), t.getUuid()); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du beachtest nun " + t.getUserName() + " wieder."); + } } } \ No newline at end of file From cc3a5fcf18e156f9df9a8684d76c395b33562a04 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 25 Aug 2020 19:16:01 +0200 Subject: [PATCH 7/9] A probably working ignore system Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/BungeeCore.java | 4 +- .../bungeecore/commands/ChallengeCommand.java | 11 ++- .../bungeecore/commands/IgnoreCommand.java | 74 +++++++++++-------- .../bungeecore/commands/MsgCommand.java | 2 +- .../bungeecore/commands/RCommand.java | 10 +-- .../bungeecore/commands/UnIgnoreCommand.java | 67 ++++++++++------- .../steamwar/bungeecore/sql/IgnoreSystem.java | 55 +++++++------- 7 files changed, 124 insertions(+), 99 deletions(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 35b9094..94fcd12 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -52,7 +52,7 @@ public class BungeeCore extends Plugin { public void onEnable(){ setInstance(this); loadConfig(); - + new ErrorLogger(); new ConnectionListener(); new Forge(); @@ -99,6 +99,8 @@ public class BungeeCore extends Plugin { new CheckCommand(); new RankedCommand(); new RankCommand(); + new IgnoreCommand(); + new UnIgnoreCommand(); new EventStarter(); new Broadcaster(); diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 28ad61f..18e3ab9 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -24,19 +24,18 @@ public class ChallengeCommand extends BasicCommand { return; } - if (!(sender instanceof ProxiedPlayer)) {return;} + if (!(sender instanceof ProxiedPlayer)) + return; ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); if(target == null){ - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer gewünschte Spieler ist nicht online."); + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte ist nicht online."); return; }else if(target == sender){ BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cSchizophren?"); return; - } - - if (IgnoreSystem.isIgnored(target.getUniqueId(), ((ProxiedPlayer) sender).getUniqueId())) { - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer gewünschte Spieler hat dich geblockt."); + }else if (IgnoreSystem.isIgnored(target, (ProxiedPlayer) sender)) { + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte hat dich geblockt."); return; } diff --git a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java index 21b00bf..7f7d541 100644 --- a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java @@ -1,32 +1,42 @@ -package de.steamwar.bungeecore.commands; - -import de.steamwar.bungeecore.BungeeCore; -import de.steamwar.bungeecore.sql.IgnoreSystem; -import de.steamwar.bungeecore.sql.SteamwarUser; -import net.md_5.bungee.api.CommandSender; -import net.md_5.bungee.api.connection.ProxiedPlayer; - -public class IgnoreCommand extends BasicCommand { - - public IgnoreCommand() { - super("ignore", null); - } - - @Override - public void execute(CommandSender s, String[] args) { - if (!(s instanceof ProxiedPlayer)) return; - ProxiedPlayer p = (ProxiedPlayer) s; - SteamwarUser target = SteamwarUser.get(args[0]); - if(target == null){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler wurde nicht in der Datenbank gefunden!"); - return; - }else if(target.equals(p)){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber ignorieren?"); - return; - }else { - IgnoreSystem.ignore(p.getUniqueId(), target.getUuid()); - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du ignorierst nun " + target.getUserName() + "."); - } - } - -} +package de.steamwar.bungeecore.commands; + +import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.sql.IgnoreSystem; +import de.steamwar.bungeecore.sql.SteamwarUser; +import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.connection.ProxiedPlayer; + +public class IgnoreCommand extends BasicCommand { + + public IgnoreCommand() { + super("ignore", null); + } + + @Override + public void execute(CommandSender sender, String[] args) { + if(args.length < 1) { + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eignore §8[§7Spieler§8]"); + return; + } + + if (!(sender instanceof ProxiedPlayer)) + return; + ProxiedPlayer p = (ProxiedPlayer) sender; + SteamwarUser user = SteamwarUser.get(p.getUniqueId()); + + SteamwarUser target = SteamwarUser.get(args[0]); + if(target == null){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht."); + return; + }else if(target.equals(user)){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber ignorieren?"); + return; + }else if(IgnoreSystem.isIgnored(user, target)){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler bereits."); + return; + } + + IgnoreSystem.ignore(user, target); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du ignorierst nun §e" + target.getUserName() + "§8."); + } +} diff --git a/src/de/steamwar/bungeecore/commands/MsgCommand.java b/src/de/steamwar/bungeecore/commands/MsgCommand.java index 3b59d96..58b73d0 100644 --- a/src/de/steamwar/bungeecore/commands/MsgCommand.java +++ b/src/de/steamwar/bungeecore/commands/MsgCommand.java @@ -38,7 +38,7 @@ public class MsgCommand extends BasicCommand { if(target == null){ BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); return; - }else if (IgnoreSystem.isIgnored(target.getUniqueId(), player.getUniqueId())) { + }else if (IgnoreSystem.isIgnored(target, player)) { BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!"); return; }else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){ diff --git a/src/de/steamwar/bungeecore/commands/RCommand.java b/src/de/steamwar/bungeecore/commands/RCommand.java index 3f08a4e..2f01303 100644 --- a/src/de/steamwar/bungeecore/commands/RCommand.java +++ b/src/de/steamwar/bungeecore/commands/RCommand.java @@ -31,14 +31,12 @@ public class RCommand extends BasicCommand { if(target == null){ BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu hast bisher mit niemandem geschrieben!"); return; - } - if (IgnoreSystem.isIgnored(target.getUniqueId(), player.getUniqueId())) { - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!"); - return; - } - if(!target.isConnected()){ + }else if(!target.isConnected()){ BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); return; + }else if (IgnoreSystem.isIgnored(target, player)) { + BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!"); + return; }else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){ BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler empfängt derzeit keine Chatnachrichten!"); return; diff --git a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java index b172203..94ffa76 100644 --- a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java @@ -1,29 +1,40 @@ -package de.steamwar.bungeecore.commands; - -import de.steamwar.bungeecore.BungeeCore; -import de.steamwar.bungeecore.sql.IgnoreSystem; -import de.steamwar.bungeecore.sql.SteamwarUser; -import net.md_5.bungee.api.CommandSender; -import net.md_5.bungee.api.connection.ProxiedPlayer; - -public class UnIgnoreCommand extends BasicCommand { - - public UnIgnoreCommand() { - super("unignore", null); - } - - @Override - public void execute(CommandSender s, String[] args) { - if (!(s instanceof ProxiedPlayer)) return; - ProxiedPlayer p = (ProxiedPlayer) s; - SteamwarUser t = SteamwarUser.get(args[0]); - if(t == null){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); - return; - }else { - IgnoreSystem.unIgnore(p.getUniqueId(), t.getUuid()); - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du beachtest nun " + t.getUserName() + " wieder."); - } - } - +package de.steamwar.bungeecore.commands; + +import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.sql.IgnoreSystem; +import de.steamwar.bungeecore.sql.SteamwarUser; +import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.connection.ProxiedPlayer; + +public class UnIgnoreCommand extends BasicCommand { + + public UnIgnoreCommand() { + super("unignore", null); + } + + @Override + public void execute(CommandSender sender, String[] args) { + if(args.length < 1) { + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eunignore §8[§7Spieler§8]"); + return; + } + + if (!(sender instanceof ProxiedPlayer)) + return; + ProxiedPlayer p = (ProxiedPlayer) sender; + SteamwarUser user = SteamwarUser.get(p.getUniqueId()); + + SteamwarUser target = SteamwarUser.get(args[0]); + if(target == null){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht!"); + return; + }else if(!IgnoreSystem.isIgnored(user, target)){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler nicht."); + return; + } + + IgnoreSystem.unIgnore(user, target); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du empfängst nun wieder Nachrichten von §e" + target.getUserName() + "§8."); + } + } \ No newline at end of file diff --git a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java index b087ede..85d3682 100644 --- a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java +++ b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java @@ -1,26 +1,31 @@ -package de.steamwar.bungeecore.sql; - -import java.sql.SQLException; -import java.util.UUID; - -public class IgnoreSystem{ - //SQL-Table: - // Name=UserIgnoreSystem - // Content: a ([UUID des Ignoriers]z[UUID des Ignorierten]) - // UUID is a HEX-Number -> it cant contain 'z' - - public static boolean isIgnored(UUID ignorer, UUID ignored) { - try { - return !(SQL.select("SELECT * FROM UserIgnoreSystem WHERE a = ?", ignorer.toString()+"z"+ignored.toString())).next(); - } catch (SQLException e) {return false;} - } - public static void ignore(UUID victim, UUID offender) { - if (victim==null || offender==null) return; - if (!isIgnored(victim,offender)) - SQL.update("INSERT INTO UserIgnoreSystem (a) VALUES (?)",victim.toString()+"z"+offender.toString()); - } - public static void unIgnore(UUID victim, UUID offender) { - if (victim==null || offender==null) return; - SQL.update("DELETE FROM UserIgnoreSystem WHERE a = " + victim.toString()+"z"+offender.toString()); - } +package de.steamwar.bungeecore.sql; + +import net.md_5.bungee.api.connection.ProxiedPlayer; + +import java.sql.SQLException; + +public class IgnoreSystem{ + private IgnoreSystem(){} + + public static boolean isIgnored(ProxiedPlayer ignorer, ProxiedPlayer ignored){ + SteamwarUser user = SteamwarUser.get(ignorer.getUniqueId()); + SteamwarUser target = SteamwarUser.get(ignored.getUniqueId()); + return isIgnored(user, target); + } + + public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) { + try { + return !SQL.select("SELECT * FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next(); + } catch (SQLException e) { + throw new SecurityException("Could not check if ignored", e); + } + } + + public static void ignore(SteamwarUser ignorer, SteamwarUser ignored) { + SQL.update("INSERT INTO Ignore (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId()); + } + + public static void unIgnore(SteamwarUser ignorer, SteamwarUser ignored) { + SQL.update("DELETE FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()); + } } \ No newline at end of file From bca534473e4fb585ad3bff43ad30646f6877ce7a Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 25 Aug 2020 19:18:21 +0200 Subject: [PATCH 8/9] Fix indentation and line endings Signed-off-by: Lixfel --- .../bungeecore/commands/IgnoreCommand.java | 36 +++++++------- .../bungeecore/commands/UnIgnoreCommand.java | 48 +++++++++---------- .../steamwar/bungeecore/sql/IgnoreSystem.java | 38 +++++++-------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java index 7f7d541..ae9e089 100644 --- a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java @@ -8,23 +8,23 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; public class IgnoreCommand extends BasicCommand { - public IgnoreCommand() { - super("ignore", null); - } + public IgnoreCommand() { + super("ignore", null); + } - @Override - public void execute(CommandSender sender, String[] args) { - if(args.length < 1) { - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eignore §8[§7Spieler§8]"); - return; - } + @Override + public void execute(CommandSender sender, String[] args) { + if(args.length < 1) { + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eignore §8[§7Spieler§8]"); + return; + } - if (!(sender instanceof ProxiedPlayer)) - return; - ProxiedPlayer p = (ProxiedPlayer) sender; - SteamwarUser user = SteamwarUser.get(p.getUniqueId()); + if (!(sender instanceof ProxiedPlayer)) + return; + ProxiedPlayer p = (ProxiedPlayer) sender; + SteamwarUser user = SteamwarUser.get(p.getUniqueId()); - SteamwarUser target = SteamwarUser.get(args[0]); + SteamwarUser target = SteamwarUser.get(args[0]); if(target == null){ BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht."); return; @@ -32,11 +32,11 @@ public class IgnoreCommand extends BasicCommand { BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber ignorieren?"); return; }else if(IgnoreSystem.isIgnored(user, target)){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler bereits."); - return; - } + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler bereits."); + return; + } IgnoreSystem.ignore(user, target); BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du ignorierst nun §e" + target.getUserName() + "§8."); - } + } } diff --git a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java index 94ffa76..e5d7401 100644 --- a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java @@ -8,33 +8,33 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; public class UnIgnoreCommand extends BasicCommand { - public UnIgnoreCommand() { - super("unignore", null); - } + public UnIgnoreCommand() { + super("unignore", null); + } - @Override - public void execute(CommandSender sender, String[] args) { - if(args.length < 1) { - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eunignore §8[§7Spieler§8]"); - return; - } + @Override + public void execute(CommandSender sender, String[] args) { + if(args.length < 1) { + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eunignore §8[§7Spieler§8]"); + return; + } - if (!(sender instanceof ProxiedPlayer)) - return; - ProxiedPlayer p = (ProxiedPlayer) sender; - SteamwarUser user = SteamwarUser.get(p.getUniqueId()); + if (!(sender instanceof ProxiedPlayer)) + return; + ProxiedPlayer p = (ProxiedPlayer) sender; + SteamwarUser user = SteamwarUser.get(p.getUniqueId()); - SteamwarUser target = SteamwarUser.get(args[0]); - if(target == null){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht!"); - return; - }else if(!IgnoreSystem.isIgnored(user, target)){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler nicht."); - return; - } + SteamwarUser target = SteamwarUser.get(args[0]); + if(target == null){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht!"); + return; + }else if(!IgnoreSystem.isIgnored(user, target)){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler nicht."); + return; + } - IgnoreSystem.unIgnore(user, target); - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du empfängst nun wieder Nachrichten von §e" + target.getUserName() + "§8."); - } + IgnoreSystem.unIgnore(user, target); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du empfängst nun wieder Nachrichten von §e" + target.getUserName() + "§8."); + } } \ No newline at end of file diff --git a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java index 85d3682..faf5df7 100644 --- a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java +++ b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java @@ -5,27 +5,27 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; import java.sql.SQLException; public class IgnoreSystem{ - private IgnoreSystem(){} + private IgnoreSystem(){} - public static boolean isIgnored(ProxiedPlayer ignorer, ProxiedPlayer ignored){ - SteamwarUser user = SteamwarUser.get(ignorer.getUniqueId()); - SteamwarUser target = SteamwarUser.get(ignored.getUniqueId()); - return isIgnored(user, target); - } + public static boolean isIgnored(ProxiedPlayer ignorer, ProxiedPlayer ignored){ + SteamwarUser user = SteamwarUser.get(ignorer.getUniqueId()); + SteamwarUser target = SteamwarUser.get(ignored.getUniqueId()); + return isIgnored(user, target); + } - public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) { - try { - return !SQL.select("SELECT * FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next(); - } catch (SQLException e) { - throw new SecurityException("Could not check if ignored", e); - } - } + public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) { + try { + return !SQL.select("SELECT * FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next(); + } catch (SQLException e) { + throw new SecurityException("Could not check if ignored", e); + } + } - public static void ignore(SteamwarUser ignorer, SteamwarUser ignored) { - SQL.update("INSERT INTO Ignore (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId()); - } + public static void ignore(SteamwarUser ignorer, SteamwarUser ignored) { + SQL.update("INSERT INTO Ignore (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId()); + } - public static void unIgnore(SteamwarUser ignorer, SteamwarUser ignored) { - SQL.update("DELETE FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()); - } + public static void unIgnore(SteamwarUser ignorer, SteamwarUser ignored) { + SQL.update("DELETE FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()); + } } \ No newline at end of file From 30e4055e96d140a739c0f0037d2a5b5ded741f65 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 25 Aug 2020 19:23:30 +0200 Subject: [PATCH 9/9] Renaming table Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/sql/IgnoreSystem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java index faf5df7..1d99cd5 100644 --- a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java +++ b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java @@ -15,17 +15,17 @@ public class IgnoreSystem{ public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) { try { - return !SQL.select("SELECT * FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next(); + return !SQL.select("SELECT * FROM IgnoredPlayers WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next(); } catch (SQLException e) { throw new SecurityException("Could not check if ignored", e); } } public static void ignore(SteamwarUser ignorer, SteamwarUser ignored) { - SQL.update("INSERT INTO Ignore (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId()); + SQL.update("INSERT INTO IgnoredPlayers (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId()); } public static void unIgnore(SteamwarUser ignorer, SteamwarUser ignored) { - SQL.update("DELETE FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()); + SQL.update("DELETE FROM IgnoredPlayers WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()); } } \ No newline at end of file