예제 #1
0
        /// <summary>
        /// TODO: Do it better. Maybe download it from Depot and store somewhere.
        /// </summary>
        private Result CopyArmaKey()
        {
            var armaKeyPath = _fileSystem.Path.Join(_managerDirectory, KeysConstants.ArmaKey);
            var bikeyFile   = new BikeyFile(armaKeyPath, ArmaConstants.GameName);

            return(!_fileSystem.File.Exists(bikeyFile.Path)
                ? Result.Failure($"{KeysConstants.ArmaKey} not found in Manager directory.")
                : _keysCopier.CopyKeys(_keysDirectory, bikeyFile.AsList()));
        }
예제 #2
0
        public static BikeyFile CreateBikeyFileInFileSystem(
            this IFileSystem fileSystem,
            string directory,
            string fileName,
            string fileExtension = "bikey")
        {
            var fileNameWithExtension = fileSystem.Path.HasExtension(fileName)
                ? fileName
                : $"{fileName}.{fileExtension}";
            var filePath = fileSystem.Path.GetFullPath(
                fileSystem.Path.Join(directory, fileNameWithExtension));

            var bikeyFile = new BikeyFile(filePath);

            fileSystem.CreateFileInFileSystem(filePath);

            return(bikeyFile);
        }