diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 45 |
1 files changed, 43 insertions, 2 deletions
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 | |||
4660 | public void llSetRemoteScriptAccessPin(int pin) | 4660 | public void llSetRemoteScriptAccessPin(int pin) |
4661 | { | 4661 | { |
4662 | m_host.AddScriptLPS(1); | 4662 | m_host.AddScriptLPS(1); |
4663 | NotImplemented("llSetRemoteScriptAccessPin"); | 4663 | |
4664 | m_host.ScriptAccessPin = pin; | ||
4664 | } | 4665 | } |
4665 | 4666 | ||
4666 | public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) | 4667 | public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) |
4667 | { | 4668 | { |
4668 | m_host.AddScriptLPS(1); | 4669 | m_host.AddScriptLPS(1); |
4669 | NotImplemented("llRemoteLoadScriptPin"); | 4670 | bool found = false; |
4671 | LLUUID destId = LLUUID.Zero; | ||
4672 | LLUUID srcId = LLUUID.Zero; | ||
4673 | |||
4674 | if (!LLUUID.TryParse(target, out destId)) | ||
4675 | { | ||
4676 | llSay(0, "Could not parse key " + target); | ||
4677 | return; | ||
4678 | } | ||
4679 | |||
4680 | // target must be a different prim than the one containing the script | ||
4681 | if (m_host.UUID == destId) | ||
4682 | { | ||
4683 | return; | ||
4684 | } | ||
4685 | |||
4686 | // copy the first script found with this inventory name | ||
4687 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | ||
4688 | { | ||
4689 | if (inv.Value.Name == name) | ||
4690 | { | ||
4691 | // make sure the object is a script | ||
4692 | if(10 == inv.Value.Type) | ||
4693 | { | ||
4694 | found = true; | ||
4695 | srcId = inv.Key; | ||
4696 | break; | ||
4697 | } | ||
4698 | } | ||
4699 | } | ||
4700 | |||
4701 | if (!found) | ||
4702 | { | ||
4703 | llSay(0, "Could not find script " + name); | ||
4704 | return; | ||
4705 | } | ||
4706 | |||
4707 | // the rest of the permission checks are done in RezScript, so check the pin there as well | ||
4708 | World.RezScript(srcId, m_host, destId, pin, running, start_param); | ||
4709 | // this will cause the delay even if the script pin or permissions were wrong - seems ok | ||
4710 | System.Threading.Thread.Sleep(3000); | ||
4670 | } | 4711 | } |
4671 | 4712 | ||
4672 | // remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval) | 4713 | // remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval) |