private static CkanMod CreateMod(IArchiveEntry archiveEntry) { var mod = new CkanMod { ArchivePath = archiveEntry.FilePath, Name = GetDirectoryName(archiveEntry.FilePath) }; Messenger.AddInfo($"Mod \"{mod.Name}\" created from \"{archiveEntry.FilePath}\""); return(mod); }
private static CkanModInfo CreateModInfos(IArchiveEntry archiveEntry, CkanMod ckanMod) { var ms = new MemoryStream(); archiveEntry.WriteTo(ms); ms.Position = 0; using (var sr = new StreamReader(ms)) { var content = sr.ReadToEnd(); var modInfos = JsonConvert.DeserializeObject <CkanModInfo>(content); Messenger.AddInfo($"ModInfos \"{modInfos.name}\"-\"{modInfos.version}\" created from \"{archiveEntry.FilePath}\""); modInfos.Mod = ckanMod; modInfos.version = NormalizeVersion(modInfos.version); return(modInfos); } }