Ejemplo n.º 1
0
        public override void Enter(object param)
        {
            m_DownloadInfo = param as DownloadInfo;
            if (m_DownloadInfo == null)
            {
                return;
            }

            // 设置回调
            Engine.HttpDownload.Instance().SetDownloadCallback(OnDownFinish, OnDownProgress);
            // 下载文件
            Log.Trace("DownloadFile {0}", m_DownloadInfo.strNewFileURL);
            Engine.HttpDownload.Instance().DownLoadFile(m_DownloadInfo.strNewFileURL, m_DownloadInfo.strDestFile);
        }
Ejemplo n.º 2
0
        //-------------------------------------------------------------------------------------------------------
        private void DownloadUpgradeFile()
        {
            if (string.IsNullOrEmpty(m_curVersion.m_strFileName))
            {
                return;
            }

            string       strDestFile = GetDownloadDir() + m_curVersion.m_strFileName;
            DownloadInfo info        = new DownloadInfo();

            info.strNewFileURL = m_curVersion.m_strFileUrl;
            info.strDestFile   = strDestFile;
            info.strMD5        = m_curVersion.m_strMD5;
            m_gameEntry.ChangeState(GameState.DownLoad, info);

            m_nResPackageRemain--;
        }