Пример #1
0
 public override void Uninitialize()
 {
     if (_prepareSessions != null)
     {
         for (int i = 0; i < _prepareSessions.Count; i++)
         {
             NetAssetSession session = _prepareSessions[i];
             session.StopSession();
             _prepareSessions[i] = session;
         }
         _prepareSessions.Clear();
     }
     this.RemoveTimer();
     if (_cachedNetAssetInfoSet != null)
     {
         //保存记录
         int offset = 0;
         _cachedNetAssetInfoSet.Write(S_Buffer, ref offset);
         if (!JW.Res.FileUtil.IsFileExist(S_CachedNetAssetInfoSetFileFullPath))
         {
             JW.Res.FileUtil.WriteFile(S_CachedNetAssetInfoSetFileFullPath, S_Buffer, 0, offset);
         }
         _cachedNetAssetInfoSet = null;
     }
 }
Пример #2
0
 public override bool Initialize()
 {
     _cachedNetAssetInfoSet = new NetAssetInfoSet();
     //
     if (!JW.Res.FileUtil.IsDirectoryExist(S_CachedNetAssetDirectory))
     {
         JW.Res.FileUtil.CreateDirectory(S_CachedNetAssetDirectory);
     }
     //
     if (JW.Res.FileUtil.IsFileExist(S_CachedNetAssetInfoSetFileFullPath))
     {
         byte[] data   = JW.Res.FileUtil.ReadFile(S_CachedNetAssetInfoSetFileFullPath);
         int    offset = 0;
         _cachedNetAssetInfoSet.Read(data, ref offset);
     }
     //
     JudageDiskSpace();
     //
     this.AddTimer(120000, true);
     return(true);
 }