예제 #1
0
 private void listView2_ItemActivate(object sender, EventArgs e)
 {
     if (listView2.SelectedItems.Count > 0)
     {
         int index = listView2.SelectedIndices[0];
         if (index >= 0 && index < RconPacketLog.Instance.Packets.Count)
         {
             RconDebugPacket debugPacket = RconPacketLog.Instance.Packets[index];
             debugPacketDialog.ShowDialog(debugPacket);
         }
     }
 }
        public void GenerateDebugInfo(byte[] packet, PacketDirection dir)
        {
            long time = DateTime.Now.Ticks;

            RconDebugPacket debugPacket = new RconDebugPacket();

            debugPacket.Size = GetPacketLength(packet);
            debugPacket.Id   = GetPacketId(packet);
            debugPacket.Type = GetPacketType(packet);
            if (dir == PacketDirection.Sent && debugPacket.Type == SERVERDATA_AUTH)
            {
                debugPacket.Data = "********";
            }
            else
            {
                debugPacket.Data = GetPacketData(packet);
            }
            debugPacket.Direction = dir;

            RconPacketLog.Instance.Packets.Add(debugPacket);
        }