rs = ps.executeQuery();
conn.commit();
int size = 0;
while (rs.next()) {
BBPlayerInfo player = BBUsersTable.getInstance().getUserByID(rs.getInt("player"));
int mods = rs.getInt("modifications");
modifications.put(player, mods);
size++;
}
if (size > 0) {
StringBuilder playerList = new StringBuilder();
for (Entry<BBPlayerInfo, Integer> entry : modifications.entrySet()) {
if(entry.getKey()!=null) {
playerList.append(entry.getKey().getName());
playerList.append(" (");
playerList.append(entry.getValue());
playerList.append("), ");
}
}
if(playerList.indexOf(",")!=-1) {
playerList.delete(playerList.lastIndexOf(","), playerList.length());
}
//TODO Put into sync'd runnable
for (Player player : players) {
player.sendMessage(BigBrother.premessage + playerList.length() + " player(s) have modified this area:");
player.sendMessage(playerList.toString());
}
} else {
for (Player player : players) {
player.sendMessage(BigBrother.premessage + "No modifications in this area.");
}
}
} catch (SQLException ex) {
BBLogging.severe("Find SQL Exception", ex);