Only load the player names, that are actually needed
This commit is contained in:
1 parent
2f54baee0c
commit
5f5668384e
1 file changed
+3
-8
@@ -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