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


C# ThreatLevel类代码示例

本文整理汇总了C#中ThreatLevel的典型用法代码示例。如果您正苦于以下问题:C# ThreatLevel类的具体用法?C# ThreatLevel怎么用?C# ThreatLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GetThreatLevel

		public ThreatLevel GetThreatLevel()
		{
			if(m_MaxThreatLevel != 0)
				return m_MaxThreatLevel;
            string risk = m_config.GetString("FunctionThreatLevel", "VeryLow");
			switch (risk)
			{
				case "None":
					m_MaxThreatLevel = ThreatLevel.None;
					break;
				case "VeryLow":
					m_MaxThreatLevel = ThreatLevel.VeryLow;
					break;
				case "Low":
					m_MaxThreatLevel = ThreatLevel.Low;
					break;
				case "Moderate":
					m_MaxThreatLevel = ThreatLevel.Moderate;
					break;
				case "High":
					m_MaxThreatLevel = ThreatLevel.High;
					break;
				case "VeryHigh":
					m_MaxThreatLevel = ThreatLevel.VeryHigh;
					break;
				case "Severe":
					m_MaxThreatLevel = ThreatLevel.Severe;
					break;
				default:
					break;
			}
            return m_MaxThreatLevel;
		}
开发者ID:shangcheng,项目名称:Aurora,代码行数:33,代码来源:ScriptProtectionModule.cs

示例2: FindThreatLevelForFunction

 public static ThreatLevel FindThreatLevelForFunction(string function, ThreatLevel requestedLevel)
 {
     if (PermittedFunctions.ContainsKey(function))
     {
         return PermittedFunctions[function];
     }
     return requestedLevel;
 }
开发者ID:x8ball,项目名称:Aurora-Sim,代码行数:8,代码来源:GridRegistrationService.cs

示例3: CheckThreatLevel

 public bool CheckThreatLevel(ThreatLevel level, string function, ISceneChildEntity m_host, string API,
     UUID itemID)
 {
     GetDefinition(level).CheckThreatLevel(function, m_host, API);
     return CheckFunctionLimits(function, m_host, API, itemID);
 }
开发者ID:justasabc,项目名称:Aurora-Sim,代码行数:6,代码来源:ScriptProtectionModule.cs

示例4: GetDefinition

 public ThreatLevelDefinition GetDefinition(ThreatLevel level)
 {
     switch (level)
     {
         case ThreatLevel.None:
             return m_threatLevelNone;
         case ThreatLevel.Nuisance:
             return m_threatLevelNuisance;
         case ThreatLevel.VeryLow:
             return m_threatLevelVeryLow;
         case ThreatLevel.Low:
             return m_threatLevelLow;
         case ThreatLevel.Moderate:
             return m_threatLevelModerate;
         case ThreatLevel.High:
             return m_threatLevelHigh;
         case ThreatLevel.VeryHigh:
             return m_threatLevelVeryHigh;
         case ThreatLevel.Severe:
             return m_threatLevelSevere;
         case ThreatLevel.NoAccess:
             return m_threatLevelNoAccess;
     }
     return null;
 }
开发者ID:justasabc,项目名称:Aurora-Sim,代码行数:25,代码来源:ScriptProtectionModule.cs

示例5: ReadConfiguration

 protected void ReadConfiguration(IConfig config)
 {
     PermissionSet.ReadFunctions(config);
     m_timeBeforeTimeout = config.GetFloat("DefaultTimeout", m_timeBeforeTimeout);
     m_defaultRegionThreatLevel = (ThreatLevel)Enum.Parse(typeof(ThreatLevel), config.GetString("DefaultRegionThreatLevel", m_defaultRegionThreatLevel.ToString()));
 }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:6,代码来源:GridRegistrationService.cs

