当前位置: 首页>>代码示例>>C#>>正文


C# IConfig.GetInt方法代码示例

本文整理汇总了C#中IConfig.GetInt方法的典型用法代码示例。如果您正苦于以下问题:C# IConfig.GetInt方法的具体用法?C# IConfig.GetInt怎么用?C# IConfig.GetInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IConfig的用法示例。


在下文中一共展示了IConfig.GetInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialise

        public void Initialise(IConfigSource config)
        {
            m_windConfig = config.Configs["Wind"];
//            string desiredWindPlugin = m_dWindPluginName;

            if (m_windConfig != null)
            {
                m_enabled = m_windConfig.GetBoolean("enabled", true);

                m_frameUpdateRate = m_windConfig.GetInt("wind_update_rate", 150);

                // Determine which wind model plugin is desired
                if (m_windConfig.Contains("wind_plugin"))
                {
                    m_dWindPluginName = m_windConfig.GetString("wind_plugin", m_dWindPluginName);
                }
            }

            if (m_enabled)
            {
                m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate);

            }

        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:25,代码来源:WindModule.cs

示例2: Init

        public void Init(VPServices app, Instance bot)
        {
            app.Commands.AddRange(new[] {
                new Command
                (
                    "IRC: Connect", "^irc(start|connect)$",
                    (s,a,d) => { return connect(); },
                    @"Starts the IRC-VP bridge", "!ircstart", 60
                ),

                new Command
                (
                    "IRC: Disconnect", "^irc(end|disconnect)$",
                    (s,a,d) => { return disconnect(); },
                    @"Stops the IRC-VP bridge", "!ircend", 60
                )
            });

            config = app.Settings.Configs["IRC"] ?? app.Settings.Configs.Add("IRC");

            this.app  = app;
            host      = config.Get("Server", "irc.ablivion.net");
            port      = config.GetInt("Port", 6667);
            channel   = config.Get("Channel", "#vp");
            bot.Chat += onWorldChat;

            if (config.GetBoolean("Autoconnect", false))
                connect();
        }
开发者ID:edwinr,项目名称:VPServices,代码行数:29,代码来源:IRC.cs

示例3: Initialise

        public virtual void Initialise(IConfigSource config)
        {
            m_config = config.Configs["Chat"];

            if (m_config != null)
            {
                if (!m_config.GetBoolean("enabled", true))
                {
                    m_log.Info("[CHAT]: plugin disabled by configuration");
                    m_enabled = false;
                    return;
                }
 
            m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance);
            m_saydistance = m_config.GetInt("say_distance", m_saydistance);
            m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance);
            m_adminPrefix = m_config.GetString("admin_prefix", "");
            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:19,代码来源:ChatModule.cs

示例4: CoreAccount

        public CoreAccount(int i, IConfig config)
        {
            Index = i;

            Name = config.GetString(_("AccountName"));
            HostName = config.GetString(_("HostName"));
            Password = config.GetString(_("Password"));
            Port = config.GetInt(_("Port"));
            User = config.GetString(_("User"));
        }
开发者ID:txdv,项目名称:qutter,代码行数:10,代码来源:Settings.cs

示例5: RedisConnectionManager

        public RedisConnectionManager(IConfig config)
        {
            ConfigurationOptions options = new ConfigurationOptions();
            options.EndPoints.Add(config.GetString("redisCacheHostName"), config.GetInt("redisCachePortNumber"));
            options.Ssl = config.GetBool("redisCacheUseSSL");
            options.Password = config.GetString("redisCachePassword");
            options.AbortOnConnectFail = false;
            options.ConnectTimeout = 30000;

            connection = ConnectionMultiplexer.Connect(options);
            cache = connection.GetDatabase();
        }
开发者ID:mbgreen,项目名称:GHV,代码行数:12,代码来源:RedisConnectionManager.cs

示例6: Initialise

 public void Initialise(IConfigSource config)
 {
     m_config = config.Configs["RegionReady"];
     if (m_config != null) 
     {
         m_enabled = m_config.GetBoolean("enabled", false);
         
         if (m_enabled) 
         {
             m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify);
             m_disable_logins = m_config.GetBoolean("login_disable", false);
             m_uri = m_config.GetString("alert_uri",string.Empty);
         }
     }
 }
