Browse Source

field is templateID not item uuid.

combat-2
MagicBot 7 months ago
parent
commit
679c7afe0e
  1. 12
      src/engine/net/client/handlers/ItemProductionMsgHandler.java
  2. 48
      src/engine/net/client/msg/ItemProductionMsg.java

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

@ -463,14 +463,14 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { @@ -463,14 +463,14 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
int emptySlots = vendorNPC.getRank() - vendorNPC.getRolling().size();
if (emptySlots > 0) {
for (int i = 0; i < emptySlots; i++) {
vendorNPC.produceItem(player.getObjectUUID(), msg.getTotalProduction(), isRandom, msg.getpToken(), msg.getsToken(), msg.getName(), msg.getItemUUID());
vendorNPC.produceItem(player.getObjectUUID(), msg.getTotalProduction(), isRandom, msg.getpToken(), msg.getsToken(), msg.getName(), msg.getTemplateID());
}
}
} else
vendorNPC.produceItem(player.getObjectUUID(), msg.getTotalProduction(), isRandom, msg.getpToken(), msg.getsToken(), msg.getName(), msg.getItemUUID());
vendorNPC.produceItem(player.getObjectUUID(), msg.getTotalProduction(), isRandom, msg.getpToken(), msg.getsToken(), msg.getName(), msg.getTemplateID());
break;
case ACTION_JUNK:
junkItem(msg.getItemUUID(), vendorNPC, origin);
junkItem(msg.getTemplateID(), vendorNPC, origin);
break;
case ACTION_RECYCLE:
recycleItem(msg.getItemIDtoTypeMap(), vendorNPC, origin);
@ -480,7 +480,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { @@ -480,7 +480,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
break;
case ACTION_COMPLETE:
vendorNPC.completeItem(msg.getItemUUID());
vendorNPC.completeItem(msg.getTemplateID());
// ManageNPCMsg outMsg = new ManageNPCMsg(vendorNPC);
// outMsg.setMessageType(1);
@ -491,10 +491,10 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { @@ -491,10 +491,10 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
break;
case ACTION_DEPOSIT:
depositItem(msg.getItemUUID(), vendorNPC, origin);
depositItem(msg.getTemplateID(), vendorNPC, origin);
break;
case ACTION_SETPRICE:
setItemPrice(msg.getItemType(), msg.getItemUUID(), msg.getItemPrice(), vendorNPC, origin);
setItemPrice(msg.getItemType(), msg.getTemplateID(), msg.getItemPrice(), vendorNPC, origin);
break;
case ACTION_TAKE:
takeItem(msg.getItemIDtoTypeMap(), vendorNPC, origin);

48
src/engine/net/client/msg/ItemProductionMsg.java

@ -38,7 +38,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -38,7 +38,7 @@ public class ItemProductionMsg extends ClientNetMsg {
private int size;
private int buildingUUID;
private int unknown01;
private int itemUUID;
private int templateID;
private int itemType;
private int totalProduction;
private int unknown03;
@ -61,7 +61,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -61,7 +61,7 @@ public class ItemProductionMsg extends ClientNetMsg {
this.size = 0;
this.buildingUUID = 0;
this.unknown01 = 0;
this.itemUUID = 0;
this.templateID = 0;
this.totalProduction = 0;
this.unknown03 = 0;
this.pToken = 0;
@ -81,7 +81,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -81,7 +81,7 @@ public class ItemProductionMsg extends ClientNetMsg {
this.buildingUUID = building.getObjectUUID();
this.npcUUID = vendor.getObjectUUID();
this.itemType = item.getObjectType().ordinal();
this.itemUUID = item.getObjectUUID();
this.templateID = item.getObjectUUID();
this.unknown01 = 0;
this.totalProduction = 0;
this.unknown03 = 0;
@ -139,7 +139,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -139,7 +139,7 @@ public class ItemProductionMsg extends ClientNetMsg {
if (!add) {
writer.put((byte) 1);
Item item = Item.getFromCache(this.itemUUID);
Item item = Item.getFromCache(this.templateID);
if (item != null)
Item.serializeForClientMsgWithoutSlot(item, writer);
writer.putInt(building.getStrongboxValue());
@ -154,9 +154,9 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -154,9 +154,9 @@ public class ItemProductionMsg extends ClientNetMsg {
writer.put((byte) 1);
Item item;
if (this.itemType == GameObjectType.Item.ordinal())
item = Item.getFromCache(this.itemUUID);
item = Item.getFromCache(this.templateID);
else
item = MobLoot.getFromCache(this.itemUUID);
item = MobLoot.getFromCache(this.templateID);
if (item != null)
Item.serializeForClientMsgWithoutSlot(item, writer);
writer.putInt(building.getStrongboxValue());
@ -166,7 +166,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -166,7 +166,7 @@ public class ItemProductionMsg extends ClientNetMsg {
break;
case ACTION_CONFIRM_TAKE:
writer.putInt(this.itemType);
writer.putInt(this.itemUUID);
writer.putInt(this.templateID);
writer.putInt(1);
writer.putInt(0);
writer.putInt(0);
@ -178,7 +178,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -178,7 +178,7 @@ public class ItemProductionMsg extends ClientNetMsg {
break;
case ACTION_SETPRICE:
writer.putInt(this.itemType);
writer.putInt(this.itemUUID);
writer.putInt(this.templateID);
writer.putInt(1);
writer.putInt(0);
writer.putInt(0);
@ -191,7 +191,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -191,7 +191,7 @@ public class ItemProductionMsg extends ClientNetMsg {
break;
case ACTION_CONFIRM_SETPRICE:
writer.putInt(this.itemType);
writer.putInt(this.itemUUID);
writer.putInt(this.templateID);
writer.putInt(1);
writer.putInt(0);
writer.putInt(0);
@ -205,7 +205,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -205,7 +205,7 @@ public class ItemProductionMsg extends ClientNetMsg {
break;
case ACTION_DEPOSIT:
writer.putInt(this.itemType);
writer.putInt(this.itemUUID);
writer.putInt(this.templateID);
writer.putInt(1);
writer.putInt(0);
writer.putInt(0);
@ -246,7 +246,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -246,7 +246,7 @@ public class ItemProductionMsg extends ClientNetMsg {
writer.putInt(0);
writer.putInt(0);
writer.putInt(1);
MobLoot toRoll = MobLoot.getFromCache(this.itemUUID);
MobLoot toRoll = MobLoot.getFromCache(this.templateID);
writer.putInt(-1497023830);
if (toRoll != null && toRoll.getPrefix() != null && !toRoll.getPrefix().isEmpty()) {
EffectsBase eb = PowersManager.getEffectByIDString(toRoll.getPrefix());
@ -273,7 +273,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -273,7 +273,7 @@ public class ItemProductionMsg extends ClientNetMsg {
writer.putString(toRoll.name);
writer.putInt(GameObjectType.MobLoot.ordinal());
writer.putInt(this.itemUUID);
writer.putInt(this.templateID);
writer.putInt(0); //items left to produce?
if (toRoll != null) {
@ -322,7 +322,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -322,7 +322,7 @@ public class ItemProductionMsg extends ClientNetMsg {
break;
case ACTION_COMPLETE:
writer.putInt(this.itemType);
writer.putInt(this.itemUUID);
writer.putInt(this.templateID);
writer.putInt(this.totalProduction);
writer.putInt(this.unknown03);
writer.putInt(this.pToken);
@ -334,7 +334,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -334,7 +334,7 @@ public class ItemProductionMsg extends ClientNetMsg {
break;
case ACTION_JUNK:
writer.putInt(this.itemType);
writer.putInt(this.itemUUID);
writer.putInt(this.templateID);
writer.putInt(this.totalProduction);
writer.putInt(this.unknown03);
writer.putInt(this.pToken);
@ -372,7 +372,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -372,7 +372,7 @@ public class ItemProductionMsg extends ClientNetMsg {
switch (this.actionType) {
case ACTION_SETPRICE:
this.itemType = reader.getInt();
this.itemUUID = reader.getInt();
this.templateID = reader.getInt();
reader.getInt();
reader.getInt();
reader.getInt();
@ -397,15 +397,15 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -397,15 +397,15 @@ public class ItemProductionMsg extends ClientNetMsg {
HashMap<Integer, Integer> tempIDs = new HashMap<>();
for (int i = 0; i < this.size; i++) {
int type = reader.getInt(); // Item type padding
this.itemUUID = reader.getInt();
tempIDs.put(this.itemUUID, type);
this.templateID = reader.getInt();
tempIDs.put(this.templateID, type);
}
reader.getInt();
this.itemIDtoTypeMap = tempIDs;
break;
case ACTION_DEPOSIT:
this.itemType = reader.getInt();
this.itemUUID = reader.getInt();
this.templateID = reader.getInt();
reader.getInt();
reader.getInt();
reader.getInt();
@ -417,7 +417,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -417,7 +417,7 @@ public class ItemProductionMsg extends ClientNetMsg {
break;
case ACTION_JUNK:
this.itemType = reader.getInt();
this.itemUUID = reader.getInt();
this.templateID = reader.getInt();
this.totalProduction = reader.getInt();
this.unknown03 = reader.getInt();
this.pToken = reader.getInt();
@ -429,7 +429,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -429,7 +429,7 @@ public class ItemProductionMsg extends ClientNetMsg {
break;
default:
this.itemType = reader.getInt();
this.itemUUID = reader.getInt();
this.templateID = reader.getInt();
this.totalProduction = reader.getInt();
this.unknown03 = reader.getInt();
this.pToken = reader.getInt();
@ -475,12 +475,12 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -475,12 +475,12 @@ public class ItemProductionMsg extends ClientNetMsg {
this.unknown03 = unknown03;
}
public int getItemUUID() {
return itemUUID;
public int getTemplateID() {
return templateID;
}
public void setItemUUID(int itemUUID) {
this.itemUUID = itemUUID;
public void setTemplateID(int templateID) {
this.templateID = templateID;
}
public int getpToken() {

Loading…
Cancel
Save