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

3
src/engine/objects/Warehouse.java

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

Loading…
Cancel
Save