Esempio n. 1
0
        private static bool HandleFraqBootSingle(SCPKG_FRAPBOOT_SINGLE fbi)
        {
            CSDT_FRAPBOOT_INFO fbid = CSDT_FRAPBOOT_INFO.New();
            int usedSize            = 0;

            return(((fbid.unpack(ref fbi.szInfoBuff, fbi.wLen, ref usedSize, 0) == TdrError.ErrorType.TDR_NO_ERROR) && (usedSize > 0)) && Singleton <FrameWindow> .GetInstance().SetFrqWin(fbid));
        }
Esempio n. 2
0
 private void ParseVideoPackage()
 {
     while (this._buffRecvSize > 0u)
     {
         int   num   = 0;
         CSPkg cSPkg = CSPkg.New();
         if (cSPkg.unpack(ref this._recvBuff, (int)this._buffRecvSize, ref num, 0u) != null || num <= 0 || num > (int)this._buffRecvSize)
         {
             break;
         }
         if (cSPkg.stPkgHead.dwMsgID == 1035u)
         {
             SCPKG_FRAPBOOTINFO stFrapBootInfo = cSPkg.stPkgData.get_stFrapBootInfo();
             for (int i = 0; i < (int)stFrapBootInfo.bSpareNum; i++)
             {
                 SCPKG_FRAPBOOT_SINGLE sCPKG_FRAPBOOT_SINGLE = stFrapBootInfo.astSpareFrap[i];
                 CSDT_FRAPBOOT_INFO    cSDT_FRAPBOOT_INFO    = CSDT_FRAPBOOT_INFO.New();
                 int num2 = 0;
                 if (cSDT_FRAPBOOT_INFO.unpack(ref sCPKG_FRAPBOOT_SINGLE.szInfoBuff, (int)sCPKG_FRAPBOOT_SINGLE.wLen, ref num2, 0u) == null && num2 > 0)
                 {
                     this._maxFrameNo = cSDT_FRAPBOOT_INFO.dwKFrapsNo;
                     this._pkgQueue.Enqueue(cSDT_FRAPBOOT_INFO);
                 }
             }
         }
         else
         {
             this._pkgQueue.Enqueue(cSPkg);
         }
         this._buffRecvSize -= (uint)num;
         Buffer.BlockCopy(this._recvBuff, num, this._recvBuff, 0, (int)this._buffRecvSize);
     }
 }
Esempio n. 3
0
 private void ParseVideoPackage()
 {
     while (this._buffRecvSize > 0)
     {
         int   usedSize = 0;
         CSPkg item     = CSPkg.New();
         if (((item.unpack(ref this._recvBuff, (int)this._buffRecvSize, ref usedSize, 0) != TdrError.ErrorType.TDR_NO_ERROR) || (usedSize <= 0)) || (usedSize > this._buffRecvSize))
         {
             break;
         }
         if (item.stPkgHead.dwMsgID == 0x40b)
         {
             SCPKG_FRAPBOOTINFO stFrapBootInfo = item.stPkgData.stFrapBootInfo;
             for (int i = 0; i < stFrapBootInfo.bSpareNum; i++)
             {
                 SCPKG_FRAPBOOT_SINGLE scpkg_frapboot_single = stFrapBootInfo.astSpareFrap[i];
                 CSDT_FRAPBOOT_INFO    csdt_frapboot_info    = CSDT_FRAPBOOT_INFO.New();
                 int num3 = 0;
                 if ((csdt_frapboot_info.unpack(ref scpkg_frapboot_single.szInfoBuff, scpkg_frapboot_single.wLen, ref num3, 0) == TdrError.ErrorType.TDR_NO_ERROR) && (num3 > 0))
                 {
                     this._maxFrameNo = csdt_frapboot_info.dwKFrapsNo;
                     this._pkgQueue.Enqueue(csdt_frapboot_info);
                 }
             }
         }
         else
         {
             this._pkgQueue.Enqueue(item);
         }
         this._buffRecvSize -= (uint)usedSize;
         Buffer.BlockCopy(this._recvBuff, usedSize, this._recvBuff, 0, (int)this._buffRecvSize);
     }
 }
