Пример #1
0
        public void ParseMessageInRC5Encrypt(byte[] data)
        {
            byte[] output     = RC5Encrypt.Decrypt(data);
            int    bodyLength = ((int)output[1] << 8) + output[0];

            this.isCompress = false;
            if (((int)output[3] & 0x40) != 0)
            {
                this.isCompress = true;
                byte[] unCompressData = null;
                using (MemoryStream ms = new MemoryStream()) {
                    ms.Write(output, HeadSize, bodyLength);
                    //unCompressData = ZipCompress.Decompress(ms.GetBuffer());
                }
            }

            byte[] nullCmdBytes = new byte[6];
            Array.Copy(output, 4, nullCmdBytes, 0, 6);
            object obj = CmdSerializer.BytesToStruct(nullCmdBytes, typeof(stNullUserCmd));

            if (obj is stNullUserCmd)
            {
                bmdParamTime = (stNullUserCmd)obj;
            }
        }
Пример #2
0
 public void SerizizeNullCmd(byte[] data)
 {
     byte[] nullCmdBytes = new byte[6];
     Array.Copy(data, HeadSize, nullCmdBytes, 0, 6);
     bmdParamTime = (stNullUserCmd)CmdSerializer.BytesToStruct(nullCmdBytes, typeof(stNullUserCmd));
 }