示例#1
0
        public static NetworkData Parse(byte[] data)
        {
            NetworkCode code = (NetworkCode)BitConverter.ToInt32(data, 4);
            NetworkData nd   = null;

            byte[] d = new byte[data.Length - 8];
            Buffer.BlockCopy(data, 8, d, 0, data.Length - 8);
            nd = NetworkDataTypes.GetT(code)?.ParseData(d);
            if (nd is null)
            {
                Console.WriteLine($"Uncategorized net code {code}");
            }
            return(nd);
        }
示例#2
0
 private static void Add(NetworkData t, NetworkCode code)
 {
     codeToType.Add(code, t);
 }