aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorCharles Krinke2008-06-24 21:23:28 +0000
committerCharles Krinke2008-06-24 21:23:28 +0000
commitdc0d089bf504aac293d669988e4b4bdb0e1355c0 (patch)
tree63591d3f2c49cf22c0605d7a7ace5a46dd7fef44 /OpenSim/Region/ScriptEngine
parent* Applied patch from Melanie, mantis issue #1581 - "Refactor LSL language, ap... (diff)
downloadopensim-SC_OLD-dc0d089bf504aac293d669988e4b4bdb0e1355c0.zip
opensim-SC_OLD-dc0d089bf504aac293d669988e4b4bdb0e1355c0.tar.gz
opensim-SC_OLD-dc0d089bf504aac293d669988e4b4bdb0e1355c0.tar.bz2
opensim-SC_OLD-dc0d089bf504aac293d669988e4b4bdb0e1355c0.tar.xz
Mantis#5189. Thank you kindly, Matth for your patch
to add the beginnings of llGiveInventory().
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs39
1 files changed, 38 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 6f4e481..a4e473d 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -35,6 +35,7 @@ using Nini.Config;
35using Axiom.Math; 35using Axiom.Math;
36using libsecondlife; 36using libsecondlife;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications.Cache;
38using OpenSim.Region.Environment; 39using OpenSim.Region.Environment;
39using OpenSim.Region.Environment.Interfaces; 40using OpenSim.Region.Environment.Interfaces;
40using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; 41using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney;
@@ -2696,7 +2697,43 @@ namespace OpenSim.Region.ScriptEngine.Common
2696 public void llGiveInventory(string destination, string inventory) 2697 public void llGiveInventory(string destination, string inventory)
2697 { 2698 {
2698 m_host.AddScriptLPS(1); 2699 m_host.AddScriptLPS(1);
2699 NotImplemented("llGiveInventory not yet oh no!"); 2700 bool found = false;
2701 LLUUID destId = LLUUID.Zero;
2702 LLUUID objId = LLUUID.Zero;
2703
2704 if(!LLUUID.TryParse(destination, out destId))
2705 {
2706 llSay(0, "Could not parse key " + destination);
2707 return;
2708 }
2709
2710 // move the first object found with this inventory name
2711 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
2712 {
2713 if (inv.Value.Name == inventory)
2714 {
2715 found = true;
2716 objId = inv.Key;
2717 break;
2718 }
2719 }
2720
2721 // check if destination is an avatar
2722 if (World.GetScenePresence(destId) != null)
2723 {
2724 // destination is an avatar
2725 CachedUserInfo userInfo =
2726 World.CommsManager.UserProfileCacheService.GetUserDetails(destId);
2727 World.MoveTaskInventoryItem(destId,userInfo.RootFolder.ID, m_host, objId);
2728 }
2729 else
2730 {
2731 // destination is an object
2732 World.CopyTaskInventoryItem(destId, m_host, objId);
2733 }
2734
2735 if (!found)
2736 llSay(0, "Could not find object " + inventory);
2700 } 2737 }
2701 2738
2702 public void llRemoveInventory(string item) 2739 public void llRemoveInventory(string item)