|
|
@ -106,12 +106,12 @@ public class dbContractHandler extends dbHandlerBase { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean updateAllowedBuildings(final Contract con, final long slotbitvalue) { |
|
|
|
public boolean updateAllowedBuildings(final Contract con) { |
|
|
|
|
|
|
|
|
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `static_npc_contract` SET `allowedBuildingTypeID`=? WHERE `contractID`=?")) { |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `static_npc_contract` SET `slotInBuildings`=? WHERE `contractID`=?")) { |
|
|
|
|
|
|
|
|
|
|
|
preparedStatement.setLong(1, slotbitvalue); |
|
|
|
preparedStatement.setString(1, mbEnums.asString(con.allowedBuildings)); |
|
|
|
preparedStatement.setInt(2, con.getContractID()); |
|
|
|
preparedStatement.setInt(2, con.getContractID()); |
|
|
|
|
|
|
|
|
|
|
|
return (preparedStatement.executeUpdate() > 0); |
|
|
|
return (preparedStatement.executeUpdate() > 0); |
|
|
@ -126,7 +126,7 @@ public class dbContractHandler extends dbHandlerBase { |
|
|
|
|
|
|
|
|
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `static_npc_contract` SET `contractID`=?, `name`=?, " |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `static_npc_contract` SET `contractID`=?, `name`=?, " |
|
|
|
+ "`mobbaseID`=?, `classID`=?, vendorDialog=?, iconID=?, allowedBuildingTypeID=? WHERE `ID`=?")) { |
|
|
|
+ "`mobbaseID`=?, `classID`=?, vendorDialog=?, iconID=?, slotInBuildings=? WHERE `ID`=?")) { |
|
|
|
|
|
|
|
|
|
|
|
preparedStatement.setInt(1, con.getContractID()); |
|
|
|
preparedStatement.setInt(1, con.getContractID()); |
|
|
|
preparedStatement.setString(2, con.getName()); |
|
|
|
preparedStatement.setString(2, con.getName()); |
|
|
@ -135,7 +135,7 @@ public class dbContractHandler extends dbHandlerBase { |
|
|
|
preparedStatement.setInt(5, (con.getVendorDialog() != null) ? con.getVendorDialog().getObjectUUID() : 0); |
|
|
|
preparedStatement.setInt(5, (con.getVendorDialog() != null) ? con.getVendorDialog().getObjectUUID() : 0); |
|
|
|
preparedStatement.setInt(6, con.getIconID()); |
|
|
|
preparedStatement.setInt(6, con.getIconID()); |
|
|
|
preparedStatement.setInt(8, con.getObjectUUID()); |
|
|
|
preparedStatement.setInt(8, con.getObjectUUID()); |
|
|
|
preparedStatement.setLong(7, mbEnums.toLong(con.getAllowedBuildings())); |
|
|
|
preparedStatement.setString(7, mbEnums.asString(con.allowedBuildings)); |
|
|
|
|
|
|
|
|
|
|
|
return (preparedStatement.executeUpdate() > 0); |
|
|
|
return (preparedStatement.executeUpdate() > 0); |
|
|
|
|
|
|
|
|
|
|
|