|
|
@ -71,7 +71,7 @@ public enum ForgeManager implements Runnable { |
|
|
|
workOrder.runCompleted = true; |
|
|
|
workOrder.runCompleted = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (workOrder.runCompleted == true) |
|
|
|
if (workOrder.runCompleted) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
// Persist virtual items that were currently cooking
|
|
|
|
// Persist virtual items that were currently cooking
|
|
|
@ -95,7 +95,6 @@ public enum ForgeManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
Thread forgeManager; |
|
|
|
Thread forgeManager; |
|
|
|
forgeManager = new Thread(FORGE_MANAGER); |
|
|
|
forgeManager = new Thread(FORGE_MANAGER); |
|
|
|
|
|
|
|
|
|
|
|
forgeManager.setName("Forge Manager"); |
|
|
|
forgeManager.setName("Forge Manager"); |
|
|
|
forgeManager.start(); |
|
|
|
forgeManager.start(); |
|
|
|
} |
|
|
|
} |
|
|
@ -189,7 +188,7 @@ public enum ForgeManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
// Single item rolls are msg_size of 0;
|
|
|
|
// Single item rolls are msg_size of 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (availableSlots > 0 && workOrder.multiple_slot_request == false) |
|
|
|
if (availableSlots > 0 && !workOrder.multiple_slot_request) |
|
|
|
availableSlots = 1; |
|
|
|
availableSlots = 1; |
|
|
|
|
|
|
|
|
|
|
|
return availableSlots; |
|
|
|
return availableSlots; |
|
|
@ -321,7 +320,8 @@ public enum ForgeManager implements Runnable { |
|
|
|
completed_item = DbManager.ItemQueries.PERSIST(workOrderItem); |
|
|
|
completed_item = DbManager.ItemQueries.PERSIST(workOrderItem); |
|
|
|
workOrder.vendor.charItemManager.addItemToInventory(completed_item); |
|
|
|
workOrder.vendor.charItemManager.addItemToInventory(completed_item); |
|
|
|
} |
|
|
|
} |
|
|
|
// Remove the fake negativeID virtual item from all collections.
|
|
|
|
|
|
|
|
|
|
|
|
// Remove the negativeID virtual item from all collections.
|
|
|
|
|
|
|
|
|
|
|
|
for (Item memoryItem : toRemove) { |
|
|
|
for (Item memoryItem : toRemove) { |
|
|
|
workOrder.cooking.remove(memoryItem); |
|
|
|
workOrder.cooking.remove(memoryItem); |
|
|
@ -329,8 +329,8 @@ public enum ForgeManager implements Runnable { |
|
|
|
vendorItemLookup.get(workOrder.vendor).remove(memoryItem); |
|
|
|
vendorItemLookup.get(workOrder.vendor).remove(memoryItem); |
|
|
|
itemWorkOrderLookup.remove(memoryItem); |
|
|
|
itemWorkOrderLookup.remove(memoryItem); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void forgeItems(WorkOrder workOrder) { |
|
|
|
public static void forgeItems(WorkOrder workOrder) { |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < workOrder.slots_used; ++i) { |
|
|
|
for (int i = 0; i < workOrder.slots_used; ++i) { |
|
|
@ -340,7 +340,6 @@ public enum ForgeManager implements Runnable { |
|
|
|
// Add virtual item to in-memory caches
|
|
|
|
// Add virtual item to in-memory caches
|
|
|
|
|
|
|
|
|
|
|
|
workOrder.cooking.add(forged_item); |
|
|
|
workOrder.cooking.add(forged_item); |
|
|
|
|
|
|
|
|
|
|
|
inMemoryItemLookup.put(forged_item.objectUUID, forged_item); |
|
|
|
inMemoryItemLookup.put(forged_item.objectUUID, forged_item); |
|
|
|
vendorItemLookup.computeIfAbsent(workOrder.vendor, k -> new ArrayList<>()); |
|
|
|
vendorItemLookup.computeIfAbsent(workOrder.vendor, k -> new ArrayList<>()); |
|
|
|
vendorItemLookup.get(workOrder.vendor).add(forged_item); |
|
|
|
vendorItemLookup.get(workOrder.vendor).add(forged_item); |
|
|
|