From 89cb8084816525e705f1732a303b88daf6077410 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 18 Oct 2023 10:23:35 -0400 Subject: [PATCH] Removed old handlers --- src/engine/db/handlers/dbBuildingHandler.java | 19 ------------------ src/engine/db/handlers/dbCityHandler.java | 19 ------------------ src/engine/db/handlers/dbMobHandler.java | 20 ------------------- src/engine/db/handlers/dbNPCHandler.java | 20 ------------------- 4 files changed, 78 deletions(-) diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index 51bdda4c..0c88a5d6 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -105,25 +105,6 @@ public class dbBuildingHandler extends dbHandlerBase { return buildings; } - public ArrayList GET_ALL_BUILDINGS_FOR_ZONE(Zone zone) { - - ArrayList 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` WHERE `object`.`parent` = ?;")) { - - preparedStatement.setLong(1, zone.getObjectUUID()); - - ResultSet rs = preparedStatement.executeQuery(); - buildings = getObjectsFromRs(rs, 1000); - - } catch (SQLException e) { - Logger.error(e); - } - - return buildings; - } - public Building GET_BUILDINGBYUUID(int uuid) { if (uuid == 0) diff --git a/src/engine/db/handlers/dbCityHandler.java b/src/engine/db/handlers/dbCityHandler.java index bf3cd67b..a31b738e 100644 --- a/src/engine/db/handlers/dbCityHandler.java +++ b/src/engine/db/handlers/dbCityHandler.java @@ -113,25 +113,6 @@ public class dbCityHandler extends dbHandlerBase { return cityList; } - public ArrayList GET_CITIES_BY_ZONE(final int objectUUID) { - - ArrayList cityList = new ArrayList<>(); - - try (Connection connection = DbManager.getConnection(); - PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_city`.*, `object`.`parent` FROM `obj_city` INNER JOIN `object` ON `object`.`UID` = `obj_city`.`UID` WHERE `object`.`parent`=?;")) { - - preparedStatement.setLong(1, objectUUID); - - ResultSet rs = preparedStatement.executeQuery(); - cityList = getObjectsFromRs(rs, 100); - - } catch (SQLException e) { - Logger.error(e); - } - - return cityList; - } - public City GET_CITY(final int cityId) { City city = (City) DbManager.getFromCache(Enum.GameObjectType.City, cityId); diff --git a/src/engine/db/handlers/dbMobHandler.java b/src/engine/db/handlers/dbMobHandler.java index 4934b6ee..ad9e0a70 100644 --- a/src/engine/db/handlers/dbMobHandler.java +++ b/src/engine/db/handlers/dbMobHandler.java @@ -11,7 +11,6 @@ package engine.db.handlers; import engine.gameManager.DbManager; import engine.objects.Mob; -import engine.objects.Zone; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; @@ -191,25 +190,6 @@ public class dbMobHandler extends dbHandlerBase { } } - public ArrayList GET_ALL_MOBS_FOR_ZONE(Zone zone) { - - ArrayList mobileList = new ArrayList<>(); - - try (Connection connection = DbManager.getConnection(); - PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_mob`.*, `object`.`parent` FROM `object` INNER JOIN `obj_mob` ON `obj_mob`.`UID` = `object`.`UID` WHERE `object`.`parent` = ?;")) { - - preparedStatement.setLong(1, zone.getObjectUUID()); - - ResultSet rs = preparedStatement.executeQuery(); - mobileList = getObjectsFromRs(rs, 1000); - - } catch (SQLException e) { - Logger.error(e); - } - - return mobileList; - } - public Mob GET_MOB(final int objectUUID) { Mob mobile = null; diff --git a/src/engine/db/handlers/dbNPCHandler.java b/src/engine/db/handlers/dbNPCHandler.java index f11576ec..9887c6ed 100644 --- a/src/engine/db/handlers/dbNPCHandler.java +++ b/src/engine/db/handlers/dbNPCHandler.java @@ -15,7 +15,6 @@ import engine.math.Vector3fImmutable; import engine.objects.NPC; import engine.objects.NPCProfits; import engine.objects.ProducedItem; -import engine.objects.Zone; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; @@ -111,25 +110,6 @@ public class dbNPCHandler extends dbHandlerBase { return npcList; } - public ArrayList GET_ALL_NPCS_FOR_ZONE(Zone zone) { - - ArrayList npcList = new ArrayList<>(); - - try (Connection connection = DbManager.getConnection(); - PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_npc`.*, `object`.`parent` FROM `object` INNER JOIN `obj_npc` ON `obj_npc`.`UID` = `object`.`UID` WHERE `object`.`parent` = ?;")) { - - preparedStatement.setLong(1, zone.getObjectUUID()); - - ResultSet rs = preparedStatement.executeQuery(); - npcList = getObjectsFromRs(rs, 1000); - - } catch (SQLException e) { - Logger.error(e); - } - - return npcList; - } - public NPC GET_NPC(final int objectUUID) { NPC npc = null;