Esempio n. 1
0
 public override void Update(ILoadJob job, JobEngine engine)
 {
     if (job == null)
     {
         engine.SetState(EngineStatus.Wait);
         return;
     }
     //	キャンセル時
     if (job.IsCanceled || job.IsDisposed)
     {
         engine.Refresh();
         engine.SetState(EngineStatus.Wait);
         return;
     }
     job.Update();
     //	エラー
     if (job.IsError)
     {
         engine.SetState(EngineStatus.Error);
         return;
     }
     //	完了
     if (job.IsCompleted)
     {
         engine.SetState(EngineStatus.Complete);
         return;
     }
 }
Esempio n. 2
0
        /// <summary>
        /// ローカルファイルを開く
        /// </summary>
        protected virtual ILoadProcess CreateLocalFileOpenJob(IRuntimeBundleData data)
        {
            if (JobEngine.HasRequest(data.Identifier))
            {
                //	リクエスト済みのモノは完了まで待つ
                return(WaitLoadProcess.Wait(data, (d) => d.IsOnMemory));
            }
            var location = StorageDatabase.GetSaveLocation(data);

            if (!File.Exists(location.FullPath))
            {
                OnError(ChipstarResult.ClientError($"Open File is Not Found. == {data.Identifier} for {location.ToString()}"));
                return(SkipLoadProcess.Create(data));
            }
            var job = JobCreator.OpenLocalBundle(JobEngine, data.Identifier, location, data.Hash, data.Crc);

            return(new LoadProcess <AssetBundle>(
                       AddJob(job),
                       onCompleted: (content) =>
            {
                data.OnMemory(content);
            },
                       onError: code => OnError(code)
                       ));
        }
Esempio n. 3
0
 public override void Update(ILoadJob job, JobEngine engine)
 {
     if (!engine.MoveNext())
     {
         return;
     }
     engine.SetState(EngineStatus.Running);
 }
Esempio n. 4
0
        //=====================================
        //	関数
        //=====================================

        public MultiLineJobEngine(int lineCount)
        {
            m_engineList = new JobEngine[lineCount];
            for (int i = 0; i < m_engineList.Length; i++)
            {
                m_engineList[i] = new JobEngine();
            }
        }
Esempio n. 5
0
        public void Dispose()
        {
            JobCreator.Dispose();
            JobEngine.Dispose();

            StorageDatabase = null;
            LoadDatabase    = null;
            JobCreator      = null;
            JobEngine       = null;

            OnDownloadError = null;
            OnStartAny      = null;
            OnStopAny       = null;
        }
Esempio n. 6
0
        /// <summary>
        /// ダウンロード
        /// </summary>
        protected virtual ILoadProcess CreateDowloadJob(IAccessLocation location, IRuntimeBundleData data)
        {
            if (JobEngine.HasRequest(data.Identifier))
            {
                //	リクエスト済みのモノは無視
                return(SkipLoadProcess.Create(location));
            }
            var localPath = StorageDatabase.GetSaveLocation(data);
            var job       = JobCreator.FileDL(JobEngine, data.Identifier, location, localPath, data.FileSize);

            return(new LoadProcess <FileInfo>(
                       AddJob(job),
                       onCompleted: (info) =>
            {
                //	バージョンを保存
                StorageDatabase.Save(data);
            },
                       onError: code => OnError(code)
                       ));
        }
Esempio n. 7
0
        public bool IsProcessing(string name)
        {
            var bundle = LoadDatabase.GetBundleData(name);

            return(JobEngine.HasRequest(bundle.Identifier));
        }
Esempio n. 8
0
 public void Cancel()
 {
     JobEngine?.Cancel();
 }
Esempio n. 9
0
 /// <summary>
 /// 更新処理
 /// </summary>
 public void DoUpdate()
 {
     JobEngine?.Update();
 }
Esempio n. 10
0
 public override void Begin(ILoadJob job, JobEngine engine)
 {
     job.Error();
     engine.Refresh();
 }
Esempio n. 11
0
 public virtual void End(ILoadJob job, JobEngine engine)
 {
 }
Esempio n. 12
0
 public virtual void Update(ILoadJob job, JobEngine engine)
 {
 }
Esempio n. 13
0
 /// <summary>
 /// 開始
 /// </summary>
 public virtual void Begin(ILoadJob job, JobEngine engine)
 {
 }
Esempio n. 14
0
 public override void Begin(ILoadJob job, JobEngine engine)
 {
     job.Run();
 }
Esempio n. 15
0
 public override void Update(ILoadJob job, JobEngine engine)
 {
     engine.SetState(EngineStatus.Wait);
 }