forked from LogBlock/LogBlock
Only load the player names, that are actually needed
This commit is contained in:
@@ -320,14 +320,9 @@ public class Consumer extends TimerTask
|
||||
private boolean addPlayer(Connection conn, Statement state, String playerName) throws SQLException {
|
||||
state.execute("INSERT IGNORE INTO `lb-players` (playername) VALUES ('" + playerName + "')");
|
||||
conn.commit();
|
||||
final ResultSet rs = state.executeQuery("SELECT playername FROM `lb-players`");
|
||||
while (rs.next()) {
|
||||
final String name = rs.getString(1);
|
||||
if (name.equalsIgnoreCase(playerName))
|
||||
players.add(playerName.hashCode());
|
||||
else
|
||||
players.add(name.hashCode());
|
||||
}
|
||||
final ResultSet rs = state.executeQuery("SELECT playerid FROM `lb-players` WHERE playername = '" + playerName + "'");
|
||||
if (rs.next())
|
||||
players.add(playerName.hashCode());
|
||||
rs.close();
|
||||
return players.contains(playerName.hashCode());
|
||||
}
|
||||
|
Reference in New Issue
Block a user