forked from MagicBane/Server
universal mines round 2
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user