* minor: slightly simplify code in setting up the default configuration
* we appear to both setup a default configuration and provude identical defaults when we later try to read the values - this is probably not really necessary0.6.0-stable
							parent
							
								
									4920e52f11
								
							
						
					
					
						commit
						0f77a334bd
					
				| 
						 | 
				
			
			@ -197,17 +197,20 @@ namespace OpenSim
 | 
			
		|||
            ReadConfigSettings();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Setup a default config values in case they aren't present in the ini file
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        public static IConfigSource DefaultConfig()
 | 
			
		||||
        {
 | 
			
		||||
            IConfigSource DefaultConfig = new IniConfigSource();
 | 
			
		||||
            if (DefaultConfig.Configs["Startup"] == null)
 | 
			
		||||
            {
 | 
			
		||||
                DefaultConfig.AddConfig("Startup");
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            IConfig config = DefaultConfig.Configs["Startup"];
 | 
			
		||||
            if (config != null)
 | 
			
		||||
            {
 | 
			
		||||
                IConfig config = DefaultConfig.Configs["Startup"];
 | 
			
		||||
                
 | 
			
		||||
                if (null == config)
 | 
			
		||||
                    config = DefaultConfig.AddConfig("Startup");
 | 
			
		||||
 | 
			
		||||
                config.Set("gridmode", false);
 | 
			
		||||
                config.Set("physics", "basicphysics");
 | 
			
		||||
                config.Set("physical_prim", true);
 | 
			
		||||
| 
						 | 
				
			
			@ -225,14 +228,12 @@ namespace OpenSim
 | 
			
		|||
                config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
 | 
			
		||||
            }
 | 
			
		||||
        
 | 
			
		||||
            if (DefaultConfig.Configs["StandAlone"] == null)
 | 
			
		||||
            {
 | 
			
		||||
                DefaultConfig.AddConfig("StandAlone");
 | 
			
		||||
            }
 | 
			
		||||
                IConfig config = DefaultConfig.Configs["StandAlone"];
 | 
			
		||||
                
 | 
			
		||||
                if (null == config)
 | 
			
		||||
                    config = DefaultConfig.AddConfig("StandAlone");
 | 
			
		||||
 | 
			
		||||
            config = DefaultConfig.Configs["StandAlone"];
 | 
			
		||||
            if (config != null)
 | 
			
		||||
            {
 | 
			
		||||
                config.Set("accounts_authenticate", false);
 | 
			
		||||
                config.Set("welcome_message", "Welcome to OpenSimulator");
 | 
			
		||||
                config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll");
 | 
			
		||||
| 
						 | 
				
			
			@ -244,14 +245,12 @@ namespace OpenSim
 | 
			
		|||
                config.Set("dump_assets_to_file", false);
 | 
			
		||||
            }
 | 
			
		||||
        
 | 
			
		||||
            if (DefaultConfig.Configs["Network"] == null)
 | 
			
		||||
            {
 | 
			
		||||
                DefaultConfig.AddConfig("Network");
 | 
			
		||||
            }
 | 
			
		||||
                IConfig config = DefaultConfig.Configs["Network"];
 | 
			
		||||
                
 | 
			
		||||
                if (null == config)
 | 
			
		||||
                    config = DefaultConfig.AddConfig("Network");
 | 
			
		||||
 | 
			
		||||
            config = DefaultConfig.Configs["Network"];
 | 
			
		||||
            if (config != null)
 | 
			
		||||
            {
 | 
			
		||||
                config.Set("default_location_x", 1000);
 | 
			
		||||
                config.Set("default_location_y", 1000);
 | 
			
		||||
                config.Set("http_listener_port", NetworkServersInfo.DefaultHttpListenerPort);
 | 
			
		||||
| 
						 | 
				
			
			@ -267,25 +266,21 @@ namespace OpenSim
 | 
			
		|||
                config.Set("secure_inventory_server", "true");
 | 
			
		||||
            }
 | 
			
		||||
        
 | 
			
		||||
            if (DefaultConfig.Configs["RemoteAdmin"] == null)
 | 
			
		||||
            {
 | 
			
		||||
                DefaultConfig.AddConfig("RemoteAdmin");
 | 
			
		||||
            }
 | 
			
		||||
                IConfig config = DefaultConfig.Configs["RemoteAdmin"];
 | 
			
		||||
                
 | 
			
		||||
                if (null == config)
 | 
			
		||||
                    config = DefaultConfig.AddConfig("RemoteAdmin");
 | 
			
		||||
 | 
			
		||||
            config = DefaultConfig.Configs["RemoteAdmin"];
 | 
			
		||||
            if (config != null)
 | 
			
		||||
            {
 | 
			
		||||
                config.Set("enabled", "false");
 | 
			
		||||
            }
 | 
			
		||||
        
 | 
			
		||||
            if (DefaultConfig.Configs["Voice"] == null)
 | 
			
		||||
            {
 | 
			
		||||
                DefaultConfig.AddConfig("Voice");
 | 
			
		||||
            }
 | 
			
		||||
                IConfig config = DefaultConfig.Configs["Voice"];
 | 
			
		||||
                
 | 
			
		||||
                if (null == config)
 | 
			
		||||
                    config = DefaultConfig.AddConfig("Voice");
 | 
			
		||||
 | 
			
		||||
            config = DefaultConfig.Configs["Voice"];
 | 
			
		||||
            if (config != null)
 | 
			
		||||
            {
 | 
			
		||||
                config.Set("enabled", "false");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue