From 538e452377677361e5f4468ee38ae45a66f35a5b Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 17 Mar 2024 12:09:37 -0400 Subject: [PATCH] Sql update --- src/engine/db/handlers/dbWarehouseHandler.java | 2 +- src/engine/objects/Warehouse.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/engine/db/handlers/dbWarehouseHandler.java b/src/engine/db/handlers/dbWarehouseHandler.java index 4a31fd93..99cac7e3 100644 --- a/src/engine/db/handlers/dbWarehouseHandler.java +++ b/src/engine/db/handlers/dbWarehouseHandler.java @@ -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 (?, ?) " + diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index 01b3af5c..adcd6b9d 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -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 { worked = DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse); if (worked) { - warehouse.locked.add(resourceType); ViewResourcesMessage vrm = new ViewResourcesMessage(player); vrm.setGuild(player.getGuild()); vrm.setWarehouseBuilding(warehouseBuilding);