forked from LogBlock/LogBlock
Fixed "Failed to add player" issue when the player name has different
case letters than the one in the database
This commit is contained in:
@@ -321,8 +321,13 @@ public class Consumer extends TimerTask
|
|||||||
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 playername FROM `lb-players`");
|
||||||
while (rs.next())
|
while (rs.next()) {
|
||||||
players.add(rs.getString(1).hashCode());
|
final String name = rs.getString(1);
|
||||||
|
if (name.equalsIgnoreCase(playerName))
|
||||||
|
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