universal mines round 2

This commit is contained in:
2024-04-21 15:46:29 -05:00
parent c8310ec5ba
commit 0dca6c4662
3 changed files with 20 additions and 26 deletions
+17 -1
View File
@@ -33,8 +33,24 @@ public class dbMineHandler extends dbHandlerBase {
if (id == 0)
return null;
Mine mine = (Mine) DbManager.getFromCache(Enum.GameObjectType.Mine, id);
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM obj_mine;")) {
//preparedStatement.setInt(1, id);
ResultSet rs = preparedStatement.executeQuery();
while(rs.next()){
if(rs.getInt("UID") == id){
int towerUID = rs.getInt("mine_buildingUID");
mine = Mine.getMineFromTower(towerUID);
}
}
} catch (SQLException e) {
Logger.error(e);
}
if (mine != null)
return mine;