示例6: CheckThreatLevel

        public bool CheckThreatLevel(string SessionID, string function, ThreatLevel defaultThreatLevel)
        {
            if (!m_useRegistrationService)
                return true;

            GridRegistrationURLs urls = m_genericsConnector.GetGeneric<GridRegistrationURLs>(UUID.Zero,
                "GridRegistrationUrls", SessionID);
            if (urls != null)
            {
                //Past time for it to expire
                if (m_useSessionTime && urls.Expiration < DateTime.UtcNow)
                {
                    MainConsole.Instance.Warn ("[GridRegService]: URLs expired for " + SessionID);
                    RemoveUrlsForClient(SessionID);
                    return false;
                }
                //First find the threat level that this setting has to have do be able to run
                ThreatLevel functionThreatLevel = PermissionSet.FindThreatLevelForFunction(function, defaultThreatLevel);
                //Now find the permission for that threat level
                //else, check it against the threat level that the region has
                ThreatLevel regionThreatLevel = FindRegionThreatLevel (SessionID);
                //Return whether the region threat level is higher than the function threat level
                if(!(functionThreatLevel <= regionThreatLevel))
                    MainConsole.Instance.Warn ("[GridRegService]: checkThreatLevel (" + function + ") failed for " + SessionID + ", fperm " + functionThreatLevel + ", rperm " + regionThreatLevel + "!");
                return functionThreatLevel <= regionThreatLevel;
            }
            MainConsole.Instance.Warn ("[GridRegService]: Could not find URLs for checkThreatLevel for " + SessionID + "!");
            return false;
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:29,代码来源:GridRegistrationService.cs

示例7: CheckThreatLevel

        // Returns of the function is allowed. Throws a script exception if not allowed.
        public void CheckThreatLevel(ThreatLevel level, string function)
        {
            if (!m_OSFunctionsEnabled)
                OSSLError(String.Format("{0} permission denied.  All OS functions are disabled.", function)); // throws

            string reasonWhyNot = CheckThreatLevelTest(level, function);
            if (!String.IsNullOrEmpty(reasonWhyNot))
            {
                OSSLError(reasonWhyNot);
            }
        }
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:12,代码来源:OSSL_Api.cs

示例8: CheckThreatLevel

		public void CheckThreatLevel(ThreatLevel level, string function, ISceneChildEntity m_host, string API)
        {
            GetDefinition(level).CheckThreatLevel (function, m_host, API);
        }
开发者ID:HGExchange,项目名称:Aurora-Sim,代码行数:4,代码来源:ScriptProtectionModule.cs

示例9: Initialize

        public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;

            if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
                m_OSFunctionsEnabled = true;

            m_ScriptDelayFactor =
                    m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f);
            m_ScriptDistanceFactor =
                    m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);

            string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow");
            switch (risk)
            {
            case "None":
                m_MaxThreatLevel = ThreatLevel.None;
                break;
            case "VeryLow":
                m_MaxThreatLevel = ThreatLevel.VeryLow;
                break;
            case "Low":
                m_MaxThreatLevel = ThreatLevel.Low;
                break;
            case "Moderate":
                m_MaxThreatLevel = ThreatLevel.Moderate;
                break;
            case "High":
                m_MaxThreatLevel = ThreatLevel.High;
                break;
            case "VeryHigh":
                m_MaxThreatLevel = ThreatLevel.VeryHigh;
                break;
            case "Severe":
                m_MaxThreatLevel = ThreatLevel.Severe;
                break;
            default:
                break;
            }
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:43,代码来源:OSSL_Api.cs

示例10: Initialize

 public void Initialize(IConfigSource source, IRegistryCore registry)
 {
     m_source = source;
     m_config = source.Configs["AuroraInterWorldConnectors"];
     if (m_config != null)
     {
         m_Enabled = m_config.GetBoolean("Enabled", false);
         m_allowUntrustedConnections = m_config.GetBoolean("AllowUntrustedConnections", m_allowUntrustedConnections);
         m_untrustedConnectionsDefaultTrust = (ThreatLevel)Enum.Parse(typeof(ThreatLevel), m_config.GetString("UntrustedConnectionsDefaultTrust", m_untrustedConnectionsDefaultTrust.ToString()));
         registry.RegisterModuleInterface<InterWorldCommunications>(this);
         registry.StackModuleInterface<ICommunicationService> (this);
         m_registry = registry;
     }
 }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:14,代码来源:InterWorldCommunications.cs

示例11: CheckThreatLevel

 public bool CheckThreatLevel(string SessionID, ulong RegionHandle, string function, ThreatLevel defaultThreatLevel)
 {
     GridRegistrationURLs urls = m_genericsConnector.GetGeneric<GridRegistrationURLs>(UUID.Zero,
         "GridRegistrationUrls", RegionHandle.ToString(), new GridRegistrationURLs());
     if (urls != null)
     {
         //Past time for it to expire
         if (urls.Expiration < DateTime.Now)
         {
             RemoveUrlsForClient(SessionID, RegionHandle);
             return false;
         }
         //First find the threat level that this setting has to have do be able to run
         ThreatLevel functionThreatLevel = PermissionSet.FindThreatLevelForFunction(function, defaultThreatLevel);
         //Now find the permission for that threat level
         //else, check it against the threat level that the region has
         ThreatLevel regionThreatLevel = FindRegionThreatLevel(RegionHandle);
         //Return whether the region threat level is higher than the function threat level
         return functionThreatLevel <= regionThreatLevel;
     }
     return false;
 }
