Beispiel #1
0
        /// <summary>
        /// DL開始
        /// </summary>
        public ILoadProcess Start(IJobEngine engine, IAccessLocation srcLocation, ICriFileData data)
        {
            //	アクセス先
            //	現在進行系
            if (engine.HasRequest(data.Identifier))
            {
                //	完了するまで待つ
                return(WaitLoadProcess.Wait(m_dlRequestDict, (dict) => dict[data.Identifier]));
            }

            //	保存先
            var dstLocation = m_storage.ToLocation(data.Path);

            //	同時リクエスト対応
            m_dlRequestDict[data.Identifier] = false;

            var job = DoRequest(engine, srcLocation, dstLocation, data);

            return(new LoadProcess <FileInfo>(
                       job,
                       file =>
            {
                if (GetSuccessDL?.Invoke(data, file) ?? false)
                {
                    //	上書き
                    OnInstalled?.Invoke(data);
                    //	リクエスト完了とする
                    m_dlRequestDict[data.Identifier] = true;
                }
            }, onError: code => DoError(code)));
        }
Beispiel #2
0
        /// <summary>
        /// リクエスト
        /// </summary>
        private ILoadJob <FileInfo> DoRequest(IJobEngine engine, IAccessLocation src, IAccessLocation dst, ICriFileData data)
        {
            var job = WRDL.GetFileDL(data.Identifier, src, dst, data.Size);

            engine.Enqueue(job);

            return(job);
        }
Beispiel #3
0
        private ISoundLoadDatabase m_remoteDatabase = null;          //	データベース情報

        //=====================================
        //	プロパティ
        //=====================================

        //=====================================
        //	関数
        //=====================================
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public CriSoundFileManager(
            RuntimePlatform platform,
            SoundConfig config,
            IJobEngine engine,
            ISoundLoadDatabase database,
            IFileBuilder <CriVersionTable> builder,
            IErrorHandler handler
            ) : base(platform, config, engine, handler)
        {
            m_remoteDatabase = database;
            m_saveBuilder    = builder;
        }
Beispiel #4
0
        //===============================
        //  関数
        //===============================

        public DownloadProvider
        (
            ILoadDatabase loadDatabase,
            IStorageDatabase storageDatabase,
            IJobEngine dlEngine,
            IJobCreator jobCreator
        )
        {
            LoadDatabase    = loadDatabase;
            StorageDatabase = storageDatabase;
            JobEngine       = dlEngine;
            JobCreator      = jobCreator;
        }
Beispiel #5
0
        //=====================================
        //	プロパティ
        //=====================================

        //=====================================
        //	関数
        //=====================================
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public CriMovieFileManager(
            RuntimePlatform platform,
            MovieConfig config,
            IJobEngine engine,
            IMovieLoadDatabase database,
            IFileBuilder <CriVersionTable> builder,
            IErrorHandler handler
            ) : base(platform, config, engine, handler)
        {
            m_config         = config;
            m_saveBuilder    = builder;
            m_remoteDatabase = database;
        }
Beispiel #6
0
 protected virtual ILoadJob <T> AddJob <T>(IJobEngine engine, ILoadJob <T> job)
 {
     engine.Enqueue(job);
     return(job);
 }
Beispiel #7
0
 /// <summary>
 /// ローカルアセットバンドルオープン
 /// </summary>
 public ILoadJob <AssetBundle> OpenLocalBundle(IJobEngine engine, string identifier, IAccessLocation location, string hash, uint crc)
 {
     return(AddJob(engine, DoCreateLocalLoad(identifier, location, hash, crc)));
 }
Beispiel #8
0
 /// <summary>
 /// アセットバンドルDL
 /// </summary>
 public ILoadJob <FileInfo> FileDL(IJobEngine engine, string identifier, IAccessLocation source, IAccessLocation local, long size)
 {
     return(AddJob <FileInfo>(engine, DoCreateFileDL(identifier, source, local, size)));
 }
Beispiel #9
0
 /// <summary>
 /// テキスト取得リクエスト
 /// </summary>
 public ILoadJob <string> TextLoad(IJobEngine engine, string identifier, IAccessLocation location)
 {
     return(AddJob(engine, DoCreateTextLoad(identifier, location)));
 }
Beispiel #10
0
 /// <summary>
 /// 生データ取得リクエスト
 /// </summary>
 public ILoadJob <byte[]> BytesLoad(IJobEngine engine, string identifier, IAccessLocation location)
 {
     return(AddJob(engine, DoCreateBytesLoad(identifier, location)));
 }
Beispiel #11
0
 public HashController(IJobEngine jobEngine)
 {
     _jobEngine = jobEngine;
 }