public void LoadInfo() { using (var zip = ZipFile) { var doc = ScribeUtil.LoadDocument(zip["info"].GetBytes()); info = DirectXmlToObject.ObjectFromXml <ReplayInfo>(doc.DocumentElement, true); } }
public bool LoadInfo() { using (var zip = ZipFile) { var infoFile = zip["info"]; if (infoFile == null) { return(false); } var doc = ScribeUtil.LoadDocument(infoFile.GetBytes()); info = DirectXmlToObject.ObjectFromXml <ReplayInfo>(doc.DocumentElement, true); } return(true); }
private static XmlDocument GetGameDocument(List <int> mapsToLoad) { XmlDocument gameDoc = ScribeUtil.LoadDocument(Multiplayer.session.dataSnapshot.gameData); XmlNode gameNode = gameDoc.DocumentElement["game"]; foreach (int map in mapsToLoad) { using XmlReader reader = XmlReader.Create(new MemoryStream(Multiplayer.session.dataSnapshot.mapData[map])); XmlNode mapNode = gameDoc.ReadNode(reader); gameNode["maps"].AppendChild(mapNode); if (gameNode["currentMapIndex"] == null) { gameNode.AddNode("currentMapIndex", map.ToString()); } } return(gameDoc); }