Browse Source

Method to validate workorder

combat-2
MagicBot 9 months ago
parent
commit
053c105c26
  1. 6
      src/engine/gameManager/ForgeManager.java
  2. 6
      src/engine/net/client/handlers/ItemProductionMsgHandler.java

6
src/engine/gameManager/ForgeManager.java

@ -9,6 +9,7 @@
package engine.gameManager; package engine.gameManager;
import engine.loot.WorkOrder; import engine.loot.WorkOrder;
import engine.objects.PlayerCharacter;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.concurrent.DelayQueue; import java.util.concurrent.DelayQueue;
@ -69,4 +70,9 @@ public enum ForgeManager implements Runnable {
workOrders.add(workOrder); workOrders.add(workOrder);
} }
public static boolean validate(PlayerCharacter playerCharacter, WorkOrder workOrder) {
return true;
}
} }

6
src/engine/net/client/handlers/ItemProductionMsgHandler.java

@ -13,6 +13,7 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.ForgeManager;
import engine.loot.WorkOrder; import engine.loot.WorkOrder;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
@ -86,6 +87,11 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
workOrder.suffixToken = msg.sToken; workOrder.suffixToken = msg.sToken;
workOrder.itemName = msg.name; workOrder.itemName = msg.name;
// Validate vendor can roll this item
if (ForgeManager.validate(player, workOrder) == false)
return true;
//Create Multiple Item Function.. Fill all empty slots //Create Multiple Item Function.. Fill all empty slots
if (msg.size > 0) { if (msg.size > 0) {

Loading…
Cancel
Save