Skip to content

Commit

Permalink
Minor fixes to PacketDecoder
Browse files Browse the repository at this point in the history
- Remove messagebox call when using invalid value for send/recv multiples
- Show decoded data in packet view
  • Loading branch information
ethanmoffat committed Feb 25, 2022
1 parent a85c830 commit 078ebb4
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions PacketDecoder/MainForm.cs
@@ -1,4 +1,5 @@
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using EOLib.Config;
Expand Down Expand Up @@ -110,13 +111,25 @@ private void intTextValidate(object sender, EventArgs e)
{
_packetProcessActions.SetEncodeMultiples((byte)param, _packetEncoderRepository.SendMultiplier);
if (param < 6 || param > 12)
MessageBox.Show("This should be between 6 and 12...", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
{
txtDMulti.BackColor = Color.FromArgb(255, 255, 128, 128);
}
else
{
txtDMulti.BackColor = Color.White;
}
}
else if (txt == txtEMulti)
{
_packetProcessActions.SetEncodeMultiples(_packetEncoderRepository.ReceiveMultiplier, (byte)param);
if (param < 6 || param > 12)
MessageBox.Show("This should be between 6 and 12...", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
{
txtEMulti.BackColor = Color.FromArgb(255, 255, 128, 128);
}
else
{
txtEMulti.BackColor = Color.White;
}
}
else if (txt == txtOffset)
{
Expand Down Expand Up @@ -169,9 +182,9 @@ private void _checkRequiredInputs()
lblAction.Text = pkt.Action.ToString();

string decoded = "";
for (int i = 0; i < data.Length; i++)
for (int i = 0; i < pkt.Length; i++)
{
decoded += $"{data[i].ToString("D3")} ";
decoded += $"{pkt.RawData[i].ToString("D3")} ";
}
txtDecoded.Text = decoded;

Expand Down

0 comments on commit 078ebb4

Please sign in to comment.