Ejemplo n.º 1
0
    private void AddToLocalVersionConfigList(AssetFile elem)
    {
        VersionConfigElement element = new VersionConfigElement();

        element.Name = elem.Name;
        element.Sign = m_NameKeytoSignMap[elem.Name];
        m_LocalVersionConfig.VersionList.Add(element);
    }
Ejemplo n.º 2
0
    private void CompareVersion()
    {
        m_DownloadList.Clear();
        m_NameKeytoSignMap.Clear();

        m_LocalVersionConfig = ConfigManager.Instance.GetLocalVersionConfig();
        if (null == m_LocalVersionConfig || null == m_LocalVersionConfig.VersionList ||
            m_LocalVersionConfig.VersionList.Count == 0)
        {
            // download all
            for (int i = 0; i < m_RemoteVersionConfig.VersionList.Count; ++i)
            {
                AddToDownloadList(m_RemoteVersionConfig.VersionList[i]);
            }
            m_LocalVersionConfig             = new VersionConfig();
            m_LocalVersionConfig.VersionList = new List <VersionConfigElement>();
        }
        else
        {
            for (int i = 0; i < m_RemoteVersionConfig.VersionList.Count; ++i)
            {
                VersionConfigElement remElem = m_RemoteVersionConfig.VersionList[i];
                bool isExit = false;
                for (int j = 0; j < m_LocalVersionConfig.VersionList.Count; ++j)
                {
                    VersionConfigElement localElem = m_LocalVersionConfig.VersionList[j];
                    if (remElem.Name == localElem.Name)
                    {
                        isExit = true;
                        if (remElem.Sign != localElem.Sign)
                        {
                            AddToDownloadList(remElem);
                            //remove date-out
                            m_LocalVersionConfig.VersionList.RemoveAt(j);
                        }
                        break;
                    }
                }

                if (!isExit)
                {
                    AddToDownloadList(remElem);
                }
            }
        }
        if (m_DownloadList.Count > 0)
        {
            //begin download
            BeginDownload();
        }
        else
        {
            m_CompleteCallBack(true, "");
        }
    }
Ejemplo n.º 3
0
    private void AddToDownloadList(VersionConfigElement elem)
    {
        AssetFile downloadElem = new AssetFile(elem.Name, ConfigManager.Instance.GetConfigPath() + elem.Name,
                                               m_strRemoteAssetServerURL + elem.Name);

        m_DownloadList.Add(downloadElem);
        if (m_NameKeytoSignMap.ContainsKey(elem.Name))
        {
            m_CompleteCallBack(false, "");
            return;
        }
        else
        {
            m_NameKeytoSignMap.Add(elem.Name, elem.Sign);
        }
    }