From 3697e0898c83597914956157b4bbf880b83d948b Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Fri, 27 Jun 2008 02:22:33 +0000 Subject: Mantis#1612. Thank you, kindly, Matth for a patch that: Adds the beginnints of llRemoteLoadScriptPin() and llSetRemoteScriptAccessPin(). --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 45 +++++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index b5a3ad9..0514573 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -4660,13 +4660,54 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetRemoteScriptAccessPin(int pin) { m_host.AddScriptLPS(1); - NotImplemented("llSetRemoteScriptAccessPin"); + + m_host.ScriptAccessPin = pin; } public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { m_host.AddScriptLPS(1); - NotImplemented("llRemoteLoadScriptPin"); + bool found = false; + LLUUID destId = LLUUID.Zero; + LLUUID srcId = LLUUID.Zero; + + if (!LLUUID.TryParse(target, out destId)) + { + llSay(0, "Could not parse key " + target); + return; + } + + // target must be a different prim than the one containing the script + if (m_host.UUID == destId) + { + return; + } + + // copy the first script found with this inventory name + foreach (KeyValuePair inv in m_host.TaskInventory) + { + if (inv.Value.Name == name) + { + // make sure the object is a script + if(10 == inv.Value.Type) + { + found = true; + srcId = inv.Key; + break; + } + } + } + + if (!found) + { + llSay(0, "Could not find script " + name); + return; + } + + // the rest of the permission checks are done in RezScript, so check the pin there as well + World.RezScript(srcId, m_host, destId, pin, running, start_param); + // this will cause the delay even if the script pin or permissions were wrong - seems ok + System.Threading.Thread.Sleep(3000); } // remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval) -- cgit v1.1