Esempio n. 4
0
        private static bool HandleFraqBootSingle(SCPKG_FRAPBOOT_SINGLE fbi)
        {
            CSDT_FRAPBOOT_INFO cSDT_FRAPBOOT_INFO = CSDT_FRAPBOOT_INFO.New();
            int num = 0;

            return(cSDT_FRAPBOOT_INFO.unpack(ref fbi.szInfoBuff, (int)fbi.wLen, ref num, 0u) == null && num > 0 && Singleton <FrameWindow> .GetInstance().SetFrqWin(cSDT_FRAPBOOT_INFO));
        }
Esempio n. 5
0
 private bool LoadMsg(out CSPkg replayMsg, out CSDT_FRAPBOOT_INFO fraqBoot)
 {
     replayMsg = null;
     fraqBoot  = null;
     try
     {
         if (this.isReplayAbc)
         {
             if ((this.replayStream == null) || (this.replayStream.Position >= this.replayStream.Length))
             {
                 return(false);
             }
             short num  = this.replayReader.ReadInt16();
             bool  flag = num > 0;
             num = Math.Abs(num);
             if ((this.replayStream.Position + num) > this.replayStream.Length)
             {
                 return(false);
             }
             if (this.replayReader.Read(this.streamBuffer, 0, num) != num)
             {
                 return(false);
             }
             int usedSize = 0;
             if (flag)
             {
                 fraqBoot = CSDT_FRAPBOOT_INFO.New();
                 if (fraqBoot.unpack(ref this.streamBuffer, num, ref usedSize, 0) != TdrError.ErrorType.TDR_NO_ERROR)
                 {
                     return(false);
                 }
             }
             else
             {
                 replayMsg = CSPkg.New();
                 if (replayMsg.unpack(ref this.streamBuffer, num, ref usedSize, 0) != TdrError.ErrorType.TDR_NO_ERROR)
                 {
                     return(false);
                 }
             }
         }
         else
         {
             if ((this.bufferUsedSize > 0) || ((this.replayStream != null) && (this.replayStream.Position < this.replayStream.Length)))
             {
                 if ((this.replayStream != null) && (this.replayStream.Position < this.replayStream.Length))
                 {
                     this.bufferUsedSize += this.replayReader.Read(this.streamBuffer, this.bufferUsedSize, this.streamBuffer.Length - this.bufferUsedSize);
                 }
                 replayMsg = CSPkg.New();
                 int num4 = 0;
                 if (((replayMsg.unpack(ref this.streamBuffer, this.bufferUsedSize, ref num4, 0) == TdrError.ErrorType.TDR_NO_ERROR) && (0 < num4)) && (num4 <= this.bufferUsedSize))
                 {
                     this.bufferUsedSize -= num4;
                     Buffer.BlockCopy(this.streamBuffer, num4, this.streamBuffer, 0, this.bufferUsedSize);
                     return(true);
                 }
             }
             return(false);
         }
     }
     catch
     {
         return(false);
     }
     if (this.replayStream.Position >= this.replayStream.Length)
     {
         this.ClearReplay();
     }
     return(true);
 }
        private bool LoadMsg(out CSPkg replayMsg, out CSDT_FRAPBOOT_INFO fraqBoot)
        {
            replayMsg = null;
            fraqBoot  = null;
            try
            {
                if (this.isReplayAbc)
                {
                    if (this.replayStream == null || this.replayStream.get_Position() >= this.replayStream.get_Length())
                    {
                        bool flag   = false;
                        bool result = flag;
                        return(result);
                    }
                    short num   = this.replayReader.ReadInt16();
                    bool  flag2 = num > 0;
                    num = Math.Abs(num);
                    if (this.replayStream.get_Position() + (long)num > this.replayStream.get_Length())
                    {
                        bool flag3  = false;
                        bool result = flag3;
                        return(result);
                    }
                    int num2 = this.replayReader.Read(this.streamBuffer, 0, (int)num);
                    if (num2 != (int)num)
                    {
                        bool flag4  = false;
                        bool result = flag4;
                        return(result);
                    }
                    int num3 = 0;
                    if (flag2)
                    {
                        fraqBoot = CSDT_FRAPBOOT_INFO.New();
                        if (fraqBoot.unpack(ref this.streamBuffer, (int)num, ref num3, 0u) != TdrError.ErrorType.TDR_NO_ERROR)
                        {
                            bool flag5  = false;
                            bool result = flag5;
                            return(result);
                        }
                    }
                    else
                    {
                        replayMsg = CSPkg.New();
                        if (replayMsg.unpack(ref this.streamBuffer, (int)num, ref num3, 0u) != TdrError.ErrorType.TDR_NO_ERROR)
                        {
                            bool flag6  = false;
                            bool result = flag6;
                            return(result);
                        }
                    }
                }
                else
                {
                    bool result;
                    bool flag7;
                    if (this.bufferUsedSize <= 0 && (this.replayStream == null || this.replayStream.get_Position() >= this.replayStream.get_Length()))
                    {
                        flag7  = false;
                        result = flag7;
                        return(result);
                    }
                    if (this.replayStream != null && this.replayStream.get_Position() < this.replayStream.get_Length())
                    {
                        this.bufferUsedSize += this.replayReader.Read(this.streamBuffer, this.bufferUsedSize, this.streamBuffer.Length - this.bufferUsedSize);
                    }
                    replayMsg = CSPkg.New();
                    int num4 = 0;
                    if (replayMsg.unpack(ref this.streamBuffer, this.bufferUsedSize, ref num4, 0u) == TdrError.ErrorType.TDR_NO_ERROR && 0 < num4 && num4 <= this.bufferUsedSize)
                    {
                        this.bufferUsedSize -= num4;
                        Buffer.BlockCopy(this.streamBuffer, num4, this.streamBuffer, 0, this.bufferUsedSize);
                        flag7  = true;
                        result = flag7;
                        return(result);
                    }
                    Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Download_VersionNotMatch"), false, 1.5f, null, new object[0]);

                    flag7  = false;
                    result = flag7;
                    return(result);
                }
            }
            catch
            {
                Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Download_VersionNotMatch"), false, 1.5f, null, new object[0]);

                bool flag8  = false;
                bool result = flag8;
                return(result);
            }
            if (this.replayStream.get_Position() >= this.replayStream.get_Length())
            {
                this.ClearReplay();
            }
            return(true);
        }
