public static void LoadAllRooms() { const String root = @"D:\Games\Hellgate London\data\background\"; List<String> roomFiles = new List<String>(Directory.GetFiles(root, "*.rom", SearchOption.AllDirectories)); foreach (String roomFilePath in roomFiles) { String path = roomFilePath; //path = @"D:\Games\Hellgate London\data\background\city\charactercreate.rom"; //path = "D:\\Games\\Hellgate London\\data\\background\\props\\vehicles\\ambulance_a.rom"; byte[] roomFileBytes = File.ReadAllBytes(path); RoomDefinitionFile roomDefinitionFile = new RoomDefinitionFile(path, null, null); String fileName = path.Replace(@"D:\Games\Hellgate London\data\background\", ""); String xmlPath = path.Replace(RoomDefinitionFile.Extension, RoomDefinitionFile.ExtensionDeserialised); Console.WriteLine("Loading: " + fileName); try { roomDefinitionFile.ParseFileBytes(roomFileBytes); byte[] xmlBytes = roomDefinitionFile.ExportAsDocument(); File.WriteAllBytes(xmlPath, xmlBytes); XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(xmlPath); RoomDefinitionFile roomDefinitionFile2 = new RoomDefinitionFile(xmlPath); roomDefinitionFile2.ParseXmlDocument(xmlDocument); byte[] bytes = roomDefinitionFile2.ToByteArray(); if (!roomFileBytes.SequenceEqual(bytes)) { File.WriteAllBytes(path + "2", bytes); } } catch (Exception e) { Console.WriteLine("Failed to load file!\n" + e); continue; } } }