* Added a configuration option for allowing god script lsl methods.. such as llSetObjectPermMask. By default it's off.

0.6.0-stable
Teravus Ovares 2008-06-06 21:39:42 +00:00
parent 6a66caa02e
commit ed41ba8a3d
2 changed files with 31 additions and 19 deletions

View File

@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Runtime.Remoting.Lifetime; using System.Runtime.Remoting.Lifetime;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using Nini.Config;
using Axiom.Math; using Axiom.Math;
using libsecondlife; using libsecondlife;
using OpenSim.Framework; using OpenSim.Framework;
@ -5623,30 +5624,39 @@ namespace OpenSim.Region.ScriptEngine.Common
public void llSetObjectPermMask(int mask, int value) public void llSetObjectPermMask(int mask, int value)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IConfigSource config = new IniConfigSource(Application.iniFilePath);
if (mask == BuiltIn_Commands_BaseClass.MASK_BASE)//0 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 else if (mask == BuiltIn_Commands_BaseClass.MASK_OWNER)//1
{ {
m_host.OwnerMask = (uint)value; m_host.OwnerMask = (uint)value;
} }
else if (mask == BuiltIn_Commands_BaseClass.MASK_GROUP)//2 else if (mask == BuiltIn_Commands_BaseClass.MASK_GROUP)//2
{ {
m_host.GroupMask = (uint)value; m_host.GroupMask = (uint)value;
} }
else if (mask == BuiltIn_Commands_BaseClass.MASK_EVERYONE)//3 else if (mask == BuiltIn_Commands_BaseClass.MASK_EVERYONE)//3
{ {
m_host.EveryoneMask = (uint)value; m_host.EveryoneMask = (uint)value;
} }
else if (mask == BuiltIn_Commands_BaseClass.MASK_NEXT)//4 else if (mask == BuiltIn_Commands_BaseClass.MASK_NEXT)//4
{ {
m_host.NextOwnerMask = (uint)value; m_host.NextOwnerMask = (uint)value;
}
}
} }
} }

View File

@ -487,6 +487,8 @@ CleanUpOldScriptsOnStartup=true
; Set the following to true to allow administrator owned scripts to execute console commands ; Set the following to true to allow administrator owned scripts to execute console commands
AllowosConsoleCommand=false AllowosConsoleCommand=false
AllowGodFunctions = false
; Maximum number of llListen events we allow per script ; Maximum number of llListen events we allow per script
; Set this to 0 to have no limit imposed. ; Set this to 0 to have no limit imposed.
max_listens_per_script = 64 max_listens_per_script = 64