开发者ID:p07r0457,项目名称:opensim,代码行数:15,代码来源:RegionReadyModule.cs

示例7: Initialise

        public void Initialise(IConfigSource config)
        {
            m_log.Info("[RegionReady] Initialising");

            m_config = config.Configs["RegionReady"];
            if (m_config != null) 
            {
                m_enabled = m_config.GetBoolean("enabled", false);
                if (m_enabled) 
                {
                    m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify);
                } 
            }

            if (!m_enabled)
                m_log.Info("[RegionReady] disabled.");
        }
开发者ID:Ideia-Boa,项目名称:diva-distribution,代码行数:17,代码来源:RegionReadyModule.cs

示例8: Initialise

        public void Initialise(IConfigSource config)
        {
            windConfig = config.Configs["Wind"];
            desiredWindPlugin = m_dWindPluginName;

            if (windConfig != null)
            {
                m_enabled = windConfig.GetBoolean("enabled", true);

                m_frameUpdateRate = windConfig.GetInt("wind_update_rate", 150);

                // Determine which wind model plugin is desired
                if (windConfig.Contains("wind_plugin"))
                {
                    desiredWindPlugin = windConfig.GetString("wind_plugin");
                }
            }
        }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:18,代码来源:WindModule.cs

示例9: Initialise

        public void Initialise(Scene scene, IConfigSource config)
        {
            m_log.Info("[RegionReady] Initialising");
            m_scene = scene;
            m_firstEmptyCompileQueue = true;
            m_oarFileLoading = false;
            m_lastOarLoadedOk = true;
            m_config = config.Configs["RegionReady"];

            if (m_config != null) 
            {
                m_enabled = m_config.GetBoolean("enabled", false);
                if (m_enabled) 
                {
                    m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify);
                } 
            }
        }
开发者ID:ChrisD,项目名称:opensim,代码行数:18,代码来源:RegionReady.cs

示例10: SimpleCurrencyConfig

 public SimpleCurrencyConfig(IConfig economyConfig)
 {
     foreach (PropertyInfo propertyInfo in GetType().GetProperties())
     {
         try
         {
             if (propertyInfo.PropertyType.IsAssignableFrom(typeof (float)))
                 propertyInfo.SetValue(this,
                                       economyConfig.GetFloat(propertyInfo.Name,
                                                              float.Parse(
                                                                  propertyInfo.GetValue(this, new object[0])
                                                                              .ToString())), new object[0]);
             else if (propertyInfo.PropertyType.IsAssignableFrom(typeof (int)))
                 propertyInfo.SetValue(this,
                                       economyConfig.GetInt(propertyInfo.Name,
                                                            int.Parse(
                                                                propertyInfo.GetValue(this, new object[0])
                                                                            .ToString())), new object[0]);
             else if (propertyInfo.PropertyType.IsAssignableFrom(typeof (bool)))
                 propertyInfo.SetValue(this,
                                       economyConfig.GetBoolean(propertyInfo.Name,
                                                                bool.Parse(
                                                                    propertyInfo.GetValue(this, new object[0])
                                                                                .ToString())), new object[0]);
             else if (propertyInfo.PropertyType.IsAssignableFrom(typeof (string)))
                 propertyInfo.SetValue(this,
                                       economyConfig.GetString(propertyInfo.Name,
                                                               propertyInfo.GetValue(this, new object[0])
                                                                           .ToString()), new object[0]);
             else if (propertyInfo.PropertyType.IsAssignableFrom(typeof (UUID)))
                 propertyInfo.SetValue(this,
                                       new UUID(economyConfig.GetString(propertyInfo.Name,
                                                                        propertyInfo.GetValue(this, new object[0])
                                                                                    .ToString())), new object[0]);
         }
         catch (Exception)
         {
             MainConsole.Instance.Warn("[SimpleCurrency]: Exception reading economy config: " + propertyInfo.Name);
         }
     }
 }
