From 7e29ecde9be5d0a30dfffab5424983724286bb65 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 7 Feb 2024 19:33:37 -0600 Subject: [PATCH] server side race/cass restrictions --- src/engine/db/handlers/dbItemBaseHandler.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/engine/db/handlers/dbItemBaseHandler.java b/src/engine/db/handlers/dbItemBaseHandler.java index b2969c61..c935672a 100644 --- a/src/engine/db/handlers/dbItemBaseHandler.java +++ b/src/engine/db/handlers/dbItemBaseHandler.java @@ -97,17 +97,19 @@ public class dbItemBaseHandler extends dbHandlerBase { Logger.info("read: " + recordsRead + " cached: " + ItemBase.getUUIDCache().size()); } public void LOAD_ALL_ITEM_REQUIREMENTS(){ - for(ItemBase itemBase : ItemBase._itemBaseByUUID.values()) - try (Connection connection = DbManager.getConnection(); - PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_item_requirements WHERE 'itemID' = ?")) { - preparedStatement.setInt(1, itemBase.getUUID()); - ResultSet rs = preparedStatement.executeQuery(); - while(rs.next()) { - itemBase.LoadRequirements(rs.getString("racesRequired"),rs.getString("racesRestricted"),rs.getString("classesRequired"),rs.getString("classesRestricted"),rs.getString("discsRequired"),rs.getString("discsRestricted")); + for(ItemBase itemBase : ItemBase._itemBaseByUUID.values()){ + try (Connection connection = DbManager.getConnection(); + PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_item_requirements WHERE 'itemID' = ?")) { + preparedStatement.setInt(1, itemBase.getUUID()); + ResultSet rs = preparedStatement.executeQuery(); + while(rs.next()) { + itemBase.LoadRequirements(rs.getString("racesRequired"), rs.getString("racesRestricted"), rs.getString("classesRequired"), rs.getString("classesRestricted"), rs.getString("discsRequired"), rs.getString("discsRestricted")); + } + } catch (SQLException e) { + Logger.error("No Entry In static_item_requirements for item UUID: " + itemBase.getUUID()); + } } - } catch (SQLException e) { - Logger.error("No Entry In static_item_requirements for item UUID: " + itemBase.getUUID()); - } + } public HashMap> LOAD_RUNES_FOR_NPC_AND_MOBS() {