From ed41ba8a3d9e19e9ff20fcdb6cdde3e614fcfb1f Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 6 Jun 2008 21:39:42 +0000 Subject: * Added a configuration option for allowing god script lsl methods.. such as llSetObjectPermMask. By default it's off. --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 48 +++++++++++++--------- 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 1999945..68b87fd 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Runtime.Remoting.Lifetime; using System.Text; using System.Threading; +using Nini.Config; using Axiom.Math; using libsecondlife; using OpenSim.Framework; @@ -5623,30 +5624,39 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetObjectPermMask(int mask, int value) { m_host.AddScriptLPS(1); - - if (mask == BuiltIn_Commands_BaseClass.MASK_BASE)//0 + IConfigSource config = new IniConfigSource(Application.iniFilePath); + if (config.Configs["LL-Functions"] == null) + config.AddConfig("LL-Functions"); + + if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false)) { - m_host.BaseMask = (uint)value; - } + if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) + { + if (mask == BuiltIn_Commands_BaseClass.MASK_BASE)//0 + { + m_host.BaseMask = (uint)value; + } - else if (mask == BuiltIn_Commands_BaseClass.MASK_OWNER)//1 - { - m_host.OwnerMask = (uint)value; - } + else if (mask == BuiltIn_Commands_BaseClass.MASK_OWNER)//1 + { + m_host.OwnerMask = (uint)value; + } - else if (mask == BuiltIn_Commands_BaseClass.MASK_GROUP)//2 - { - m_host.GroupMask = (uint)value; - } + else if (mask == BuiltIn_Commands_BaseClass.MASK_GROUP)//2 + { + m_host.GroupMask = (uint)value; + } - else if (mask == BuiltIn_Commands_BaseClass.MASK_EVERYONE)//3 - { - m_host.EveryoneMask = (uint)value; - } + else if (mask == BuiltIn_Commands_BaseClass.MASK_EVERYONE)//3 + { + m_host.EveryoneMask = (uint)value; + } - else if (mask == BuiltIn_Commands_BaseClass.MASK_NEXT)//4 - { - m_host.NextOwnerMask = (uint)value; + else if (mask == BuiltIn_Commands_BaseClass.MASK_NEXT)//4 + { + m_host.NextOwnerMask = (uint)value; + } + } } } -- cgit v1.1