Beispiel #1
0
        public override void OnBuildConnections()
        {
            base.OnBuildConnections();

            lock (Manifest)
            {
                foreach (XmlNode nodeServer in Manifest.SelectNodes("//servers/server"))
                {
                    string code = UtilsCore.HashSHA256(nodeServer.Attributes["name"].Value);

                    ConnectionInfo infoServer = Engine.Instance.GetConnectionInfo(code, this);

                    // Update info
                    infoServer.DisplayName  = TitleForDisplay + nodeServer.Attributes["name"].Value;
                    infoServer.ProviderName = nodeServer.Attributes["name"].Value;
                    infoServer.IpsEntry.Set(UtilsXml.XmlGetAttributeString(nodeServer, "ips_entry", ""));
                    infoServer.IpsExit.Set(UtilsXml.XmlGetAttributeString(nodeServer, "ips_exit", ""));
                    infoServer.CountryCode    = UtilsXml.XmlGetAttributeString(nodeServer, "country_code", "");
                    infoServer.Location       = UtilsXml.XmlGetAttributeString(nodeServer, "location", "");
                    infoServer.ScoreBase      = UtilsXml.XmlGetAttributeInt64(nodeServer, "scorebase", 0);
                    infoServer.Bandwidth      = UtilsXml.XmlGetAttributeInt64(nodeServer, "bw", 0);
                    infoServer.BandwidthMax   = UtilsXml.XmlGetAttributeInt64(nodeServer, "bw_max", 1);
                    infoServer.Users          = UtilsXml.XmlGetAttributeInt64(nodeServer, "users", 0);
                    infoServer.WarningOpen    = UtilsXml.XmlGetAttributeString(nodeServer, "warning_open", "");
                    infoServer.WarningClosed  = UtilsXml.XmlGetAttributeString(nodeServer, "warning_closed", "");
                    infoServer.SupportIPv4    = UtilsXml.XmlGetAttributeBool(nodeServer, "support_ipv4", false);
                    infoServer.SupportIPv6    = UtilsXml.XmlGetAttributeBool(nodeServer, "support_ipv6", false);
                    infoServer.SupportCheck   = UtilsXml.XmlGetAttributeBool(nodeServer, "support_check", false);
                    infoServer.OvpnDirectives = UtilsXml.XmlGetAttributeString(nodeServer, "openvpn_directives", "");
                }
            }

            RefreshModes();
        }
Beispiel #2
0
        public override void OnBuildConnections()
        {
            base.OnBuildConnections();

            lock (Manifest)
            {
                foreach (XmlNode nodeServer in Manifest.SelectNodes("//servers/server"))
                {
                    string code = UtilsCore.HashSHA256(nodeServer.Attributes["name"].Value);

                    string group = nodeServer.GetAttributeString("group", "");

                    XmlNode nodeServerGroup = Manifest.SelectSingleNode("//servers_groups/servers_group[@group=\"" + group + "\"]");

                    ConnectionInfo infoServer = Engine.Instance.GetConnectionInfo(code, this);

                    // Update info
                    infoServer.DisplayName  = TitleForDisplay + nodeServer.Attributes["name"].Value;
                    infoServer.ProviderName = nodeServer.Attributes["name"].Value;
                    infoServer.IpsEntry.Set(XmlGetServerAttributeString(nodeServer, nodeServerGroup, "ips_entry", ""));
                    infoServer.IpsExit.Set(XmlGetServerAttributeString(nodeServer, nodeServerGroup, "ips_exit", ""));
                    infoServer.CountryCode      = XmlGetServerAttributeString(nodeServer, nodeServerGroup, "country_code", "");
                    infoServer.Location         = XmlGetServerAttributeString(nodeServer, nodeServerGroup, "location", "");
                    infoServer.ScoreBase        = XmlGetServerAttributeInt64(nodeServer, nodeServerGroup, "scorebase", 0);
                    infoServer.Bandwidth        = XmlGetServerAttributeInt64(nodeServer, nodeServerGroup, "bw", 0);
                    infoServer.BandwidthMax     = XmlGetServerAttributeInt64(nodeServer, nodeServerGroup, "bw_max", 1);
                    infoServer.Users            = XmlGetServerAttributeInt64(nodeServer, nodeServerGroup, "users", 0);
                    infoServer.WarningOpen      = XmlGetServerAttributeString(nodeServer, nodeServerGroup, "warning_open", "");
                    infoServer.WarningClosed    = XmlGetServerAttributeString(nodeServer, nodeServerGroup, "warning_closed", "");
                    infoServer.SupportIPv4      = XmlGetServerAttributeBool(nodeServer, nodeServerGroup, "support_ipv4", false);
                    infoServer.SupportIPv6      = XmlGetServerAttributeBool(nodeServer, nodeServerGroup, "support_ipv6", false);
                    infoServer.SupportCheck     = XmlGetServerAttributeBool(nodeServer, nodeServerGroup, "support_check", false);
                    infoServer.OvpnDirectives   = XmlGetServerAttributeString(nodeServer, nodeServerGroup, "openvpn_directives", "");
                    infoServer.CiphersTls       = XmlGetServerAttributeString(nodeServer, nodeServerGroup, "ciphers_tls", "").StringToList(":");
                    infoServer.CiphersTlsSuites = XmlGetServerAttributeString(nodeServer, nodeServerGroup, "ciphers_tlssuites", "").StringToList(":");
                    infoServer.CiphersData      = XmlGetServerAttributeString(nodeServer, nodeServerGroup, "ciphers_data", "").StringToList(":");
                }
            }

            RefreshModes();
        }