Browse Source

Resubmit unfinished workorders

combat-2
MagicBot 8 months ago
parent
commit
50a169149f
  1. 5
      src/engine/db/handlers/dbWarehouseHandler.java
  2. 2
      src/engine/gameManager/ForgeManager.java

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

@ -213,6 +213,11 @@ public class dbWarehouseHandler extends dbHandlerBase {
workOrder.workOrderID = ForgeManager.wordOrderCounter.incrementAndGet(); workOrder.workOrderID = ForgeManager.wordOrderCounter.incrementAndGet();
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder); ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder);
// If workorder is not yet complete process it
if (workOrder.runCompleted == false)
ForgeManager.forge.add(workOrder);
} }
} }
} }

2
src/engine/gameManager/ForgeManager.java

@ -27,7 +27,7 @@ public enum ForgeManager implements Runnable {
FORGE_MANAGER; FORGE_MANAGER;
private static final BlockingQueue<WorkOrder> forge = new DelayQueue<>(); public static final BlockingQueue<WorkOrder> forge = new DelayQueue<>();
public static final AtomicInteger wordOrderCounter = new AtomicInteger(0); public static final AtomicInteger wordOrderCounter = new AtomicInteger(0);
public static final ConcurrentHashMap<NPC, ConcurrentHashMap.KeySetView<WorkOrder, Boolean>> vendorWorkOrderLookup = new ConcurrentHashMap<>(); public static final ConcurrentHashMap<NPC, ConcurrentHashMap.KeySetView<WorkOrder, Boolean>> vendorWorkOrderLookup = new ConcurrentHashMap<>();
public static final ConcurrentHashMap<Item, WorkOrder> itemWorkOrderLookup = new ConcurrentHashMap<>(); public static final ConcurrentHashMap<Item, WorkOrder> itemWorkOrderLookup = new ConcurrentHashMap<>();

Loading…
Cancel
Save