Example #1
0
 /// <summary>
 /// Nacte hodnoty ze souboru
 /// </summary>
 public static void Load()
 {
     if (Hodnoty == null)
     {
         return;
     }
     //nacte hodnoty
     Nini.Config.IConfigSource source = Ini.InitSoubor();
     foreach (Hodnota h in Hodnoty)
     {
         Nini.Config.IConfig config = source.Configs[h.Sekce];
         if (config == null)
         {
             config = source.AddConfig(h.Sekce);
         }
         if (config != null)
         {
             if (config.Contains(h.Jmeno))
             {
                 h.Refresh(config);
             }
             else
             {
                 config.Set(h.Jmeno, h.Value);
             }
         }
     }
 }
Example #2
0
 public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
 {
     if (windConfig != null)
     {
         if (windConfig.Contains("strength"))
         {
             m_strength = windConfig.GetFloat("strength", 1.0F);
         }
     }
 }
 public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
 {
     if (windConfig != null)
     {
         if (windConfig.Contains("strength"))
         {
             m_strength = windConfig.GetFloat("strength", 1.0f);
         }
         if (windConfig.Contains("damping"))
         {
             m_damping_rate = windConfig.GetFloat("damping", 0);
             if (m_damping_rate > 1.0f)
             {
                 m_damping_rate = 1.0f;
             }
         }
         if (windConfig.Contains("force"))
         {
             m_init_force = windConfig.GetInt("force", 0);
             if (m_init_force < 0 || m_init_force > 2)
             {
                 m_init_force = 0;
             }
         }
         //
         if (windConfig.Contains("region"))
         {
             m_region_size = windConfig.GetInt("region", 256);
             m_region_size = (((int)Math.Abs(m_region_size) + 255) / 256) * 256;
             if (m_region_size == 0)
             {
                 m_region_size = 256;
             }
         }
         if (scene != null)
         {
             m_region_size = (int)scene.RegionInfo.RegionSizeX;
         }
     }
 }
Example #4
0
        public void Initialize(ConfigSettings settings)
        {
            _settings = settings;

            Nini.Config.IConfig netConfig = settings.SettingsFile["Network"];
            if (netConfig != null && netConfig.Contains("asset_server_url"))
            {
                string url = netConfig.GetString("asset_server_url");
                this.SetupConnections(url);
            }
            else
            {
                throw new Exception("Network/asset_server_url is a required setting");
            }
        }
 public bool Contains(string key)
 {
     return(config.Contains(key));
 }