more preparations

Preparations for crafting
This commit is contained in:
CharonInferar
2014-04-13 22:59:31 +02:00
parent afcec36cc1
commit 7091c4bbb3
3 changed files with 58 additions and 53 deletions
@@ -43,5 +43,16 @@ public class ObjControllerOpcodes {
public static final int NPC_CONVERSATION_OPTIONS = 0xE0000000;
public static final int SET_PROFESSION_TEMPLATE = 0x5C040000;
public static final int RESOURCE_EMPTY_HOPPER = 0xED000000;
public static final int DRAFT_SCHEMATICS = 0x0102;
public static final int DRAFT_SLOTS = 0x0103;
public static final int CRAFT_EXPERIMENT = 0x0106;
public static final int CRAFT_FILLSLOT = 0x7010000;
public static final int CRAFT_EMPTYSLOT = 0x8010000;
public static final int CRAFT_ACKNOWLEDGE = 0x010C;
public static final int CRAFT_CUSTOMIZATION = 0x5a010000;
public static final int NEXT_CRAFTING_STAGE_RESULT = 0x01BE;
public static final int DRAFT_SLOTS_QUERY_RESPONSE = 0x01BF;
public static final int RESOURCE_WEIGHTS = 0x0207;
}
@@ -161,6 +161,49 @@ public class TangibleMessageBuilder extends ObjectMessageBuilder {
return buffer;
}
public IoBuffer buildDelta3() {
IoBuffer buffer = bufferPool.allocate(2, false).order(ByteOrder.LITTLE_ENDIAN);
buffer.setAutoExpand(true);
buffer.putShort((short)5);
buffer.putInt(0x12862153);
buffer.putLong(getObject().getObjectID());
buffer.putInt(0x54414E4F);
buffer.put((byte)3);
buffer.putInt(8);//buffer.putInt(8+6);
buffer.putShort((short) 2);
buffer.putShort((short)8);
buffer.put((byte)0);
buffer.putShort((short) 0x21);
buffer.put((byte)0);
// buffer.putShort((short) 0);
// buffer.putFloat(4.0F);
int size = buffer.position();
buffer.flip();
return IoBuffer.allocate(size).put(buffer.array(), 0, size).flip();
}
public IoBuffer buildAssemblyDelta3() {
IoBuffer buffer = bufferPool.allocate(2, false).order(ByteOrder.LITTLE_ENDIAN);
buffer.setAutoExpand(true);
buffer.putShort((short)5);
buffer.putInt(0x12862153);
buffer.putLong(getObject().getObjectID());
buffer.putInt(0x54414E4F);
buffer.put((byte)3);
buffer.putInt(8);//buffer.putInt(8+6);
buffer.putShort((short) 1);
buffer.putShort((short)0x0B);
buffer.putInt(0x000003E8); // ?
int size = buffer.position();
buffer.flip();
return IoBuffer.allocate(size).put(buffer.array(), 0, size).flip();
}
@Override
public void sendListDelta(byte viewType, short updateType, IoBuffer buffer) {
// TODO Auto-generated method stub
+4 -53
View File
@@ -619,40 +619,10 @@ public class CommandService implements INetworkDispatch {
int slotNumber = data.getInt();
int option = data.getInt();
byte sequence = data.get();
core.craftingService.handleCraftFillSlot(playerId, ingredientId, slotNumber, option, sequence);
//core.craftingService.handleCraftFillSlot(playerId, ingredientId, slotNumber, option, sequence);
}
});
});
/*
NGE break by cAble
05 00 #Operand
46 5E CE 80 #ObjCon
83 00 00 00
07 01 00 00 #CraftFillSlot
00 2E E9 E9 31 00 00 00
00 00 00 00 #unknown
16 A5 C8 50 32 00 00 00 #ObjectID for Ingredient
01 00 00 00 #Slot01
00 00 00 00 #Option
85 #sequence
05 00 #Operand
46 5E CE 80 #ObjCon
83 00 00 00
07 01 00 00 #CraftFillSlot
00 2E E9 E9 31 00 00 00 #CharacterID
00 00 00 00 #Unknown
9D 3F EB F9 3A 00 00 00 #ObjectID for Ingredient
02 00 00 00 #Slot02
00 00 00 00 #Option
86 #Sequence
*/
objControllerOpcodes.put(ObjControllerOpcodes.CRAFT_EMPTYSLOT, new INetworkRemoteEvent() {
@Override
@@ -670,25 +640,12 @@ public class CommandService implements INetworkDispatch {
CreatureObject actor = (CreatureObject) client.getParent();
SWGObject target = core.objectService.getObject(commandEnqueue.getTargetID());
// System.out.println("CRAFTEMPTY");
// StringBuilder sb = new StringBuilder();
// for (byte b : data.array()) {
// sb.append(String.format("%02X ", b));
// }
// System.out.println(sb.toString());
// 05 00 46 5E CE 80 83 00 00 00 08 01 00 00 B4 A1
// 0B 00 00 00 00 00 00 00 00 00 01 00 00 00 B7 A1
// 0B 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00
// 00 00 00 00 00 00 00 00 00 00 00 00
long playerId = data.getLong();
data.getInt(); // 00 00 00 00
int slotNumber = data.getInt();
long ingredientId = data.getLong();
byte sequence = data.get();
core.craftingService.handleCraftEmptySlot(playerId, ingredientId, slotNumber, sequence);
//core.craftingService.handleCraftEmptySlot(playerId, ingredientId, slotNumber, sequence);
}
});
@@ -704,12 +661,6 @@ public class CommandService implements INetworkDispatch {
return;
}
// StringBuilder sb = new StringBuilder();
// for (byte b : data.array()) {
// sb.append(String.format("%02X ", b));
// }
// System.out.println(sb.toString());
long playerId = data.getLong();
data.getInt(); // 00 00 00 00 UTF-16LE
@@ -736,7 +687,7 @@ public class CommandService implements INetworkDispatch {
int customizationValue = data.getInt();
}
core.craftingService.handleCraftCustomization(playerId,enteredName,modelNumber,schematicQuantity,customizationList);
//core.craftingService.handleCraftCustomization(playerId,enteredName,modelNumber,schematicQuantity,customizationList);
}
});