开发者ID:emperorstarfinder,项目名称:My-Aurora-Sim,代码行数:41,代码来源:Config.cs

示例11: Initialize

        public void Initialize(ScriptEngine engine, IConfig config)
        {
            m_config = config;
            m_scriptEngine = engine;
            EnabledAPIs = new List<string>(config.GetString("AllowedAPIs", "LSL").ToLower().Split(','));

            allowHTMLLinking = config.GetBoolean("AllowHTMLLinking", true);

            #region Limitation configs

            m_allowFunctionLimiting = config.GetBoolean("AllowFunctionLimiting", false);

            foreach (string kvp in config.GetKeys())
            {
                if (kvp.EndsWith("_Limit"))
                {
                    string functionName = kvp.Remove(kvp.Length - 6);
                    LimitDef limitDef = new LimitDef();
                    string limitType = config.GetString(functionName + "_LimitType", "None");
                    string limitAlert = config.GetString(functionName + "_LimitAlert", "None");
                    string limitAction = config.GetString(functionName + "_LimitAction", "None");
                    int limitTimeScale = config.GetInt(functionName + "_LimitTimeScale", 0);
                    int limitMaxNumberOfTimes = config.GetInt(functionName + "_LimitMaxNumberOfTimes", 0);
                    int limitFunctionsOverTimeScale = config.GetInt(functionName + "_LimitFunctionsOverTimeScale", 0);

                    try
                    {
                        limitDef.Type = (LimitType) Enum.Parse(typeof (LimitType), limitType, true);
                    }
                    catch
                    {
                    }
                    try
                    {
                        limitDef.Alert = (LimitAlert) Enum.Parse(typeof (LimitAlert), limitAlert, true);
                    }
                    catch
                    {
                    }
                    try
                    {
                        limitDef.Action = (LimitAction) Enum.Parse(typeof (LimitAction), limitAction, true);
                    }
                    catch
                    {
                    }

                    limitDef.TimeScale = limitTimeScale;
                    limitDef.MaxNumberOfTimes = limitMaxNumberOfTimes;
                    limitDef.FunctionsOverTimeScale = limitFunctionsOverTimeScale;
                    m_functionsToLimit[functionName] = limitDef;
                }
            }

            #endregion

            m_threatLevelNone = new ThreatLevelDefinition(ThreatLevel.None,
                                                          UserSetHelpers.ParseUserSetConfigSetting(config, "NoneUserSet",
                                                                                                   UserSet.None), this);
            m_threatLevelNuisance = new ThreatLevelDefinition(ThreatLevel.Nuisance,
                                                              UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                       "NuisanceUserSet",
                                                                                                       UserSet.None),
                                                              this);
            m_threatLevelVeryLow = new ThreatLevelDefinition(ThreatLevel.VeryLow,
                                                             UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                      "VeryLowUserSet",
                                                                                                      UserSet.None),
                                                             this);
            m_threatLevelLow = new ThreatLevelDefinition(ThreatLevel.Low,
                                                         UserSetHelpers.ParseUserSetConfigSetting(config, "LowUserSet",
                                                                                                  UserSet.None), this);
            m_threatLevelModerate = new ThreatLevelDefinition(ThreatLevel.Moderate,
                                                              UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                       "ModerateUserSet",
                                                                                                       UserSet.None),
                                                              this);
            m_threatLevelHigh = new ThreatLevelDefinition(ThreatLevel.High,
                                                          UserSetHelpers.ParseUserSetConfigSetting(config, "HighUserSet",
                                                                                                   UserSet.None), this);
            m_threatLevelVeryHigh = new ThreatLevelDefinition(ThreatLevel.VeryHigh,
                                                              UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                       "VeryHighUserSet",
                                                                                                       UserSet.None),
                                                              this);
            m_threatLevelSevere = new ThreatLevelDefinition(ThreatLevel.Severe,
                                                            UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                     "SevereUserSet",
                                                                                                     UserSet.None), this);
            m_threatLevelNoAccess = new ThreatLevelDefinition(ThreatLevel.NoAccess,
                                                              UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                       "NoAccessUserSet",
                                                                                                       UserSet.None),
                                                              this);
        }
