Ejemplo n.º 1
0
        // Token: 0x06000156 RID: 342 RVA: 0x0000C974 File Offset: 0x0000AB74
        private Message readMessage2(sbyte cmd)
        {
            int num  = (int)Session_ME.readKey(Session_ME.dis.ReadSByte()) + 128;
            int num2 = (int)Session_ME.readKey(Session_ME.dis.ReadSByte()) + 128;
            int num3 = (int)Session_ME.readKey(Session_ME.dis.ReadSByte()) + 128;
            int num4 = (num3 * 256 + num2) * 256 + num;

            Cout.LogError("SIZE = " + num4);
            sbyte[] array = new sbyte[num4];
            byte[]  src   = Session_ME.dis.ReadBytes(num4);
            Buffer.BlockCopy(src, 0, array, 0, num4);
            Session_ME.recvByteCount += 5 + num4;
            int num5 = Session_ME.recvByteCount + Session_ME.sendByteCount;

            Session_ME.strRecvByteCount = string.Concat(new object[]
            {
                num5 / 1024,
                ".",
                num5 % 1024 / 102,
                "Kb"
            });
            if (Session_ME.getKeyComplete)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    array[i] = Session_ME.readKey(array[i]);
                }
            }
            return(new Message(cmd, array));
        }
Ejemplo n.º 2
0
 // Token: 0x06000157 RID: 343 RVA: 0x0000CAB0 File Offset: 0x0000ACB0
 private Message readMessage()
 {
     try
     {
         sbyte b = Session_ME.dis.ReadSByte();
         if (Session_ME.getKeyComplete)
         {
             b = Session_ME.readKey(b);
         }
         if ((int)b == -32 || (int)b == -66 || (int)b == 11 || (int)b == -67 || (int)b == -74 || (int)b == -87)
         {
             return(this.readMessage2(b));
         }
         int num;
         if (Session_ME.getKeyComplete)
         {
             sbyte b2 = Session_ME.dis.ReadSByte();
             sbyte b3 = Session_ME.dis.ReadSByte();
             num = (((int)Session_ME.readKey(b2) & 255) << 8 | ((int)Session_ME.readKey(b3) & 255));
         }
         else
         {
             sbyte b4 = Session_ME.dis.ReadSByte();
             sbyte b5 = Session_ME.dis.ReadSByte();
             num = (((int)b4 & 65280) | ((int)b5 & 255));
         }
         sbyte[] array = new sbyte[num];
         byte[]  src   = Session_ME.dis.ReadBytes(num);
         Buffer.BlockCopy(src, 0, array, 0, num);
         Session_ME.recvByteCount += 5 + num;
         int num2 = Session_ME.recvByteCount + Session_ME.sendByteCount;
         Session_ME.strRecvByteCount = string.Concat(new object[]
         {
             num2 / 1024,
             ".",
             num2 % 1024 / 102,
             "Kb"
         });
         if (Session_ME.getKeyComplete)
         {
             for (int i = 0; i < array.Length; i++)
             {
                 array[i] = Session_ME.readKey(array[i]);
             }
         }
         return(new Message(b, array));
     }
     catch (Exception ex)
     {
         Debug.Log(ex.StackTrace.ToString());
     }
     return(null);
 }