forked from MagicBane/Server
Building handler added
This commit is contained in:
@@ -88,6 +88,23 @@ public class dbBuildingHandler extends dbHandlerBase {
|
||||
return removeFromBuildings(b);
|
||||
}
|
||||
|
||||
public ArrayList<Building> GET_ALL_BUILDINGS() {
|
||||
|
||||
ArrayList<Building> buildings = new ArrayList<>();
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_building`.*, `object`.`parent` FROM `object` INNER JOIN `obj_building` ON `obj_building`.`UID` = `object`.`UID` ORDER BY `object`.`UID` ASC;")) {
|
||||
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
buildings = getObjectsFromRs(rs, 1000);
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
return buildings;
|
||||
}
|
||||
|
||||
public ArrayList<Building> GET_ALL_BUILDINGS_FOR_ZONE(Zone zone) {
|
||||
|
||||
ArrayList<Building> buildings = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user