Exemplo n.º 1
0
    public IEnumerator DownloadNotice()
    {
        WWW d = new WWW(SystemConfig.GetCfgInfoUrl(SystemConfig.NOTICE_URL_KEY));

        Mogo.Util.LoggerHelper.Debug(SystemConfig.GetCfgInfoUrl(SystemConfig.NOTICE_URL_KEY));

        yield return(d);

        noticeXml = d.text;
        Mogo.Util.LoggerHelper.Debug(d.text);
#if UNITY_IPHONE
        //use native md5 interface
        string md5 = IOSUtils.FormatMD5(IOSUtils.CreateMD5(d.bytes));
#else
        string md5 = Utils.FormatMD5(Utils.CreateMD5(d.bytes));
#endif
        Mogo.Util.LoggerHelper.Debug("md5:" + md5);
        if (SystemConfig.Instance.noticeMd5 == md5 && SystemConfig.Instance.Passport == SystemConfig.Instance.PassportSeenNotice)
        {
            yield break;
        }
        SystemConfig.Instance.noticeMd5          = md5;
        SystemConfig.Instance.PassportSeenNotice = SystemConfig.Instance.Passport;
        SystemConfig.SaveConfig();
        if (DownloadFinished != null && !MogoWorld.BeginLogin)//如果开始登录了就不打开公告板
        {
            DownloadFinished();
        }
        IsDownloadFinished = true;
    }
Exemplo n.º 2
0
    /// <summary>
    /// 获取MD5
    /// </summary>
    private void GetContentMD5()
    {
#if UNITY_IPHONE
        //use native md5 interface
        defContentBytes = IOSUtils.CreateMD5(Encoding.UTF8.GetBytes(defContent));
#else
        defContentBytes = Mogo.Util.Utils.CreateMD5(Encoding.UTF8.GetBytes(defContent));
#endif
    }
Exemplo n.º 3
0
    public IEnumerator DownloadNotice()
    {
        string url = SystemConfig.GetCfgInfoUrl(SystemConfig.NOTICE_URL_KEY);

        if (url == string.Empty)
        {
            url = "http://192.168.20.107/mogo/notice.xml";
        }

        WWW d = new WWW(url);

        //Debug.Log("DownloadNotice() url="+url);

        yield return(d);

        noticeXml = d.text;
        //Debug.Log(d.text);
#if UNITY_IPHONE
        //use native md5 interface
        string md5 = IOSUtils.FormatMD5(IOSUtils.CreateMD5(d.bytes));
#else
        string md5 = Utils.FormatMD5(Utils.CreateMD5(d.bytes));
#endif
        //Debug.Log("md5:" + md5);
        if (SystemConfig.Instance.noticeMd5 == md5 && SystemConfig.Instance.Passport == SystemConfig.Instance.PassportSeenNotice)
        {
            yield break;
        }
        SystemConfig.Instance.noticeMd5          = md5;
        SystemConfig.Instance.PassportSeenNotice = SystemConfig.Instance.Passport;
        SystemConfig.SaveConfig();
        if (DownloadFinished != null && !MogoWorld.BeginLogin)//如果开始登录了就不打开公告板
        {
            DownloadFinished();
        }
        IsDownloadFinished = true;
    }