public StateHistory Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); Name = ""; var xpos = io.Position; var count = (ushort)io.ReadBit(0x10); if (count == 0) { Unknown = io.ReadData(xLength - 0x10); } else { Name = io.ReadString(count); count = (ushort)io.ReadBit(0x10); var xl = io.Position - xpos; Hash = new byte[count]; if (count == 0) { Unknown = io.ReadData((int)(xLength - xl)); } else { io.Read(Hash, 0, count); } xl = io.Position - xpos; if (xl < xLength) { //var x1 = io.ReadBit2(0x18); var d = io.ReadData((int)(xLength - xl)); Console.WriteLine(BitConverter.ToString(d).Replace("-", "") + @" ==== > "); } } return(this); }
public StoreInventoryManager Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); StoreInventories = new StoreInventories(SStructure).Read(io); var x = xLength - Length; if (x > 0) { UnknownBitLength = io.ReadBit2(0x18); if (UnknownBitLength > 0) { UnknownData = io.ReadData(UnknownBitLength); } } return(this); }
public SaveDataStructure Read(DAIIO io) { byte[] xdm = io.ReadBytes(0x41, false); if (!xdm.MemCompare(DataMagic, 0)) { throw new Exception("Invalid Save Data Header!"); } SavedTime = io.ReadInt64().ToUnixTime(); ushort count = io.ReadUInt16(); SID = io.ReadString(count); GameVersion = io.ReadUInt16(); SaveVersion = io.ReadUInt16(); ProjectVersion = io.ReadUInt16(); BitstreamFeatures = io.ReadUInt16(); ChangeList = io.ReadUInt32(); count = io.ReadUInt16(); Level = io.ReadString(count); Difficulty = io.ReadUInt32(); BundleCount = io.ReadUInt16(); BundleList = new string[BundleCount]; for (int i = 0; i < BundleCount; i++) { count = io.ReadUInt16(); BundleList[i] = io.ReadString(count); } InclusionCount = io.ReadUInt16(); Inclusions = new Inclusion[InclusionCount]; for (int i = 0; i < InclusionCount; i++) { Inclusions[i] = new Inclusion().Read(io); } SubLevelInfoCount = io.ReadBit2(0xc); if (SubLevelInfoCount <= 0x40 && SubLevelInfoCount > 0) { SubLevelEntries = new SubLevelInfo[SubLevelInfoCount]; for (int i = 0; i < SubLevelInfoCount; i++) { SubLevelEntries[i] = new SubLevelInfo().Read(io); } } LevelChecksum = new byte[0x10]; for (int i = 0; i < 0x10; i++) { LevelChecksum[i] = (byte)io.ReadBit(0x8); } DLC = io.ReadBit2(0x14); EntityVersion = (short)io.ReadBit2(0x10); ProjectVersionContext = (short)io.ReadBit2(0x10); HasDebugInfo = io.ReadBoolean(); AgentTocBookmark = io.ReadBit2(0x1A); ClientDataBookmark = io.ReadBit2(0x1A); EntityContentLength = io.ReadBit2(0x20); /////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////UNFINISHED SECTION!!!!!///////////////////////////////// var xpos = io.Position; //////// EntityContent = new EntityData(this).Read(io); //////// tmpdata = io.ReadData((int)(EntityContentLength - (io.Position - xpos))); //////// ////////////////////////////////////////////////////////////////////////////////// SaveEntityComplexLength = io.ReadBit2(6); SaveEntityComplex = io.ReadData((int)SaveEntityComplexLength); SaveEntityBookmark = io.ReadBit2(0x1A); SaveEntity = new SaveEntity(this).Read(io); EntityMetaData = new EntityMeta(this).Read(io); AgentToc = new AgentToc().Read(io); //var xdio = new DAIIO(io.xbaseStream, io.Position, ClientDataLength) {IsBigEndian = true}; ClientData = new ClientAgent().Read(io); //io.Position += ClientDataLength; LastPartSeedLength = (int)(io.Length - io.Position); if (LastPartSeedLength > 0) { LastPartSeed = io.ReadBit2((uint)LastPartSeedLength); } return(this); }