Exemple #1
0
        private void WriteInvitedFriendDicToBinFile()
        {
            string     cachePath  = CFileManager.GetCachePath("invited_friend_02_" + Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID);
            FileStream fileStream = null;

            try
            {
                if (!CFileManager.IsFileExist(cachePath))
                {
                    fileStream = new FileStream(cachePath, 2, 2, 3);
                }
                else
                {
                    fileStream = new FileStream(cachePath, 5, 2, 3);
                }
                BinaryFormatter binaryFormatter = new BinaryFormatter();
                binaryFormatter.Serialize(fileStream, this.m_InvitedFriendDic);
                fileStream.Flush();
                fileStream.Close();
                fileStream.Dispose();
            }
            catch (Exception var_3_74)
            {
                if (fileStream != null)
                {
                    fileStream.Close();
                    fileStream.Dispose();
                }
            }
        }
Exemple #2
0
        private void ReadInvitedFriendDicFromBinFile()
        {
            string     cachePath  = CFileManager.GetCachePath("invited_friend_02_" + Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID);
            FileStream fileStream = null;

            if (!CFileManager.IsFileExist(cachePath))
            {
                return;
            }
            try
            {
                fileStream = new FileStream(cachePath, 3, 1, 0);
                BinaryFormatter binaryFormatter = new BinaryFormatter();
                this.m_InvitedFriendDic = (Dictionary <ulong, stInvitedFriend>)binaryFormatter.Deserialize(fileStream);
                fileStream.Close();
                fileStream.Dispose();
            }
            catch (Exception var_3_65)
            {
                if (fileStream != null)
                {
                    fileStream.Close();
                    fileStream.Dispose();
                }
            }
        }
Exemple #3
0
        private void WriteInvitedFriendDicToBinFile()
        {
            string     cachePath           = CFileManager.GetCachePath("invited_friend_02_" + Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID);
            FileStream serializationStream = null;

            try
            {
                if (!CFileManager.IsFileExist(cachePath))
                {
                    serializationStream = new FileStream(cachePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);
                }
                else
                {
                    serializationStream = new FileStream(cachePath, FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
                }
                new BinaryFormatter().Serialize(serializationStream, this.m_InvitedFriendDic);
                serializationStream.Flush();
                serializationStream.Close();
                serializationStream.Dispose();
            }
            catch (Exception)
            {
                if (serializationStream != null)
                {
                    serializationStream.Close();
                    serializationStream.Dispose();
                }
            }
        }
Exemple #4
0
        private void ReadInvitedFriendDicFromBinFile()
        {
            string     cachePath           = CFileManager.GetCachePath("invited_friend_02_" + Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID);
            FileStream serializationStream = null;

            if (CFileManager.IsFileExist(cachePath))
            {
                try
                {
                    serializationStream = new FileStream(cachePath, FileMode.Open, FileAccess.Read, FileShare.None);
                    BinaryFormatter formatter = new BinaryFormatter();
                    this.m_InvitedFriendDic = (Dictionary <ulong, stInvitedFriend>)formatter.Deserialize(serializationStream);
                    serializationStream.Close();
                    serializationStream.Dispose();
                }
                catch (Exception)
                {
                    if (serializationStream != null)
                    {
                        serializationStream.Close();
                        serializationStream.Dispose();
                    }
                }
            }
        }
 public static string GetIFSExtractPath()
 {
     if (CFileManager.s_ifsExtractPath == null)
     {
         CFileManager.s_ifsExtractPath = CFileManager.CombinePath(CFileManager.GetCachePath(), CFileManager.s_ifsExtractFolder);
     }
     return(CFileManager.s_ifsExtractPath);
 }
Exemple #6
0
 public void ShareActivityTask(string cdnUrl)
 {
     base.StartCoroutine(this.DownloadImage(cdnUrl, delegate(Texture2D text2)
     {
         string text3     = this.ToMD5(cdnUrl);
         string cachePath = CFileManager.GetCachePath(text3);
         MonoSingleton <ShareSys> .GetInstance().GShare("TimeLine/Qzone", cachePath);
     }, 0));
 }
        protected override void Init()
        {
            this.m_GlobalBannerImagePath = CFileManager.GetCachePath();
            string cachePath = CFileManager.GetCachePath("BannerImage");

            try
            {
                if (!Directory.Exists(cachePath))
                {
                    Directory.CreateDirectory(cachePath);
                }
                this.m_GlobalBannerImagePath = cachePath;
            }
            catch (Exception exception)
            {
                Debug.Log("bannerimagesys cannot create dictionary " + exception);
                this.m_GlobalBannerImagePath = CFileManager.GetCachePath();
            }
            this.m_DeepLinkInfo.bLoadSucc = false;
            this.m_QQBoxInfo.bLoadSucc    = false;
        }
 public static string GetCachePathWithHeader(string fileName)
 {
     return(CFileManager.GetLocalPathHeader() + CFileManager.GetCachePath(fileName));
 }
 public static string GetCachePath(string fileName)
 {
     return(CFileManager.CombinePath(CFileManager.GetCachePath(), fileName));
 }
 public bool ClearCachePath()
 {
     string[] fileExtensionFilter = new string[] { ".json", ".res", ".bytes", ".apk" };
     string[] folderFilter        = new string[] { CFileManager.s_ifsExtractFolder };
     return(CFileManager.ClearDirectory(CFileManager.GetCachePath(), fileExtensionFilter, folderFilter));
 }