diff options
author | Charles Krinke | 2008-06-24 23:55:33 +0000 |
---|---|---|
committer | Charles Krinke | 2008-06-24 23:55:33 +0000 |
commit | f6bf4c39be634bb8d1a03de5fd048edc54b7df50 (patch) | |
tree | fd178392c1ab29cb7b729a85811c34b7686e5dd2 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Mantis#5189. Thank you kindly, Matth for your patch (diff) | |
download | opensim-SC-f6bf4c39be634bb8d1a03de5fd048edc54b7df50.zip opensim-SC-f6bf4c39be634bb8d1a03de5fd048edc54b7df50.tar.gz opensim-SC-f6bf4c39be634bb8d1a03de5fd048edc54b7df50.tar.bz2 opensim-SC-f6bf4c39be634bb8d1a03de5fd048edc54b7df50.tar.xz |
Mantis#1587. Thank you kindly, Melanie for a patch that:
Add permissions magling to llGiveInventoryItem,
correct some corner case functionality
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7832633..7c6bcf7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -36,6 +36,7 @@ using Axiom.Math; | |||
36 | using libsecondlife; | 36 | using libsecondlife; |
37 | using OpenSim; | 37 | using OpenSim; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications.Cache; | ||
39 | using OpenSim.Region.Environment; | 40 | using OpenSim.Region.Environment; |
40 | using OpenSim.Region.Environment.Interfaces; | 41 | using OpenSim.Region.Environment.Interfaces; |
41 | using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; | 42 | using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; |
@@ -2549,7 +2550,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2549 | public void llGiveInventory(string destination, string inventory) | 2550 | public void llGiveInventory(string destination, string inventory) |
2550 | { | 2551 | { |
2551 | m_host.AddScriptLPS(1); | 2552 | m_host.AddScriptLPS(1); |
2552 | NotImplemented("llGiveInventory"); | 2553 | bool found = false; |
2554 | LLUUID destId = LLUUID.Zero; | ||
2555 | LLUUID objId = LLUUID.Zero; | ||
2556 | |||
2557 | if(!LLUUID.TryParse(destination, out destId)) | ||
2558 | { | ||
2559 | llSay(0, "Could not parse key " + destination); | ||
2560 | return; | ||
2561 | } | ||
2562 | |||
2563 | // move the first object found with this inventory name | ||
2564 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | ||
2565 | { | ||
2566 | if (inv.Value.Name == inventory) | ||
2567 | { | ||
2568 | found = true; | ||
2569 | objId = inv.Key; | ||
2570 | break; | ||
2571 | } | ||
2572 | } | ||
2573 | |||
2574 | // check if destination is an avatar | ||
2575 | if (World.GetScenePresence(destId) != null) | ||
2576 | { | ||
2577 | // destination is an avatar | ||
2578 | CachedUserInfo userInfo = | ||
2579 | World.CommsManager.UserProfileCacheService.GetUserDetails(destId); | ||
2580 | World.MoveTaskInventoryItem(destId,userInfo.RootFolder.ID, m_host, objId); | ||
2581 | } | ||
2582 | else | ||
2583 | { | ||
2584 | // destination is an object | ||
2585 | World.MoveTaskInventoryItem(destId, m_host, objId); | ||
2586 | } | ||
2587 | |||
2588 | if (!found) | ||
2589 | llSay(0, "Could not find object " + inventory); | ||
2553 | } | 2590 | } |
2554 | 2591 | ||
2555 | public void llRemoveInventory(string item) | 2592 | public void llRemoveInventory(string item) |