public SkyrimSavegame Read(String label, FileStream fileStream) { br = new SkyrimBinaryReader(fileStream); char[] magic = br.ReadChars(13); UInt32 headerSize = br.ReadUInt32(); Print("magic", new string(magic)); Print("headerSize", headerSize); Header header = ReadHeader(); header.Print(); ReadScreenshot(header); byte formVersion = br.ReadByte(); //uint8 UInt32 pluginInfoSize = br.ReadUInt32(); Print("formVersion", formVersion); Print("pluginInfoSize", pluginInfoSize); //PluginInfo pluginInfo = ReadPluginInfo(); //skip pluginInfo br.ReadBytes((int)pluginInfoSize); FileLocationTable fileLocationTable = ReadFileLocationTable(); fileLocationTable.Print(); GlobalDataType[] globalDataTable1 = ReadGlobalDataTable(9); //Types 0 to 8. //GlobalDataType[] globalDataTable2 = ReadGlobalDataTable(15); //Types 100 to 114. SkyrimSavegame savegame = new SkyrimSavegame(label); savegame.header = header; savegame.formVersion = formVersion; savegame.fileLocationTable = fileLocationTable; savegame.globalDataTable1 = globalDataTable1; //savegame.globalDataTable2 = globalDataTable2; foreach (var ms in savegame.GetMiscStats().OrderBy(p => p.category).ThenBy(n => n.name)) { Print("stats", "cat({0}).{1} = {2}", ms.category, ms.name, ms.value); } return(savegame); }
private CharacterSnapshot ParseCharacterSnapshot(SkyrimSavegame savegame) { CharacterSnapshot snap = new CharacterSnapshot(); snap.Id = savegame.GetNumber(); snap.Label = savegame.GetLabel(); snap.SaveTime = savegame.GetSaveTime(); snap.Level = savegame.GetPlayerLevel(); snap.Location = savegame.GetPlayerLocation(); snap.StatisticValue = ParseStats(savegame); return(snap); }
public SkyrimSavegame Read(String label, FileStream fileStream) { br = new SkyrimBinaryReader(fileStream); char[] magic = br.ReadChars(13); UInt32 headerSize = br.ReadUInt32(); Print("magic", new string(magic)); Print("headerSize", headerSize); Header header = ReadHeader(); header.Print(); ReadScreenshot(header); byte formVersion = br.ReadByte(); //uint8 UInt32 pluginInfoSize = br.ReadUInt32(); Print("formVersion", formVersion); Print("pluginInfoSize", pluginInfoSize); //PluginInfo pluginInfo = ReadPluginInfo(); //skip pluginInfo br.ReadBytes((int) pluginInfoSize); FileLocationTable fileLocationTable = ReadFileLocationTable(); fileLocationTable.Print(); GlobalDataType[] globalDataTable1 = ReadGlobalDataTable(9); //Types 0 to 8. //GlobalDataType[] globalDataTable2 = ReadGlobalDataTable(15); //Types 100 to 114. SkyrimSavegame savegame = new SkyrimSavegame(label); savegame.header = header; savegame.formVersion = formVersion; savegame.fileLocationTable = fileLocationTable; savegame.globalDataTable1 = globalDataTable1; //savegame.globalDataTable2 = globalDataTable2; foreach (var ms in savegame.GetMiscStats().OrderBy(p => p.category).ThenBy(n => n.name)) { Print("stats", "cat({0}).{1} = {2}", ms.category, ms.name, ms.value); } return savegame; }
private StatisticValue[] ParseStats(SkyrimSavegame savegame) { List <StatisticValue> stats = new List <StatisticValue>(); var orderedMiscStats = savegame.GetMiscStats().OrderBy(p => p.category).ThenBy(n => n.name); foreach (var ms in orderedMiscStats) { StatisticValue sv = new StatisticValue(); StatisticCategoryType catType = (StatisticCategoryType)ms.category; sv.CategoryId = (int)catType; sv.Name = ms.name; sv.Value = ms.value; stats.Add(sv); } return(stats.ToArray()); }
public IEnumerable <SkyrimSavegame> Read(DirectoryInfo savePath) { List <SkyrimSavegame> savegames = new List <SkyrimSavegame>(); FileInfo[] files = savePath.GetFiles("*.ess"); foreach (var fileInfo in files) { if (fileInfo.Name.Contains("autosave") || fileInfo.Name.Contains("quicksave")) { continue; } Debug.Print("******* " + fileInfo.Name + "***********"); using (FileStream fs = fileInfo.Open(FileMode.Open)) { SkyrimSavegame sg = Read(fileInfo.Name, fs); savegames.Add(sg); } Debug.Print("************************************"); } return(savegames); }