Пример #1
0
 public void LoadInfo()
 {
     using (var zip = ZipFile)
     {
         var doc = ScribeUtil.LoadDocument(zip["info"].GetBytes());
         info = DirectXmlToObject.ObjectFromXml <ReplayInfo>(doc.DocumentElement, true);
     }
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }