character creation population message

This commit is contained in:
2024-06-25 21:00:36 -05:00
parent e9fef85b72
commit bb8ad3c971
2 changed files with 26 additions and 5 deletions
+18
View File
@@ -95,7 +95,25 @@ public class dbCityHandler extends dbHandlerBase {
return objectList;
}
public Integer GET_CITY_COUNT() {
int cityCount = 0;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM obj_city;")) {
ResultSet rs = preparedStatement.executeQuery();
while(rs.next()){
if(rs.getInt("isNpc") == 0)
cityCount++;
}
} catch (SQLException e) {
Logger.error(e);
}
return cityCount;
}
public ArrayList<City> GET_CITIES_BY_ZONE(final int objectUUID) {
ArrayList<City> cityList = new ArrayList<>();