private List <double> ReadDoubleList(ByteArray ba) { List <double> tbl = new List <double>(); int len1 = ba.ReadUShort(); ba.ReadUInt(); for (int i = 0; i < len1; i++) { tbl.Add(ReadDouble(ba)); } return(tbl); }
private List <Dictionary <string, object> > ReadDictionaryList(string str, ByteArray ba) { List <Dictionary <string, object> > stbl = new List <Dictionary <string, object> >(); int len1 = ba.ReadUShort(); ba.ReadUInt(); for (int i = 0; i < len1; i++) { stbl.Add(ReadDictionary(str, ba)); } return(stbl); }
ProtocolRequestBase Analysis(ByteArray bytes) { ProtocolRequestBase msg = new ProtocolRequestBase(); //Debug.Log("ReceiveDataLoad : " + BitConverter.ToString(bytes)); bytes.ReadUShort(); //消息长度 bytes.ReadByte(); //模块名 int methodIndex = bytes.ReadUShort(); //方法名 try { msg.Key = s_methodNameInfo[methodIndex]; int re_len = bytes.Length - 5; msg.m_data = AnalysisData(msg.Key, bytes.ReadBytes(re_len)); } catch (Exception e) { Debug.LogError("methodIndex:" + methodIndex + " \nEx:" + e.ToString()); } return(msg); }
private List <int> ReadInt8List(ByteArray ba) { List <int> tbl = new List <int>(); int len1 = ba.ReadUShort(); ba.ReadUInt(); for (int i = 0; i < len1; i++) { int tem_o_read_int = ReadInt8(ba); tbl.Add(tem_o_read_int); } return(tbl); }
private List <bool> ReadBoolList(ByteArray ba) { List <bool> tbl = new List <bool>(); tbl.Clear(); int len1 = ba.ReadUShort(); ba.ReadUInt(); for (int i = 0; i < len1; i++) { tbl.Add(ReadBool(ba)); } return(tbl); }
private List <string> ReadStringList(ByteArray ba) { List <string> tbl = new List <string>(); tbl.Clear(); int len1 = ba.ReadUShort(); ba.ReadUInt(); for (int i = 0; i < len1; i++) { tbl.Add(ReadString(ba)); } return(tbl); }
private string ReadString(ByteArray ba) { uint len = (uint)ba.ReadUShort(); return(ba.ReadUTFBytes(len)); }