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 {
|
private boolean addPlayer(Connection conn, Statement state, String playerName) throws SQLException {
|
||||||
state.execute("INSERT IGNORE INTO `lb-players` (playername) VALUES ('" + playerName + "')");
|
state.execute("INSERT IGNORE INTO `lb-players` (playername) VALUES ('" + playerName + "')");
|
||||||
conn.commit();
|
conn.commit();
|
||||||
final ResultSet rs = state.executeQuery("SELECT playername FROM `lb-players`");
|
final ResultSet rs = state.executeQuery("SELECT playerid FROM `lb-players` WHERE playername = '" + playerName + "'");
|
||||||
while (rs.next()) {
|
if (rs.next())
|
||||||
final String name = rs.getString(1);
|
|
||||||
if (name.equalsIgnoreCase(playerName))
|
|
||||||
players.add(playerName.hashCode());
|
players.add(playerName.hashCode());
|
||||||
else
|
|
||||||
players.add(name.hashCode());
|
|
||||||
}
|
|
||||||
rs.close();
|
rs.close();
|
||||||
return players.contains(playerName.hashCode());
|
return players.contains(playerName.hashCode());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user