private void ShowPacketInfo(NrCommandInterpreter.NrCommand command) { ushort ui16ID = 0; try { ui16ID = Convert.ToUInt16(command.m_arArg[1]); } catch { NrTSingleton <NrDebugConsole> .Instance.Print("convert error."); } NrPacketInfo packetInfo = NrTSingleton <NrPacketHistory> .Instance.GetPacketInfo(ui16ID); if (packetInfo == null) { NrTSingleton <NrDebugConsole> .Instance.Print("not found packet data."); return; } NrTSingleton <NrDebugConsole> .Instance.Print("Packet Infomation ====================================="); NrTSingleton <NrDebugConsole> .Instance.Print("Uniq ID : " + packetInfo.m_ui16UniqID.ToString()); NrTSingleton <NrDebugConsole> .Instance.Print("Net Time : " + packetInfo.m_strTime); NrTSingleton <NrDebugConsole> .Instance.Print("======================================================="); foreach (string current in packetInfo.m_arContents) { NrTSingleton <NrDebugConsole> .Instance.Print(current); } NrTSingleton <NrDebugConsole> .Instance.Print("======================================================="); }
public void AddPacketInfo(NrPacketInfo kPacketInfo) { if (this.m_arPacketInfo.Count >= 1000) { this.m_arPacketInfo.RemoveRange(0, 500); } kPacketInfo.m_ui16UniqID = this.m_ui16UniqID; this.m_arPacketInfo.Add(kPacketInfo); this.m_ui16UniqID += 1; }
private void ShowPacketHistory(NrCommandInterpreter.NrCommand command) { ushort num = 100; if (command.m_arArg.Count >= 2) { try { num = Convert.ToUInt16(command.m_arArg[1]); } catch (Exception ex) { NrTSingleton <NrDebugConsole> .Instance.Print("don't convert to decimal. " + ex.Message + "\n" + ex.StackTrace); num = 100; } } List <NrPacketInfo> packetInfoList = NrTSingleton <NrPacketHistory> .Instance.GetPacketInfoList(); if (packetInfoList.Count < (int)num) { num = (ushort)packetInfoList.Count; } for (int i = packetInfoList.Count - (int)num; i < packetInfoList.Count; i++) { NrPacketInfo nrPacketInfo = packetInfoList[i]; NrTSingleton <NrDebugConsole> .Instance.Print(string.Concat(new string[] { nrPacketInfo.m_strTime, " ", nrPacketInfo.m_strPacketName, "(", nrPacketInfo.m_ui16UniqID.ToString(), ")" })); } }