Browse Source

Removed old handlers

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
89cb808481
  1. 19
      src/engine/db/handlers/dbBuildingHandler.java
  2. 19
      src/engine/db/handlers/dbCityHandler.java
  3. 20
      src/engine/db/handlers/dbMobHandler.java
  4. 20
      src/engine/db/handlers/dbNPCHandler.java

19
src/engine/db/handlers/dbBuildingHandler.java

@ -105,25 +105,6 @@ public class dbBuildingHandler extends dbHandlerBase { @@ -105,25 +105,6 @@ public class dbBuildingHandler extends dbHandlerBase {
return buildings;
}
public ArrayList<Building> GET_ALL_BUILDINGS_FOR_ZONE(Zone zone) {
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` 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)

19
src/engine/db/handlers/dbCityHandler.java

@ -113,25 +113,6 @@ public class dbCityHandler extends dbHandlerBase { @@ -113,25 +113,6 @@ public class dbCityHandler extends dbHandlerBase {
return cityList;
}
public ArrayList<City> GET_CITIES_BY_ZONE(final int objectUUID) {
ArrayList<City> 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);

20
src/engine/db/handlers/dbMobHandler.java

@ -11,7 +11,6 @@ package engine.db.handlers; @@ -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 { @@ -191,25 +190,6 @@ public class dbMobHandler extends dbHandlerBase {
}
}
public ArrayList<Mob> GET_ALL_MOBS_FOR_ZONE(Zone zone) {
ArrayList<Mob> 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;

20
src/engine/db/handlers/dbNPCHandler.java

@ -15,7 +15,6 @@ import engine.math.Vector3fImmutable; @@ -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 { @@ -111,25 +110,6 @@ public class dbNPCHandler extends dbHandlerBase {
return npcList;
}
public ArrayList<NPC> GET_ALL_NPCS_FOR_ZONE(Zone zone) {
ArrayList<NPC> 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;

Loading…
Cancel
Save