Skip to content

Commit

Permalink
Merge pull request #16 from fantoms/feature-invWieldAndRemove
Browse files Browse the repository at this point in the history
Inventory's Wield Object Event and Remove Object Event messages
  • Loading branch information
tfarley authored May 18, 2017
2 parents f7d885e + 8c3b337 commit b184d15
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions aclogview/CM_Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ 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);
message.contributeToTreeView(outputTreeView);
break;
}
case PacketOpcode.INVENTORY_REMOVE_OBJ_EVENT: // 0x0024
{
RemoveObject message = RemoveObject.read(messageDataReader);
message.contributeToTreeView(outputTreeView);
break;
}
case PacketOpcode.Evt_Inventory__PutItemInContainer_ID: {
PutItemInContainer message = PutItemInContainer.read(messageDataReader);
message.contributeToTreeView(outputTreeView);
Expand Down Expand Up @@ -101,6 +119,79 @@ 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;
public uint i_equipMask;

public static WieldItem read(BinaryReader binaryReader)
{
WieldItem newObj = new WieldItem();
newObj.i_item = binaryReader.ReadUInt32();
newObj.i_equipMask = binaryReader.ReadUInt32();
return newObj;
}

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

public class RemoveObject : Message
{
public uint i_item;

public static RemoveObject read(BinaryReader binaryReader)
{
RemoveObject newObj = new RemoveObject();
newObj.i_item = binaryReader.ReadUInt32();
return newObj;
}

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

public class PutItemInContainer : Message {
public uint i_item;
public uint i_container;
Expand Down

0 comments on commit b184d15

Please sign in to comment.