SteamWar/BungeeCore
Archiviert
13
2

Ignore-System initial push #93

Manuell gemergt
Lixfel hat 10 Commits von IgnoreSystem nach master 2020-08-29 11:08:44 +02:00 zusammengeführt
Nur Änderungen aus Commit 30e4055e96 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -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());
}
}