Skip to content

Commit

Permalink
Added Shift+F3 - Find Previous, fixed a possible crash when using F3 …
Browse files Browse the repository at this point in the history
…when no pcap is loaded.

Misc CM_ stuff
  • Loading branch information
Mag-nus committed Mar 7, 2017
1 parent f1809fe commit d07737d
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 21 deletions.
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
22 changes: 11 additions & 11 deletions aclogview/CM_Communication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ public class Recv_ChatRoomTracker : Message
public uint RoleplayChannel;
public uint Olthoi;
public uint Society;
public uint Unknown_3;
public uint Unknown_4;
public uint Unknown_5;

public static Recv_ChatRoomTracker read(BinaryReader binaryReader)
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();
Expand All @@ -169,9 +169,9 @@ public static Recv_ChatRoomTracker read(BinaryReader binaryReader)
newObj.RoleplayChannel = binaryReader.ReadUInt32();
newObj.Olthoi = binaryReader.ReadUInt32();
newObj.Society = binaryReader.ReadUInt32();
newObj.Unknown_3 = binaryReader.ReadUInt32();
newObj.Unknown_4 = binaryReader.ReadUInt32();
newObj.Unknown_5 = binaryReader.ReadUInt32();
newObj.SocietyCelHan = binaryReader.ReadUInt32();
newObj.SocietyEldWeb = binaryReader.ReadUInt32();
newObj.SocietyRadBlo = binaryReader.ReadUInt32();
return newObj;
}

Expand All @@ -186,9 +186,9 @@ public override void contributeToTreeView(TreeView treeView)
rootNode.Nodes.Add("RoleplayChannel = " + RoleplayChannel);
rootNode.Nodes.Add("Olthoi = " + Olthoi);
rootNode.Nodes.Add("Society = " + Society);
rootNode.Nodes.Add("Unknown_3 = " + Unknown_3);
rootNode.Nodes.Add("Unknown_4 = " + Unknown_4);
rootNode.Nodes.Add("Unknown_5 = " + Unknown_5);
rootNode.Nodes.Add("SocietyCelHan = " + SocietyCelHan);
rootNode.Nodes.Add("SocietyEldWeb = " + SocietyEldWeb);
rootNode.Nodes.Add("SocietyRadBlo = " + SocietyRadBlo);
treeView.Nodes.Add(rootNode);
}
}
Expand Down
13 changes: 12 additions & 1 deletion aclogview/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions aclogview/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,28 @@ private void menuItem_Open_Click(object sender, EventArgs e)
loadPcap(openFile.FileName);
}

private void mnuItem_EditPreviousHighlightedRow_Click(object sender, EventArgs e)
{
if (listView_Packets.TopItem == null)
return;

for (int i = listView_Packets.TopItem.Index - 1; i >= 0; i--)
{
if (listView_Packets.Items[i].BackColor != SystemColors.Window)
{
listView_Packets.TopItem = listView_Packets.Items[i];
listView_Packets.TopItem.Selected = true;
listView_Packets.TopItem.Focused = true;
break;
}
}
}

private void mnuItem_EditNextHighlightedRow_Click(object sender, EventArgs e)
{
if (listView_Packets.TopItem == null)
return;

for (int i = listView_Packets.TopItem.Index + 1; i < listView_Packets.Items.Count; i++)
{
if (listView_Packets.Items[i].BackColor != SystemColors.Window)
Expand Down

0 comments on commit d07737d

Please sign in to comment.