开发者ID:x8ball,项目名称:Aurora-Sim,代码行数:22,代码来源:GridRegistrationService.cs

示例12: ThreatLevelDefinition

            public ThreatLevelDefinition(ThreatLevel threatLevel, UserSet userSet, ScriptProtectionModule module)
            {
                m_threatLevel = threatLevel;
                m_userSet = userSet;
                m_scriptProtectionModule = module;
                m_allowGroupPermissions = m_scriptProtectionModule.m_config.GetBoolean(
                    "AllowGroupThreatPermissionCheck", m_allowGroupPermissions);

                string perm = m_scriptProtectionModule.m_config.GetString("Allow_" + m_threatLevel.ToString(), "");
                if (perm != "")
                {
                    string[] ids = perm.Split(',');

                    foreach (string current in ids.Select(id => id.Trim()))
                    {
                        UUID uuid;

                        if (UUID.TryParse(current, out uuid))
                        {
                            if (uuid != UUID.Zero)
                                m_allowedUsers.Add(uuid);
                        }
                    }
                }
                perm = m_scriptProtectionModule.m_config.GetString("Allow_All", "");
                if (perm != "")
                {
                    string[] ids = perm.Split(',');
                    foreach (string current in ids.Select(id => id.Trim()))
                    {
                        UUID uuid;

                        if (UUID.TryParse(current, out uuid))
                        {
                            if (uuid != UUID.Zero)
                                m_allowedUsers.Add(uuid);
                        }
                    }
                }
            }
开发者ID:justasabc,项目名称:Aurora-Sim,代码行数:40,代码来源:ScriptProtectionModule.cs

示例13: GetThreatLevel

 public ThreatLevelDefinition GetThreatLevel()
 {
     if (m_MaxThreatLevel != 0)
         return GetDefinition(m_MaxThreatLevel);
     string risk = m_config.GetString("FunctionThreatLevel", "VeryLow");
     switch (risk)
     {
         case "NoAccess":
             m_MaxThreatLevel = ThreatLevel.NoAccess;
             break;
         case "None":
             m_MaxThreatLevel = ThreatLevel.None;
             break;
         case "Nuisance":
             m_MaxThreatLevel = ThreatLevel.Nuisance;
             break;
         case "VeryLow":
             m_MaxThreatLevel = ThreatLevel.VeryLow;
             break;
         case "Low":
             m_MaxThreatLevel = ThreatLevel.Low;
             break;
         case "Moderate":
             m_MaxThreatLevel = ThreatLevel.Moderate;
             break;
         case "High":
             m_MaxThreatLevel = ThreatLevel.High;
             break;
         case "VeryHigh":
             m_MaxThreatLevel = ThreatLevel.VeryHigh;
             break;
         case "Severe":
             m_MaxThreatLevel = ThreatLevel.Severe;
             break;
     }
     return GetDefinition(m_MaxThreatLevel);
 }
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:37,代码来源:ScriptProtectionModule.cs

示例14: CheckThreatLevel

 // Returns of the function is allowed. Throws a script exception if not allowed.
 public void CheckThreatLevel(ThreatLevel level, string function)
 {
     string reasonWhyNot = CheckThreatLevelTest(level, function);
     if (!String.IsNullOrEmpty(reasonWhyNot))
     {
         OSSLError(reasonWhyNot);
     }
 }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:9,代码来源:OSSL_Api.cs

示例15: Initialize

        public void Initialize(
            IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
        {
            m_ScriptEngine = scriptEngine;
            m_host = host;
            m_item = item;

            m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();

            m_ScriptDelayFactor =
                    m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f);
            m_ScriptDistanceFactor =
                    m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);

            string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow");
            switch (risk)
            {
            case "NoAccess":
                m_MaxThreatLevel = ThreatLevel.NoAccess;
                break;
            case "None":
                m_MaxThreatLevel = ThreatLevel.None;
                break;
            case "VeryLow":
                m_MaxThreatLevel = ThreatLevel.VeryLow;
                break;
            case "Low":
                m_MaxThreatLevel = ThreatLevel.Low;
                break;
            case "Moderate":
                m_MaxThreatLevel = ThreatLevel.Moderate;
                break;
            case "High":
                m_MaxThreatLevel = ThreatLevel.High;
                break;
            case "VeryHigh":
                m_MaxThreatLevel = ThreatLevel.VeryHigh;
                break;
            case "Severe":
                m_MaxThreatLevel = ThreatLevel.Severe;
                break;
            default:
                break;
            }
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:45,代码来源:OSSL_Api.cs


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