geforkt von SteamWar/BungeeCore
Hotfix IgnoreSystem
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
c881849f38
Commit
0b160cd579
@ -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);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren