Skip to content

Commit

Permalink
Merge pull request #3 from Mag-nus/master
Browse files Browse the repository at this point in the history
Added special output (dev feature) for FindOpcodeInFilesForm.
  • Loading branch information
tfarley authored Mar 7, 2017
2 parents d7f7a34 + d07737d commit c843f04
Show file tree
Hide file tree
Showing 7 changed files with 564 additions and 105 deletions.
153 changes: 150 additions & 3 deletions aclogview/CM_Admin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,163 @@ public override bool acceptMessageData(BinaryReader messageDataReader, TreeView
bool handled = true;

PacketOpcode opcode = Util.readOpcode(messageDataReader);
switch (opcode) {

switch (opcode) {
case PacketOpcode.Evt_Admin__ChatServerData_ID: // 0xF7DE
{
var message = ChatServerData.read(messageDataReader);
message.contributeToTreeView(outputTreeView);
break;
}
default: {
handled = false;
break;
}
}

return handled;
}
}

public class ChatServerData : Message
{
public uint Size;
public uint TurbineChatType;
public uint Unknown_1;
public uint Unknown_2;
public uint Unknown_3;
public uint Unknown_4;
public uint Unknown_5;
public uint Unknown_6;
public uint PayloadSize;

// 0x01
public uint Channel;
public string SenderName;
public string Message;
public uint Unknown01_1;
public uint Sender;
public uint Unknown01_2;
public uint Unknown01_3;

// 0x03
public uint Unknown03_1;
public uint Unknown03_2;
public uint Unknown03_3;
public uint OutChannel;
public string OutText;
public uint Unknown03_4;
public uint OutSender;
public uint Unknown03_5;
public uint Unknown03_6;

// 0x05
public uint Unknown05_1;
public uint Unknown05_2;
public uint Unknown05_3;
public uint Unknown05_4;

public static ChatServerData read(BinaryReader binaryReader)
{
var newObj = new ChatServerData();
newObj.Size = binaryReader.ReadUInt32();
newObj.TurbineChatType = binaryReader.ReadUInt32();
newObj.Unknown_1 = binaryReader.ReadUInt32();
newObj.Unknown_2 = binaryReader.ReadUInt32();
newObj.Unknown_3 = binaryReader.ReadUInt32();
newObj.Unknown_4 = binaryReader.ReadUInt32();
newObj.Unknown_5 = binaryReader.ReadUInt32();
newObj.Unknown_6 = binaryReader.ReadUInt32();
newObj.PayloadSize = binaryReader.ReadUInt32();

if (newObj.TurbineChatType == 0x01)
{
newObj.Channel = binaryReader.ReadUInt32();

var messageLen = binaryReader.ReadByte();
var messageBytes = binaryReader.ReadBytes(messageLen * 2);
newObj.SenderName = Encoding.Unicode.GetString(messageBytes);

messageLen = binaryReader.ReadByte();
messageBytes = binaryReader.ReadBytes(messageLen * 2);
newObj.Message = Encoding.Unicode.GetString(messageBytes);

newObj.Unknown01_1 = binaryReader.ReadUInt32();
newObj.Sender = binaryReader.ReadUInt32();
newObj.Unknown01_2 = binaryReader.ReadUInt32();
newObj.Unknown01_3 = binaryReader.ReadUInt32();
}
else if (newObj.TurbineChatType == 0x03)
{
newObj.Unknown03_1 = binaryReader.ReadUInt32();
newObj.Unknown03_2 = binaryReader.ReadUInt32();
newObj.Unknown03_3 = binaryReader.ReadUInt32();
newObj.OutChannel = binaryReader.ReadUInt32();

var messageLen = binaryReader.ReadByte();
var messageBytes = binaryReader.ReadBytes(messageLen * 2);
newObj.OutText = Encoding.Unicode.GetString(messageBytes);

newObj.Unknown03_4 = binaryReader.ReadUInt32();
newObj.OutSender = binaryReader.ReadUInt32();
newObj.Unknown03_5 = binaryReader.ReadUInt32();
newObj.Unknown03_6 = binaryReader.ReadUInt32();

}
else if (newObj.TurbineChatType == 0x05)
{
newObj.Unknown05_1 = binaryReader.ReadUInt32();
newObj.Unknown05_2 = binaryReader.ReadUInt32();
newObj.Unknown05_3 = binaryReader.ReadUInt32();
newObj.Unknown05_4 = binaryReader.ReadUInt32();
}

return newObj;
}

public override void contributeToTreeView(TreeView treeView)
{
TreeNode rootNode = new TreeNode(this.GetType().Name);
rootNode.Expand();
rootNode.Nodes.Add("Size = " + Size);
rootNode.Nodes.Add("TurbineChatType = " + TurbineChatType);
rootNode.Nodes.Add("Unknown_1 = " + Unknown_1);
rootNode.Nodes.Add("Unknown_2 = " + Unknown_2);
rootNode.Nodes.Add("Unknown_3 = " + Unknown_3);
rootNode.Nodes.Add("Unknown_4 = " + Unknown_4);
rootNode.Nodes.Add("Unknown_5 = " + Unknown_5);
rootNode.Nodes.Add("Unknown_6 = " + Unknown_6);
rootNode.Nodes.Add("PayloadSize = " + PayloadSize);

if (TurbineChatType == 0x01)
{
rootNode.Nodes.Add("Channel = " + Channel);
rootNode.Nodes.Add("SenderName = " + SenderName);
rootNode.Nodes.Add("Message = " + Message);
rootNode.Nodes.Add("Unknown01_1 = " + Unknown01_1);
rootNode.Nodes.Add("Sender = " + Sender);
rootNode.Nodes.Add("Unknown01_2 = " + Unknown01_2);
rootNode.Nodes.Add("Unknown01_3 = " + Unknown01_3);
}
else if (TurbineChatType == 0x03)
{
rootNode.Nodes.Add("Unknown03_1 = " + Unknown03_1);
rootNode.Nodes.Add("Unknown03_2 = " + Unknown03_2);
rootNode.Nodes.Add("Unknown03_3 = " + Unknown03_3);
rootNode.Nodes.Add("OutChannel = " + OutChannel);
rootNode.Nodes.Add("OutText = " + OutText);
rootNode.Nodes.Add("Unknown03_4 = " + Unknown03_4);
rootNode.Nodes.Add("OutSender = " + OutSender);
rootNode.Nodes.Add("Unknown03_5 = " + Unknown03_5);
rootNode.Nodes.Add("Unknown03_6 = " + Unknown03_6);
}
else if (TurbineChatType == 0x05)
{
rootNode.Nodes.Add("Unknown05_1 = " + Unknown05_1);
rootNode.Nodes.Add("Unknown05_2 = " + Unknown05_2);
rootNode.Nodes.Add("Unknown05_3 = " + Unknown05_3);
rootNode.Nodes.Add("Unknown05_4 = " + Unknown05_4);
}

treeView.Nodes.Add(rootNode);
}
}
}
40 changes: 31 additions & 9 deletions aclogview/CM_Allegiance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ public void contributeToTreeNode(TreeNode node) {
}
}

public class AllegianceNode {
public class AllegianceNode
{
public AllegianceNode _patron;
public AllegianceNode _peer;
public AllegianceNode _vassal;
Expand All @@ -281,7 +282,8 @@ public class AllegianceNode {
// TODO: Read in all the stuff
}

public class AllegianceHierarchy {
public class AllegianceHierarchy
{
public AllegianceVersion m_oldVersion;
public uint m_total;
public PackableHashTable<uint, uint> m_AllegianceOfficers;
Expand All @@ -298,28 +300,48 @@ public class AllegianceHierarchy {
public int m_NameLastSetTime;
public uint m_isLocked;
public uint m_ApprovedVassal;
public AllegianceNode m_pMonarch;
public AllegianceNode m_pMonarch;

// TODO: Read in all the stuff

public static AllegianceHierarchy read(BinaryReader binaryReader)
{
AllegianceHierarchy newObj = new AllegianceHierarchy();
newObj.m_oldVersion = (AllegianceVersion)binaryReader.ReadByte();
newObj.m_total = binaryReader.ReadUInt32();
// TODO: Read in profile
return newObj;
}

// TODO: Read in all the stuff
public void contributeToTreeNode(TreeNode node)
{
node.Nodes.Add("m_oldVersion = " + m_oldVersion);
node.Nodes.Add("m_total = " + m_total);
// TODO: Read in profile
}
}

public class AllegianceProfile {
public class AllegianceProfile
{
public uint _total_members;
public uint _total_vassals;
public AllegianceHierarchy _allegiance;

public static AllegianceProfile read(BinaryReader binaryReader) {
public static AllegianceProfile read(BinaryReader binaryReader)
{
AllegianceProfile newObj = new AllegianceProfile();
newObj._total_members = binaryReader.ReadUInt32();
newObj._total_vassals = binaryReader.ReadUInt32();
// TODO: Read in profile
newObj._allegiance = AllegianceHierarchy.read(binaryReader);
return newObj;
}

public void contributeToTreeNode(TreeNode node) {
public void contributeToTreeNode(TreeNode node)
{
node.Nodes.Add("_total_members = " + _total_members);
node.Nodes.Add("_total_vassals = " + _total_vassals);
// TODO: Read in profile
TreeNode profileNode = node.Nodes.Add("allegianceProfile = ");
_allegiance.contributeToTreeNode(profileNode);
}
}

Expand Down
55 changes: 54 additions & 1 deletion aclogview/CM_Communication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public override bool acceptMessageData(BinaryReader messageDataReader, TreeView
message.contributeToTreeView(outputTreeView);
break;
}*/
case PacketOpcode.Evt_Communication__Recv_ChatRoomTracker_ID: // 0x0295
{
var message = Recv_ChatRoomTracker.read(messageDataReader);
message.contributeToTreeView(outputTreeView);
break;
}
case PacketOpcode.Evt_Communication__WeenieError_ID: // 0x028A
{
WeenieError message = WeenieError.read(messageDataReader);
Expand Down Expand Up @@ -66,7 +72,7 @@ public override bool acceptMessageData(BinaryReader messageDataReader, TreeView
var message = TextBoxString.read(messageDataReader);
message.contributeToTreeView(outputTreeView);
break;
}
}
default: {
handled = false;
break;
Expand Down Expand Up @@ -140,6 +146,53 @@ public override void contributeToTreeView(TreeView treeView)
}
}*/

public class Recv_ChatRoomTracker : Message
{
public uint AllegianceChannel;
public uint GeneralChannel;
public uint TradeChannel;
public uint LFGChannel;
public uint RoleplayChannel;
public uint Olthoi;
public uint Society;
public uint SocietyCelHan;
public uint SocietyEldWeb;
public uint SocietyRadBlo;

public static Recv_ChatRoomTracker read(BinaryReader binaryReader)
{
var newObj = new Recv_ChatRoomTracker();
newObj.AllegianceChannel = binaryReader.ReadUInt32();
newObj.GeneralChannel = binaryReader.ReadUInt32();
newObj.TradeChannel = binaryReader.ReadUInt32();
newObj.LFGChannel = binaryReader.ReadUInt32();
newObj.RoleplayChannel = binaryReader.ReadUInt32();
newObj.Olthoi = binaryReader.ReadUInt32();
newObj.Society = binaryReader.ReadUInt32();
newObj.SocietyCelHan = binaryReader.ReadUInt32();
newObj.SocietyEldWeb = binaryReader.ReadUInt32();
newObj.SocietyRadBlo = binaryReader.ReadUInt32();
return newObj;
}

public override void contributeToTreeView(TreeView treeView)
{
TreeNode rootNode = new TreeNode(this.GetType().Name);
rootNode.Expand();
rootNode.Nodes.Add("AllegianceChannel = " + AllegianceChannel);
rootNode.Nodes.Add("GeneralChannel = " + GeneralChannel);
rootNode.Nodes.Add("TradeChannel = " + TradeChannel);
rootNode.Nodes.Add("LFGChannel = " + LFGChannel);
rootNode.Nodes.Add("RoleplayChannel = " + RoleplayChannel);
rootNode.Nodes.Add("Olthoi = " + Olthoi);
rootNode.Nodes.Add("Society = " + Society);
rootNode.Nodes.Add("SocietyCelHan = " + SocietyCelHan);
rootNode.Nodes.Add("SocietyEldWeb = " + SocietyEldWeb);
rootNode.Nodes.Add("SocietyRadBlo = " + SocietyRadBlo);
treeView.Nodes.Add(rootNode);
}
}

public class WeenieError : Message {
public WERROR etype;

Expand Down
Loading

0 comments on commit c843f04

Please sign in to comment.