Exemplo n.º 1
0
        private static XmlNode decodeXml(String file)
        {
            if (!File.Exists(file))
            {
                throw new Exception("decodeXml: Can't find file to decode");
            }
            BxmlReader reader = new BxmlReader(file);

            return(reader.getFile().DocumentElement);
        }
Exemplo n.º 2
0
        public string Ping()
        {
            if (servers == null)
            {
                servers = new Dictionary <string, string>();

                //<scripts_config.xml>
                //  <login>
                //    <host>
                //      <name>WOT RU1</name>
                //      <url>login.p1.worldoftanks.net:20014</url>
                //      <public_key_path>loginapp_wot.pubkey</public_key_path>
                //      <periphery_id>	1	</periphery_id>
                //    </host>
                //    ...
                //  </login>
                //</scripts_config.xml>
                BxmlReader  reader = new BxmlReader("res\\scripts_config.xml");
                XmlNode     root   = reader.getFile().DocumentElement;
                XmlNodeList hosts  = root.SelectSingleNode("//login").ChildNodes;
                foreach (XmlNode node in hosts)
                {
                    if (node.Name != "host")
                    {
                        continue;
                    }
                    servers[node.SelectSingleNode("name").InnerText] = node.SelectSingleNode("url").InnerText;
                }
            }

            if (servers.Count == 0)
            {
                throw new Exception("No WoT servers found");
            }

            Thread thread = new Thread(PingAsync);

            thread.Start();

            lock (pingResultLock)
                return(pingResult);
        }
Exemplo n.º 3
0
    private static XmlNode decode(string file)
    {
        BxmlReader reader = new BxmlReader(file);

        return(reader.getFile().DocumentElement);
    }
Exemplo n.º 4
0
 private static XmlNode decodeXml(String file)
 {
     if (!File.Exists(file))
     {
         throw new Exception("decodeXml: Can't find file to decode");
     }
     BxmlReader reader = new BxmlReader(file);
     return reader.getFile().DocumentElement;
 }