Fixing whitelist bug and alertsState bug

- Whitelisted players would not actually return as whitelisted from the database because of use the getFetchSize parameter, which was not used as it was intended.
- The same reasoning as above is why the alertsState would not function.
This commit is contained in:
funkemunky
2021-09-09 15:25:42 -04:00
parent b573fca58b
commit 795f0333c7
4 changed files with 26 additions and 10 deletions
@@ -98,7 +98,7 @@ public class MySqlVPN implements VPNDatabase {
ResultSet set = Query.prepare("select uuid from `whitelisted` where `uuid` = ? limit 1").append(uuid.toString())
.executeQuery();
return set != null && set.getFetchSize() > 0 && set.next() && set.getString("uuid") != null;
return set != null && set.next() && set.getString("uuid") != null;
}
@Override
@@ -153,11 +153,11 @@ public class MySqlVPN implements VPNDatabase {
if(MySQL.isClosed()) return;
VPNExecutor.threadExecutor.execute(() -> {
ResultSet set = Query.prepare("select * from `alerts` where `uuid` = ?")
ResultSet set = Query.prepare("select * from `alerts` where `uuid` = ? limit 1")
.append(uuid.toString()).executeQuery();
try {
result.accept(set.next());
result.accept(set != null && set.next() && set.getString("uuid") != null);
} catch (SQLException e) {
e.printStackTrace();
result.accept(false);