void ReadRawData() { MemoryStream stream = new MemoryStream(RawData); BinaryReader reader = new BinaryReader(stream, Encoding.UTF8); // Read Version - must be 0x126 Version = reader.ReadInt32(); if (Version != VersionNumber) { throw new Exception("SaveTree file has an invalid version number, must be 0x126."); } // Read character position. A character position record later in the file (record type 0x04) is used for positioning the player, not this. // Currently not clear what classic uses this one for. CharacterPosition = new HeaderCharacterPositionRecord(); CharacterPosition.Position = SaveTree.ReadPosition(reader); // Read MapID MapID = reader.ReadUInt16(); // Read Environment Environment = reader.ReadByte(); reader.Close(); }
void ReadRawData() { MemoryStream stream = new MemoryStream(RawData); BinaryReader reader = new BinaryReader(stream, Encoding.UTF8); // Read Version - must be 0x126 Version = reader.ReadInt32(); if (Version != VersionNumber) { throw new Exception("SaveTree file has an invalid version number, must be 0x126."); } // Read CharacterPosition.Position CharacterPosition = new HeaderCharacterPositionRecord(); CharacterPosition.Position = SaveTree.ReadPosition(reader); // Read MapID MapID = reader.ReadUInt16(); // Read Environment Environment = reader.ReadByte(); reader.Close(); }