public FileSystemPreparedGiasRepository(string dataDirectory) { _dataDirectory = Path.Combine(dataDirectory, "gias"); _establishmentIndex = new VersionIndex <long>(_dataDirectory, "establishments-index"); _groupIndex = new VersionIndex <long>(_dataDirectory, "groups-index"); _localAuthorityIndex = new VersionIndex <int>(_dataDirectory, "local-authorities-index"); }
public static string GetAssetIndexName(VersionIndex versionIndex) { if (versionIndex.AssetIndex != null) { return($"{versionIndex.AssetIndex.Sha1}/{versionIndex.AssetIndex.Id}"); } return(versionIndex.Assets); }
public static string[] GetMinecraftArguments(VersionIndex index) { if (index.Arguments?.Game == null) { return(index.MinecraftArguments.Split(' ')); } var result = new List <string>(); foreach (var argToken in index.Arguments.Game) { if (argToken.Type == JTokenType.String) { result.Add(argToken.Value <string>()); } } return(result.ToArray()); }
private void AppendLibsInfo(VersionIndex vIndex, VersionDataIndex dIndex, List <DownloadTarget> list) { foreach (var libraryInfo in vIndex.Libraries) { if (!IndexTool.IsLibraryAllowed(libraryInfo)) { continue; } var relativePath = IndexTool.GetLibraryPath(libraryInfo); if (!dIndex.Libs.ContainsKey(relativePath)) { _log.Warn($"Data index does not contain library {libraryInfo.Name}"); continue; } var path = Path.Combine(_librariesPath, relativePath); var url = $"{_storeUrl}/libraries/{relativePath}"; var fileInfo = dIndex.Libs[relativePath]; list.Add(new DownloadTarget(path, url, fileInfo.Size, fileInfo.Hash)); } }
public CachedVersionInfo(VersionIndex version) { Id = version.Id; ReleaseTime = version.ReleaseTime; }
public static string GetAssetIndexPath(VersionIndex versionIndex) { return($"{GetAssetIndexName(versionIndex)}.json"); }
public FileSystemPreparedUkrlpRepository(string dataDirectory) { _dataDirectory = Path.Combine(dataDirectory, "ukrlp"); _providerIndex = new VersionIndex <long>(_dataDirectory, "providers-index"); }