开发者ID:justasabc,项目名称:Aurora-Sim,代码行数:95,代码来源:ScriptProtectionModule.cs

示例12: Initialise

        public virtual void Initialise(IConfigSource config)
        {
            m_config = config.Configs["AuroraChat"];

            if (null == m_config)
            {
                MainConsole.Instance.Info("[AURORACHAT]: no config found, plugin disabled");
                m_enabled = false;
                return;
            }

            if (!m_config.GetBoolean("enabled", true))
            {
                MainConsole.Instance.Info("[AURORACHAT]: plugin disabled by configuration");
                m_enabled = false;
                return;
            }

            m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance);
            m_saydistance = m_config.GetInt("say_distance", m_saydistance);
            m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance);
            m_maxChatDistance = m_config.GetFloat("max_chat_distance", m_maxChatDistance);

            m_useMuteListModule = (config.Configs["Messaging"].GetString("MuteListModule", "AuroraChatModule") ==
                                   "AuroraChatModule");
        }
开发者ID:JAllard,项目名称:Aurora-Sim,代码行数:26,代码来源:AuroraChatModule.cs

示例13: Initialize

        /// <summary>
        /// This method is during the startup of the Aurora server, It is called just after the
        /// HTTP server has started and before any shared modules or regions have been loaded.
        /// </summary>
        /// <param name="config">Configuration parameter stream.</param>
        public void Initialize(ISimulationBase openSim)
        {
            //  Display a startup message, save the passed 'server instance?', obtain the
            // scene manager and scene graph for this server instance and obtain the interface
            // used to access region information, regardless of whether the storage method is
            // file, web or MySQL based in reality. Finally call an internal method that installs
            // the command console commands and alters some internal properties, indicating that
            // the module is loaded, enabled and ready for use.
            m_log.Info("[CITY BUILDER]: Version 0.0.0.10 ");

            //  Store the supplied simulation base to for future use.
            simulationBase = openSim;
            //  Store the configuration source (I presume all contents of all ini files).
            configSource = simulationBase.ConfigSource;
            //  Store the configuration section specifically used by City Builder.
            cityConfig = configSource.Configs["CityBuilder"];

            //  Obtain the default user account service, do the same for the estate/parcel too.
            m_UserAccountService = simulationBase.ApplicationRegistry.RequestModuleInterface<IUserAccountService>();

            //  If we have a configuration source for City Builder then set the specified internal properties else default them.
            if (cityConfig != null)
            {
                //  Configuration file is present or it is included within one of the other configuration
                // file that control aurora obtain the specified values or use hardcoded defaults.
                m_log.Info("[CITY BUILDER]: Configuration found, stored.");

                //  Construct Land data to be used for the entire city and any occupied regions.
                m_DefaultUserAccount = null;
                // Construct the estate settings for the city.
                m_DefaultEstate = null;

                startPort = cityConfig.GetInt("DefaultStartPort", startPort);

                m_fEnabled = cityConfig.GetBoolean("Enabled", m_fEnabled);

                m_fInitialised = false;
                citySeed = this.randomValue(257);
                cityName = cityConfig.GetString("DefaultCityName", "CityVille");
                cityOwner = cityConfig.GetString("DefaultCityOwner", "Cobra ElDiablo");
                m_DefaultUserName = cityOwner;
                m_DefaultUserEmail = cityConfig.GetString("DefaultUserEmail", "");
                m_DefaultUserPword = cityConfig.GetString("DefaultUserPassword", "");
                CityEstate = cityConfig.GetString("DefaultCityEstate", "Liquid Silicon Developments");
                m_DefaultEstateOwner = cityOwner;
                m_DefaultEstatePassword = cityConfig.GetString("DefaultEstatePassword", "");
                cityDensities = new List<float>();
                m_DefaultStartLocation = new Vector2(9500, 9500);
                startPort = cityConfig.GetInt("DefaultStartPort", 9500);
            }
            else
            {
                m_log.Info("[CITY BUILDER]: No configuration data found.");

                m_DefaultUserAccount = null;
                m_DefaultEstate = null;

                m_fEnabled = false;
                m_fInitialised = false;
                citySeed = this.randomValue(257);
                cityName = string.Empty;
                cityOwner = string.Empty;
                CityEstate = string.Empty;
                //  Configuration for the plugin.
                //  Configuration source from Aurora.
                cityConfig = new ConfigBase("CityBuilder",configSource);
                cityDensities = new List<float>();
                m_DefaultStartLocation = new Vector2(9500, 9500);
                // automatically disable the module if a configuration is not found. You can
                // manually enable the module and then set its internal properties before using
                // it via the server command console prompt.
                m_fEnabled = false;
            }

            cityDensities.Add(0.85f);
            cityDensities.Add(0.75f);
            cityDensities.Add(0.65f);
            cityDensities.Add(0.45f);
            //  Install the module, does not alter the enabled flag! This allows for the plugin
            // to install some commands for the main servers console but prevents any use of
            // the plugin until the internal properties are set correctly.
            InstallModule();
        }
