예제 #1
0
        public void loadFromConfiguration(IConfigSource config)
        {
            m_defaultHomeLocX = (uint)config.Configs["StandAlone"].GetInt("default_location_x", 1000);
            m_defaultHomeLocY = (uint)config.Configs["StandAlone"].GetInt("default_location_y", 1000);

            var networkConfigSection = config.Configs["Network"];

            HostName         = networkConfigSection.GetString("hostname", Util.RetrieveListenAddress());
            HttpListenerPort = (uint)networkConfigSection.GetInt("http_listener_port", (int)ConfigSettings.DefaultRegionHttpPort);
            httpSSLPort      = (uint)networkConfigSection.GetInt("http_listener_sslport", ((int)ConfigSettings.DefaultRegionHttpPort + 1));
            HttpUsesSSL      = networkConfigSection.GetBoolean("http_listener_ssl", false);
            HttpSSLCN        = networkConfigSection.GetString("http_listener_cn", "localhost");
            HttpSSLCert      = networkConfigSection.GetString("http_listener_ssl_cert", string.Empty);
            if (string.IsNullOrWhiteSpace(HttpSSLCert))
            {
                HttpSSLCert = networkConfigSection.GetString("SSLCertFile", ConfigSettings.DefaultSSLPublicCertFile);
            }
            HttpSSLPassword = networkConfigSection.GetString("http_listener_ssl_passwd", String.Empty);
            useHTTPS        = networkConfigSection.GetBoolean("use_https", false);

            string sslproto = networkConfigSection.GetString("https_ssl_protocol", "Default");

            try
            {
                sslProtocol = (SslProtocols)Enum.Parse(typeof(SslProtocols), sslproto);
            }
            catch
            {
                sslProtocol = SslProtocols.Default;
            }

            ConfigSettings.DefaultRegionRemotingPort =
                (uint)networkConfigSection.GetInt("remoting_listener_port", (int)ConfigSettings.DefaultRegionRemotingPort);
            GridURL      = networkConfigSection.GetString("grid_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort.ToString());
            GridSendKey  = networkConfigSection.GetString("grid_send_key", "null");
            GridRecvKey  = networkConfigSection.GetString("grid_recv_key", "null");
            UserURL      = networkConfigSection.GetString("user_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString());
            UserSendKey  = networkConfigSection.GetString("user_send_key", "null");
            UserRecvKey  = networkConfigSection.GetString("user_recv_key", "null");
            AssetURL     = networkConfigSection.GetString("asset_server_url", AssetURL);
            InventoryURL = networkConfigSection.GetString("inventory_server_url",
                                                          "http://127.0.0.1:" +
                                                          ConfigSettings.DefaultInventoryServerHttpPort.ToString());
            secureInventoryServer = networkConfigSection.GetBoolean("secure_inventory_server", true);

            MessagingURL = networkConfigSection.GetString("messaging_server_url",
                                                          "http://127.0.0.1:" + ConfigSettings.DefaultMessageServerHttpPort);
        }