Browse Source

Sql update

combat-2
MagicBot 8 months ago
parent
commit
538e452377
  1. 2
      src/engine/db/handlers/dbWarehouseHandler.java
  2. 3
      src/engine/objects/Warehouse.java

2
src/engine/db/handlers/dbWarehouseHandler.java

@ -96,7 +96,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
for (Enum.ResourceType resource : warehouse.locked) for (Enum.ResourceType resource : warehouse.locked)
locks.add(resource.name()); locks.add(resource.name());
warehouseJSON.put("locks", locks); warehouseJSON.put("locked", locks);
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_warehouse` (`cityUUID`, `warehouse`) VALUES (?, ?) " + PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_warehouse` (`cityUUID`, `warehouse`) VALUES (?, ?) " +

3
src/engine/objects/Warehouse.java

@ -60,7 +60,7 @@ public class Warehouse {
this.resources.put(resourceType, value); this.resources.put(resourceType, value);
} }
JSONArray lockedResources = (JSONArray) warehouse.get("locks"); JSONArray lockedResources = (JSONArray) warehouse.get("locked");
if (lockedResources.isEmpty() == false) if (lockedResources.isEmpty() == false)
for (Object o : lockedResources) for (Object o : lockedResources)
@ -207,7 +207,6 @@ public class Warehouse {
worked = DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse); worked = DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse);
if (worked) { if (worked) {
warehouse.locked.add(resourceType);
ViewResourcesMessage vrm = new ViewResourcesMessage(player); ViewResourcesMessage vrm = new ViewResourcesMessage(player);
vrm.setGuild(player.getGuild()); vrm.setGuild(player.getGuild());
vrm.setWarehouseBuilding(warehouseBuilding); vrm.setWarehouseBuilding(warehouseBuilding);

Loading…
Cancel
Save