Esempio n. 7
0
 private bool LoadMsg(out CSPkg replayMsg, out CSDT_FRAPBOOT_INFO fraqBoot)
 {
     replayMsg = null;
     fraqBoot  = null;
     try
     {
         if (this.isReplayAbc)
         {
             if (this.replayStream == null || this.replayStream.get_Position() >= this.replayStream.get_Length())
             {
                 bool result = false;
                 return(result);
             }
             short num  = this.replayReader.ReadInt16();
             bool  flag = num > 0;
             num = Math.Abs(num);
             if (this.replayStream.get_Position() + (long)num > this.replayStream.get_Length())
             {
                 bool result = false;
                 return(result);
             }
             int num2 = this.replayReader.Read(this.streamBuffer, 0, (int)num);
             if (num2 != (int)num)
             {
                 bool result = false;
                 return(result);
             }
             int num3 = 0;
             if (flag)
             {
                 fraqBoot = CSDT_FRAPBOOT_INFO.New();
                 if (fraqBoot.unpack(ref this.streamBuffer, (int)num, ref num3, 0u) != null)
                 {
                     bool result = false;
                     return(result);
                 }
             }
             else
             {
                 replayMsg = CSPkg.New();
                 if (replayMsg.unpack(ref this.streamBuffer, (int)num, ref num3, 0u) != null)
                 {
                     bool result = false;
                     return(result);
                 }
             }
         }
         else
         {
             bool result;
             if (this.bufferUsedSize <= 0 && (this.replayStream == null || this.replayStream.get_Position() >= this.replayStream.get_Length()))
             {
                 result = false;
                 return(result);
             }
             if (this.replayStream != null && this.replayStream.get_Position() < this.replayStream.get_Length())
             {
                 this.bufferUsedSize += this.replayReader.Read(this.streamBuffer, this.bufferUsedSize, this.streamBuffer.Length - this.bufferUsedSize);
             }
             replayMsg = CSPkg.New();
             int num4 = 0;
             if (replayMsg.unpack(ref this.streamBuffer, this.bufferUsedSize, ref num4, 0u) == null && 0 < num4 && num4 <= this.bufferUsedSize)
             {
                 this.bufferUsedSize -= num4;
                 Buffer.BlockCopy(this.streamBuffer, num4, this.streamBuffer, 0, this.bufferUsedSize);
                 result = true;
                 return(result);
             }
             result = false;
             return(result);
         }
     }
     catch
     {
         bool result = false;
         return(result);
     }
     if (this.replayStream.get_Position() >= this.replayStream.get_Length())
     {
         this.ClearReplay();
     }
     return(true);
 }