/// <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))); }
/// <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); }
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; }
//=============================== // 関数 //=============================== public DownloadProvider ( ILoadDatabase loadDatabase, IStorageDatabase storageDatabase, IJobEngine dlEngine, IJobCreator jobCreator ) { LoadDatabase = loadDatabase; StorageDatabase = storageDatabase; JobEngine = dlEngine; JobCreator = jobCreator; }
//===================================== // プロパティ //===================================== //===================================== // 関数 //===================================== /// <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; }
protected virtual ILoadJob <T> AddJob <T>(IJobEngine engine, ILoadJob <T> job) { engine.Enqueue(job); return(job); }
/// <summary> /// ローカルアセットバンドルオープン /// </summary> public ILoadJob <AssetBundle> OpenLocalBundle(IJobEngine engine, string identifier, IAccessLocation location, string hash, uint crc) { return(AddJob(engine, DoCreateLocalLoad(identifier, location, hash, crc))); }
/// <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))); }
/// <summary> /// テキスト取得リクエスト /// </summary> public ILoadJob <string> TextLoad(IJobEngine engine, string identifier, IAccessLocation location) { return(AddJob(engine, DoCreateTextLoad(identifier, location))); }
/// <summary> /// 生データ取得リクエスト /// </summary> public ILoadJob <byte[]> BytesLoad(IJobEngine engine, string identifier, IAccessLocation location) { return(AddJob(engine, DoCreateBytesLoad(identifier, location))); }
public HashController(IJobEngine jobEngine) { _jobEngine = jobEngine; }