From 0e44293231d13a1c485e5cd9382219a79468494d Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 7 Feb 2024 19:43:04 -0600 Subject: [PATCH] server side race/cass restrictions --- src/engine/db/handlers/dbItemBaseHandler.java | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/engine/db/handlers/dbItemBaseHandler.java b/src/engine/db/handlers/dbItemBaseHandler.java index 24ef36a0..bd247835 100644 --- a/src/engine/db/handlers/dbItemBaseHandler.java +++ b/src/engine/db/handlers/dbItemBaseHandler.java @@ -102,9 +102,34 @@ public void LOAD_ALL_ITEM_REQUIREMENTS(){ 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")); - //} + while(rs.next()) { + + String racesRequired = ""; + if(rs.getString("racesRequired") != null) + racesRequired = rs.getString("racesRequired"); + + String racesRestricted = ""; + if(rs.getString("racesRestricted") != null) + racesRestricted = rs.getString("racesRestricted"); + + String classesRequired = ""; + if(rs.getString("classesRequired") != null) + classesRequired = rs.getString("classesRequired"); + + String classesRestricted = ""; + if(rs.getString("classesRestricted") != null) + classesRestricted = rs.getString("classesRestricted"); + + String discsRequired = ""; + if(rs.getString("discsRequired") != null) + discsRequired = rs.getString("discsRequired"); + + String discsRestricted = ""; + if(rs.getString("discsRestricted") != null) + discsRestricted = rs.getString("discsRestricted"); + + itemBase.LoadRequirements(racesRequired,racesRestricted,classesRequired, classesRestricted, discsRequired, discsRestricted); + } } catch (SQLException e) { Logger.error("No Entry In static_item_requirements for item UUID: " + itemBase.getUUID()); }