コード例 #1
0
        private void ReadLocal()
        {
            TextAsset txt = CoreEntry.gResLoader.LoadTextAsset("Data/Bulletin", SenLib.AssetType.Csv);

            if (null != txt)
            {
                mData = txt.text;
                if (!string.IsNullOrEmpty(mData))
                {
                    string md5Code = Md5Tool.Md5Sum(mData);
                    string oldCode = PlayerPrefs.GetString("NotieMd5", "");
                    isNew = !md5Code.Equals(oldCode);
                    PlayerPrefs.SetString("NotieMd5", md5Code);
                }
                else
                {
                    isNew = false;
                    PlayerPrefs.SetString("NotieMd5", "");
                }
            }
            else
            {
                isNew = false;
                PlayerPrefs.SetString("NotieMd5", "");
            }
        }
コード例 #2
0
        public void WriteBulletin(string content)
        {
            string md5Code = "";

            if (content.StartsWith(BundleCommon.BaseUrl + "\r\n"))
            {
                mData   = content.Replace(BundleCommon.BaseUrl + "\r\n", "");
                md5Code = Md5Tool.Md5Sum(mData);
            }
            else if (content.StartsWith(BundleCommon.BaseUrl + "\n"))
            {
                mData   = content.Replace(BundleCommon.BaseUrl + "\n", "");
                md5Code = Md5Tool.Md5Sum(mData);
            }
            else if (content.StartsWith(BundleCommon.BaseUrl + "\r"))
            {
                mData   = content.Replace(BundleCommon.BaseUrl + "\r", "");
                md5Code = Md5Tool.Md5Sum(mData);
            }

            string oldCode = PlayerPrefs.GetString("NotieMd5", "");

            if (string.IsNullOrEmpty(md5Code))
            {
                isNew = false;
                PlayerPrefs.SetString("NotieMd5", "");
            }
            else
            {
                isNew = !md5Code.Equals(oldCode);
                PlayerPrefs.SetString("NotieMd5", md5Code);
            }
        }