Archiviert
1
0

Hotfix IgnoreSystem

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-08-29 11:22:21 +02:00
Ursprung c881849f38
Commit 0b160cd579

Datei anzeigen

@ -2,6 +2,7 @@ package de.steamwar.bungeecore.sql;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.sql.ResultSet;
import java.sql.SQLException;
public class IgnoreSystem{
@ -15,7 +16,11 @@ public class IgnoreSystem{
public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) {
try {
return !SQL.select("SELECT * FROM IgnoredPlayers WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next();
ResultSet rs = SQL.select("SELECT COUNT(*) AS blocked FROM IgnoredPlayers WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId());
if(!rs.next())
return false;
return rs.getInt("blocked") > 0;
} catch (SQLException e) {
throw new SecurityException("Could not check if ignored", e);
}