开发者ID:RevolutionSmythe,项目名称:CityModule,代码行数:88,代码来源:CityModule.cs

示例14: ReadConfigAndPopulate

        /// <summary>
        /// Parse Configuration
        /// </summary>
        /// <param name="scene"></param>
        /// <param name="startupConfig"></param>
        /// <param name="config"></param>
        private void ReadConfigAndPopulate(IConfig startupConfig, string config)
        {
            if (config == "Startup" && startupConfig != null)
            {
                m_enabled = (startupConfig.GetString("economymodule", "BetaGridLikeMoneyModule") == "BetaGridLikeMoneyModule");
            }

            if (config == "Economy" && startupConfig != null)
            {
                PriceEnergyUnit = startupConfig.GetInt("PriceEnergyUnit", 100);
                PriceObjectClaim = startupConfig.GetInt("PriceObjectClaim", 10);
                PricePublicObjectDecay = startupConfig.GetInt("PricePublicObjectDecay", 4);
                PricePublicObjectDelete = startupConfig.GetInt("PricePublicObjectDelete", 4);
                PriceParcelClaim = startupConfig.GetInt("PriceParcelClaim", 1);
                PriceParcelClaimFactor = startupConfig.GetFloat("PriceParcelClaimFactor", 1f);
                PriceUpload = startupConfig.GetInt("PriceUpload", 0);
                PriceRentLight = startupConfig.GetInt("PriceRentLight", 5);
                TeleportMinPrice = startupConfig.GetInt("TeleportMinPrice", 2);
                TeleportPriceExponent = startupConfig.GetFloat("TeleportPriceExponent", 2f);
                EnergyEfficiency = startupConfig.GetFloat("EnergyEfficiency", 1);
                PriceObjectRent = startupConfig.GetFloat("PriceObjectRent", 1);
                PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10);
                PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1);
                PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1);
                m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false);
            }
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:33,代码来源:SampleMoneyModule.cs

示例15: Initialise

        // -----------------------------------------------------------------
        /// <summary>
        /// Initialise this shared module
        /// </summary>
        /// <param name="scene">this region is getting initialised</param>
        /// <param name="source">nini config, we are not using this</param>
        // -----------------------------------------------------------------
        public void Initialise(IConfigSource config)
        {
            try 
            {
                if ((m_config = config.Configs["JsonStore"]) == null)
                {
                    // There is no configuration, the module is disabled
                    // m_log.InfoFormat("[JsonStore] no configuration info");
                    return;
                }

                m_enabled = m_config.GetBoolean("Enabled", m_enabled);
                m_enableObjectStore = m_config.GetBoolean("EnableObjectStore", m_enableObjectStore);
                m_maxStringSpace = m_config.GetInt("MaxStringSpace", m_maxStringSpace);
                if (m_maxStringSpace == 0)
                    m_maxStringSpace = Int32.MaxValue;
            }
            catch (Exception e)
            {
                m_log.Error("[JsonStore]: initialization error: {0}", e);
                return;
            }

            if (m_enabled)
                m_log.DebugFormat("[JsonStore]: module is enabled");
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:33,代码来源:JsonStoreModule.cs


注:本文中的IConfig.GetInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。