Skip to content

Commit

Permalink
Also adding 0x0022, INVENTORY_PUT_OBJ_IN_CONTAINER_EVENT, using docum…
Browse files Browse the repository at this point in the history
…entation from the Skunkworks protocol site
  • Loading branch information
fantoms committed May 13, 2017
1 parent 2b305b5 commit 8c3b337
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions aclogview/CM_Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ public override bool acceptMessageData(BinaryReader messageDataReader, TreeView

PacketOpcode opcode = Util.readOpcode(messageDataReader);
switch (opcode) {
case PacketOpcode.INVENTORY_PUT_OBJ_IN_CONTAINER_EVENT: //0x0022
{
PutObjectInContainerEvent message = PutObjectInContainerEvent.read(messageDataReader);
message.contributeToTreeView(outputTreeView);
break;
}
case PacketOpcode.INVENTORY_WIELD_OBJ_EVENT: // 0x0023
{
WieldItem message = WieldItem.read(messageDataReader);
Expand Down Expand Up @@ -107,6 +113,36 @@ public override bool acceptMessageData(BinaryReader messageDataReader, TreeView
return handled;
}

public class PutObjectInContainerEvent : Message
{
public uint i_objectId;
public uint i_container;
public uint i_slot;
public uint i_type;

public static PutObjectInContainerEvent read(BinaryReader binaryReader)
{
PutObjectInContainerEvent newObj = new PutObjectInContainerEvent();
newObj.i_objectId = binaryReader.ReadUInt32();
newObj.i_container = binaryReader.ReadUInt32();
newObj.i_slot = binaryReader.ReadUInt32();
newObj.i_type = binaryReader.ReadUInt32();
return newObj;
}

public override void contributeToTreeView(TreeView treeView)
{
TreeNode rootNode = new TreeNode(this.GetType().Name);
rootNode.Expand();
rootNode.Nodes.Add("i_objectId = " + Utility.FormatGuid(i_objectId));
rootNode.Nodes.Add("i_container = " + Utility.FormatGuid(i_container));
rootNode.Nodes.Add("i_slot = " + i_slot);
rootNode.Nodes.Add("i_type = " + Utility.FormatGuid(i_type));
treeView.Nodes.Add(rootNode);
}
}


public class WieldItem : Message
{
public uint i_item;
Expand Down

0 comments on commit 8c3b337

Please sign in to comment.