Writing string of bitset for contracts.

This commit is contained in:
2024-04-05 09:18:12 -04:00
parent 52865d7cfd
commit f7c76937fb
6 changed files with 22 additions and 24 deletions
@@ -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();
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());
return (preparedStatement.executeUpdate() > 0);
@@ -126,7 +126,7 @@ public class dbContractHandler extends dbHandlerBase {
try (Connection connection = DbManager.getConnection();
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.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(6, con.getIconID());
preparedStatement.setInt(8, con.getObjectUUID());
preparedStatement.setLong(7, mbEnums.toLong(con.getAllowedBuildings()));
preparedStatement.setString(7, mbEnums.asString(con.allowedBuildings));
return (preparedStatement.executeUpdate() > 0);