Ejemplo n.º 1
0
        //string SourceName { get { return _source.Name; } }
        //string DestinationName { get { return _target.Name; } }
        #endregion //IGameTransfer Implementation


        public void RunPreProcessing()
        {
            if (_preProcessComplete == false)
            {
                Status     = Interfaces.TransferStatus.Preparing;
                _startTime = DateTime.UtcNow;

                Utils.Logging.Logger.InfoFormat("Beginning {1} of {0}.", Application.GameName, this.TransferType.ToLower());
                string appId = Application.AppId;
                (Application as SteamApp)?.MeasureDiskSize();
                //Create the directory structure
                try
                {
                    var  directories           = _source.GetDirectoriesForApp(appId);
                    bool acceptCompressedFiles = ((_target is SteamArchive) && ((SteamArchive)_target).CompressNewGames);
                    _workQueue = new Queue <Tuple <string, long> >(_source.GetFilesForApp(appId, acceptCompressedFiles));

                    if (_workQueue.Any())
                    {
                        _target.BackupExistingDir(Application.InstallDir);
                    }
                    _target.CreateDirectories(directories);
                }
                catch (System.IO.DirectoryNotFoundException)
                {
                    _workQueue = new Queue <Tuple <string, long> >();
                }    //If the directory isn't present then allow the acf to move

                _fileCount = _workQueue.Count;
                DoPreProcess();
                _preProcessComplete = true;
            }
        }
Ejemplo n.º 2
0
        //string SourceName { get { return _source.Name; } }
        //string DestinationName { get { return _target.Name; } }
        #endregion //IGameTransfer Implementation


        public void RunPreProcessing()
        {
            if (_preProcessComplete == false)
            {
                Status     = Interfaces.TransferStatus.Preparing;
                _startTime = DateTime.UtcNow;

                Utils.Logging.Logger.InfoFormat("Beginning {1} of {0}.", Application.GameName, this.TransferType.ToLower());
                string appId = Application.AppId;
                (Application as SteamApp)?.MeasureDiskSize();
                //Create the directory structure
                _target.BackupExistingDir(Application.InstallDir);
                _target.CreateDirectories(_source.GetDirectoriesForApp(appId));
                bool acceptCompressedFiles = ((_target is SteamArchive) && ((SteamArchive)_target).CompressNewGames);
                _workQueue = new Queue <string>(_source.GetFilesForApp(appId, acceptCompressedFiles));
                _fileCount = _workQueue.Count;
                DoPreProcess();
                _preProcessComplete = true;
            }
        }