Browse Source

server side race/cass restrictions

combat-2
FatBoy-DOTC 9 months ago
parent
commit
0e44293231
  1. 31
      src/engine/db/handlers/dbItemBaseHandler.java

31
src/engine/db/handlers/dbItemBaseHandler.java

@ -102,9 +102,34 @@ public void LOAD_ALL_ITEM_REQUIREMENTS(){ @@ -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());
}

Loading…
Cancel
Save