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 net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
public class IgnoreSystem{
|
public class IgnoreSystem{
|
||||||
@ -15,7 +16,11 @@ public class IgnoreSystem{
|
|||||||
|
|
||||||
public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) {
|
public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) {
|
||||||
try {
|
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) {
|
} catch (SQLException e) {
|
||||||
throw new SecurityException("Could not check if ignored", e);
|
throw new SecurityException("Could not check if ignored", e);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren