Example #1
0
 public override EReturn Save(Nini.Config.IConfig config)
 {
     base.Save(config);
     //Nini.Config.IConfig config = source.AddConfig("Zrada");
     if (config != null)
     {
         string s = "";
         foreach (MyString ss in Stin)
         {
             if (s == "")
             {
                 s = ss.String;
             }
             else
             {
                 s = s + "," + ss.String;
             }
         }
         config.Set("Stin", s);
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Example #2
0
 public override EReturn Load(Nini.Config.IConfig config)
 {
     base.Load(config);
     //Nini.Config.IConfig config = GetConfig(source, "Nepritel");
     if (config != null)
     {
         Ohrozeni  = config.GetInt("Ohrozeni");
         Stretnuti = config.GetInt("Stretnuti");
         Utok      = config.GetInt("Utok");
         Obrana    = config.GetInt("Obrana");
         Zivoty    = config.GetInt("Zivoty");
         string   s    = config.GetString("Stiny");
         string[] stin = s.Split(',');
         Stin = new List <MyString>();
         foreach (string ss in stin)
         {
             MyString ms = new MyString();
             ms.String = ss;
             Stin.Add(ms);
         }
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Example #3
0
        public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
        {
            _scene = scene;

            // Default to ground turbulence
            for (int y = 0; y < 16; y++)
            {
                for (int x = 0; x < 16; x++)
                {
                    m_options[y * 16 + x] = WindConstants.WindSpeedTurbulence;
                }
            }

            if (windConfig != null)
            {
                // Uses strength value if avg_strength not specified
                m_avgWindStrength = windConfig.GetFloat("strength", 5.0F);
                m_avgWindStrength = windConfig.GetFloat("avg_strength", 5.0F);

                m_avgWindDirection  = windConfig.GetFloat("avg_direction", 0.0F);
                m_varWindStrength   = windConfig.GetFloat("var_strength", 5.0F);
                m_varWindDirection  = windConfig.GetFloat("var_direction", 30.0F);
                m_rateChangeAloft   = windConfig.GetFloat("rate_change_aloft", 1.0f);
                m_rateChangeFlutter = windConfig.GetFloat("rate_change_flutter", 64.0f);

                LogSettings();
            }
        }
Example #4
0
 public override EReturn Save(Nini.Config.IConfig config)
 {
     base.Save(config);
     //Nini.Config.IConfig config = source.AddConfig("Nepritel");
     if (config != null)
     {
         config.Set("Ohrozeni", Ohrozeni);
         config.Set("Stretnuti", Stretnuti);
         config.Set("Utok", Utok);
         config.Set("Obrana", Obrana);
         config.Set("Zivoty", Zivoty);
         string s = "";
         foreach (MyString ss in Stin)
         {
             if (s == "")
             {
                 s = ss.String;
             }
             else
             {
                 s = s + "," + ss.String;
             }
         }
         config.Set("Stiny", s);
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Example #5
0
 /// <summary>
 /// Uloží Hodnoty
 /// </summary>
 public static void Save()
 {
     if (Hodnoty == null)
     {
         return;
     }
     Nini.Config.IConfigSource source = Ini.InitSoubor();
     source.Configs.Clear();
     foreach (Hodnota h in Hodnoty)
     {
         if (h != null)
         {
             Nini.Config.IConfig config = source.Configs[h.Sekce];
             if (config == null)
             {
                 config = source.AddConfig(h.Sekce);
             }
             if (config != null)
             {
                 config.Set(h.Jmeno, h.Value);
             }
         }
     }
     source.Save();
 }
Example #6
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 #7
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);
         }
     }
 }
Example #8
0
 public void Load(Nini.Config.IConfigSource source)
 {
     if (source.Configs.Contains("Druhy"))
     {
         Nini.Config.IConfig config = source.Configs["Druhy"];
         string   s  = config.GetString("Všechny druhy");
         string[] ss = s.Split(',');
         foreach (string sss in ss)
         {
             druhy.Add(sss);
         }
     }
 }
Example #9
0
 public override EReturn Save(Nini.Config.IConfig config)
 {
     base.Save(config);
     //Nini.Config.IConfig config = source.AddConfig("Udalost");
     if (config != null)
     {
         config.Set("Cena", Cena);
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Example #10
0
 public override EReturn Load(Nini.Config.IConfig config)
 {
     base.Load(config);
     //Nini.Config.IConfig config = GetConfig(source, "Udalost");
     if (config != null)
     {
         Cena = config.GetInt("Cena");
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Example #11
0
        public CommunicationHelpers(Nini.Config.IConfigSource config, String moduleName, String moduleVersion)
        {
            try {
                Nini.Config.IConfig startupConfig = config.Configs["OpenMetaverseEconomy"];
                m_gatewayEnvironment = startupConfig.GetString("OMBaseEnvironment", "TEST");
                m_initURL            = startupConfig.GetString("OMEconomyInitialize", String.Empty);
                m_gridShortName      = startupConfig.GetString("GridShortName", String.Empty);
                m_gridURL            = config.Configs["GridService"].GetString("GridServerURI", String.Empty);

                if (m_gridShortName == String.Empty || m_initURL == String.Empty)
                {
                    m_log.Error("[" + moduleName + "]: GridShortName or OMEconomyInitialize not set");
                    return;
                }

                                #if DEBUG
                m_log.Debug(String.Format("[OMECONOMY] getGatewayURL({0}, {1}, {2}, {3})", m_initURL, moduleName, moduleVersion, m_gatewayEnvironment));
                                #endif

                Dictionary <string, string> d = new Dictionary <string, string>();
                d.Add("moduleName", moduleName);
                d.Add("moduleVersion", moduleVersion);
                //d.Add("gridShortName", m_gridShortName);
                d.Add("gatewayEnvironment", m_gatewayEnvironment);

                m_gatewayURL = m_initURL;                 //use to obtain the real gatewayURL;
                Dictionary <string, string> response = DoRequestDictionary(d);
                if (response != null)
                {
                    m_gatewayURL = (string)response["gatewayURL"];

                    if (m_gatewayURL != m_initURL && m_gatewayURL != null)
                    {
                        m_log.Info("[" + moduleName + "]: GatewayURL: " + m_gatewayURL);
                    }
                    else
                    {
                        m_log.Error("[" + moduleName + "]: Could not set the GatewayURL - Please restart or contact the module vendor");
                    }
                }
                else
                {
                    m_gatewayURL = null;
                    m_log.Error("[" + moduleName + "]: Could not retrieve GatewayURL");
                }
            } catch (Exception e) {
                m_log.Error("[OMBASE]: " + e);
            }
        }
Example #12
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 void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
        {
            if (windConfig != null)
            {
                // Uses strength value if avg_strength not specified
                m_avgStrength = windConfig.GetFloat("strength", 5.0F);
                m_avgStrength = windConfig.GetFloat("avg_strength", 5.0F);

                m_avgDirection = windConfig.GetFloat("avg_direction", 0.0F);
                m_varStrength  = windConfig.GetFloat("var_strength", 5.0F);
                m_varDirection = windConfig.GetFloat("var_direction", 30.0F);
                m_rateChange   = windConfig.GetFloat("rate_change", 1.0F);

                LogSettings();
            }
        }
Example #14
0
 public override EReturn Save(Nini.Config.IConfig config)
 {
     base.Save(config);
     //Nini.Config.IConfig config = source.AddConfig("Hrdina");
     if (config != null)
     {
         config.Set("Hrozba", Hrozba);
         config.Set("Vule", Vule);
         config.Set("Utok", Utok);
         config.Set("Obrana", Obrana);
         config.Set("Zivoty", Zivoty);
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Example #15
0
 public override EReturn Load(Nini.Config.IConfig config)
 {
     base.Load(config);
     //Nini.Config.IConfig config = GetConfig(source, "Hrdina");
     if (config != null)
     {
         Hrozba = config.GetInt("Hrozba");
         Vule   = config.GetInt("Vule");
         Utok   = config.GetInt("Utok");
         Obrana = config.GetInt("Obrana");
         Zivoty = config.GetInt("Zivoty");
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Example #16
0
        public void Save(Nini.Config.IConfigSource source)
        {
            Nini.Config.IConfig config = source.AddConfig("Druhy");
            string s = "";

            foreach (string ss in druhy)
            {
                if (s == "")
                {
                    s = ss;
                }
                else
                {
                    s = s + "," + ss;
                }
            }
            config.Set("Všechny druhy", s);
        }
 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 #18
0
 public override EReturn Load(Nini.Config.IConfig config)
 {
     base.Load(config);
     //Nini.Config.IConfig config = GetConfig(source, "Zrada");
     if (config != null)
     {
         string          s       = config.GetString("Stin");
         string[]        stin    = s.Split(',');
         List <MyString> mujList = new List <MyString>();
         foreach (string ss in stin)
         {
             MyString ms = new MyString();
             ms.String = ss;
             mujList.Add(ms);
         }
         Stin = mujList;
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Example #19
0
        public override void Initialize(IMesher meshmerizer, Nini.Config.IConfigSource config, OpenMetaverse.UUID regionId)
        {
            _regionId = regionId;
            _mesher   = meshmerizer;

            m_log.Info("[InWorldz.PhysxPhysics] Creating PhysX scene");

            if (config.Configs["InWorldz.PhysxPhysics"] != null)
            {
                Settings.Instance.UseVisualDebugger = config.Configs["InWorldz.PhysxPhysics"].GetBoolean("use_visual_debugger", false);
                Settings.Instance.UseCCD            = config.Configs["InWorldz.PhysxPhysics"].GetBoolean("use_ccd", true);
                Settings.Instance.Gravity           = config.Configs["InWorldz.PhysxPhysics"].GetFloat("gravity", -9.8f);
                Settings.Instance.ThrowOnSdkError   = config.Configs["InWorldz.PhysxPhysics"].GetBoolean("throw_on_sdk_error", false);
                Settings.Instance.InstrumentMeshing = config.Configs["InWorldz.PhysxPhysics"].GetBoolean("instrument_meshing", false);
            }
            else
            {
                Settings.Instance.UseVisualDebugger = false;
                Settings.Instance.UseCCD            = true;
                Settings.Instance.Gravity           = -9.8f;
                Settings.Instance.ThrowOnSdkError   = false;
                Settings.Instance.InstrumentMeshing = false;
            }

            Nini.Config.IConfig startupcfg = config.Configs["Startup"];
            if (startupcfg != null)
            {
                _gridmode = startupcfg.GetBoolean("gridmode", false);
            }

            if (_foundation == null)
            {
                _foundation = new PhysX.Foundation(s_ErrorCallback);
                _physics    = new PhysX.Physics(_foundation);

                Material.BuiltinMaterialInit(_physics);
            }

            _sceneDesc         = new PhysX.SceneDesc(null, Settings.Instance.UseCCD);
            _sceneDesc.Gravity = new PhysX.Math.Vector3(0f, 0f, Settings.Instance.Gravity);


            _simEventDelegator = new SimulationEventCallbackDelegator();
            _simEventDelegator.OnContactCallback += this.OnContact;
            _simEventDelegator.OnTriggerCallback += this.OnTrigger;
            _sceneDesc.SimulationEventCallback    = _simEventDelegator;

            _scene = _physics.CreateScene(_sceneDesc);
            Preload();

            if (Settings.Instance.UseCCD)
            {
                _scene.SetFlag(PhysX.SceneFlag.SweptIntegration, true);
            }

            if (Settings.Instance.UseVisualDebugger && _physics.RemoteDebugger != null)
            {
                _physics.RemoteDebugger.Connect("localhost", null, null, PhysX.VisualDebugger.VisualDebuggerConnectionFlag.Debug, null);
            }

            _controllerManager = _scene.CreateControllerManager();

            CreateDefaults();

            _terrainMesher = new Meshing.TerrainMesher(_scene);
            _terrainMgr    = new TerrainManager(_scene, _terrainMesher, regionId);
            _meshingStage  = new Meshing.MeshingStage(_scene, meshmerizer, _terrainMesher);
            _meshingStage.OnShapeNeedsFreeing += new Meshing.MeshingStage.ShapeNeedsFreeingDelegate(_meshingStage_OnShapeNeedsFreeing);

            _kinematicManager = new KinematicManager();

            //fire up our work loop
            HeartbeatThread = Watchdog.StartThread(new ThreadStart(Heartbeat), "Physics Heartbeat",
                                                   ThreadPriority.Normal, false);

            TimingThread = Watchdog.StartThread(new ThreadStart(DoTiming), string.Format("Physics Timing"),
                                                ThreadPriority.Highest, false);
        }
		public NiniIConfigWrapper(Nini.Config.IConfig config)
		{
			this.config = config;
		}
 public NiniIConfigWrapper(Nini.Config.IConfig config)
 {
     this.config = config;
 }
Example #22
0
        private void LoadKarty(string cesta)
        {
            if (!Directory.Exists(cesta))
            {
                return;
            }
            string[] data = Directory.GetFiles(cesta);
            Karty.Clear();
            foreach (string s in data)
            {
                if (s.Contains(".pk"))
                {
                    //FileStream f = File.Create(s);
                    Nini.Config.IniConfigSource source    = new Nini.Config.IniConfigSource(s);
                    PPLCG.DataKarta             dataKarta = new PPLCG.DataKarta();
                    AKarta k = null;
                    Nini.Config.IConfig config = source.Configs["Karta"];
                    if (config != null)
                    {
                        dataKarta.Load(config);
                    }
                    switch (dataKarta.Typ)
                    {
                    case PPLCG.ETypy.Doplnek:
                        PPLCG.DataDoplnek dd = new PPLCG.DataDoplnek();
                        dd.Load(config);
                        k = new KartaDoplnek(dd);
                        break;

                    case PPLCG.ETypy.Hrdina:
                        PPLCG.DataHrdina dh = new PPLCG.DataHrdina();
                        dh.Load(config);
                        k = new KartaHrdina(dh);
                        break;

                    case PPLCG.ETypy.Lokace:
                        PPLCG.DataLokace dl = new PPLCG.DataLokace();
                        dl.Load(config);
                        k = new KartaLokace(dl);
                        break;

                    case PPLCG.ETypy.Nepritel:
                        PPLCG.DataNepritel dn = new PPLCG.DataNepritel();
                        dn.Load(config);
                        k = new KartaNepritel(dn);
                        break;

                    case PPLCG.ETypy.Spojenec:
                        PPLCG.DataSpojenec ds = new PPLCG.DataSpojenec();
                        ds.Load(config);
                        k = new KartaSpojenec(ds);
                        break;

                    case PPLCG.ETypy.Udalost:
                        PPLCG.DataUdalost du = new PPLCG.DataUdalost();
                        du.Load(config);
                        k = new KartaUdalost(du);
                        break;

                    case PPLCG.ETypy.Zrada:
                        PPLCG.DataZrada dz = new PPLCG.DataZrada();
                        dz.Load(config);
                        k = new KartaZrada(dz);
                        break;
                    }
                    if (k != null)
                    {
                        Karty.Add(k);
                        listBox1.Items.Add(k.Karta.Id);
                    }
                }
            }
        }