diff --git a/src/network/packets/swg/zone/object_controller/DraftSchematics.java b/src/network/packets/swg/zone/object_controller/DraftSchematics.java deleted file mode 100644 index 9214c9165..000000000 --- a/src/network/packets/swg/zone/object_controller/DraftSchematics.java +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************************************ - * Copyright (c) 2015 /// Project SWG /// www.projectswg.com * - * * - * ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on * - * July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. * - * Our goal is to create an emulator which will provide a server for players to * - * continue playing a game similar to the one they used to play. We are basing * - * it on the final publish of the game prior to end-game events. * - * * - * This file is part of Holocore. * - * * - * -------------------------------------------------------------------------------- * - * * - * Holocore is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * Holocore is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with Holocore. If not, see . * - * * - ***********************************************************************************/ -package network.packets.swg.zone.object_controller; - -import com.projectswg.common.network.NetBuffer; - -public class DraftSchematics extends ObjectController { - - private final static int CRC = 0x0102; - - private long toolId; - private long craftingStationId; - private int schematicsCounter; - private int[] serverCrc; - private int[] clientCrc; - private int[] category; - - public DraftSchematics(long toolId, long craftingStationId, int schematicsCounter, int serverCrc, int clientCrc, int category) { - super(CRC); - this.toolId = toolId; - this.craftingStationId = craftingStationId; - this.schematicsCounter = schematicsCounter; - for(int i = 0; i <= schematicsCounter; i++){ - this.serverCrc[i] = serverCrc; - this.clientCrc[i] = clientCrc; - this.category[i] = category; - } - } - - @Override - public void decode(NetBuffer data) { - toolId = data.getLong(); - craftingStationId = data.getLong(); - schematicsCounter = data.getInt(); - for(int i = 0; i < schematicsCounter; i++){ - serverCrc[i] = data.getInt(); - clientCrc[i] = data.getInt(); - category[i] = data.getInt(); - } - } - - @Override - public NetBuffer encode() { - NetBuffer data = NetBuffer.allocate(HEADER_LENGTH + 2); - encodeHeader(data); - data.addLong(toolId); - data.addLong(craftingStationId); - data.addInt(schematicsCounter); - for(int i =0; i <= schematicsCounter; i++){ - data.addInt(serverCrc[i]); - data.addInt(clientCrc[i]); - data.addInt(category[i]); - } - return data; - } - - public long getToolId() { - return toolId; - } - - public long getCraftingStationId() { - return craftingStationId; - } - - public int getSchematicsCounter() { - return schematicsCounter; - } - - public int[] getServerCrc() { - return serverCrc; - } - - public int[] getClientCrc() { - return clientCrc; - } - - public int[] getCategory() { - return category; - } -} \ No newline at end of file diff --git a/src/network/packets/swg/zone/object_controller/ObjectController.java b/src/network/packets/swg/zone/object_controller/ObjectController.java index c9ef9e174..83f1b0883 100644 --- a/src/network/packets/swg/zone/object_controller/ObjectController.java +++ b/src/network/packets/swg/zone/object_controller/ObjectController.java @@ -99,6 +99,7 @@ public abstract class ObjectController extends SWGPacket { case 0x0071: return new DataTransform(data); case 0x00CC: return new CombatAction(data); case 0x00F1: return new DataTransformWithParent(data); + case 0x0115: return new SecureTrade(data); case 0x0116: return new CommandQueueEnqueue(data); case 0x0117: return new CommandQueueDequeue(data); case 0x0126: return new LookAtTarget(data); @@ -107,6 +108,7 @@ public abstract class ObjectController extends SWGPacket { case 0x0134: return new CombatSpam(data); case 0x0146: return new ObjectMenuRequest(data); case 0x01BD: return new ShowFlyText(data); + case 0x01BF: return new DraftSlotsQueryResponse(data); case 0x01DB: return new BiographyUpdate(data); case 0x0448: return new CommandTimer(data); case 0x044D: return new ChangeRoleIconChoice(data); @@ -114,8 +116,7 @@ public abstract class ObjectController extends SWGPacket { case 0x04C5: return new IntendedTarget(data); case 0x00F5: return new MissionListRequest(data); case 0x041C: return new JTLTerminalSharedMessage(data); - case 0x0115: return new SecureTrade(data); - case 0x0102: return new DraftSlotsQueryResponse(data); + } Log.w("Unknown object controller: %08X", crc); return new GenericObjectController(crc, data); diff --git a/src/resources/schematic/DraftSchematic.java b/src/resources/schematic/DraftSchematic.java index 65a13455e..fe88df43e 100644 --- a/src/resources/schematic/DraftSchematic.java +++ b/src/resources/schematic/DraftSchematic.java @@ -9,10 +9,11 @@ import resources.schematic.IngridientSlot.IngridientType; public class DraftSchematic { + private final List ingridientSlot; + private String parent; private int itemsPerContainer; private String craftedSharedTemplate; - private final List ingridientSlot; private int complexity; private long combinedCrc; private int volume; diff --git a/src/resources/schematic/IngridientSlot.java b/src/resources/schematic/IngridientSlot.java index ece8344da..f3a52a27e 100644 --- a/src/resources/schematic/IngridientSlot.java +++ b/src/resources/schematic/IngridientSlot.java @@ -38,7 +38,9 @@ public class IngridientSlot implements Encodable{ } public void addSlotDataOption(DraftSlotDataOption object){ - slotOptions.add(object); + synchronized (slotOptions) { + slotOptions.add(object); + } } public List getFromSlotDataOption(){