diff options
author | Charles Krinke | 2008-06-26 02:46:29 +0000 |
---|---|---|
committer | Charles Krinke | 2008-06-26 02:46:29 +0000 |
commit | 1cd6b71b60d093b451ba03881ee31efd3eb29a50 (patch) | |
tree | 71e51114e772d9d9121a449a684e9c7f8a8e5a16 /OpenSim/Region/ScriptEngine | |
parent | Minor refactoring of POS. Adds a Util.Clamp(x, min, max) function. (diff) | |
download | opensim-SC_OLD-1cd6b71b60d093b451ba03881ee31efd3eb29a50.zip opensim-SC_OLD-1cd6b71b60d093b451ba03881ee31efd3eb29a50.tar.gz opensim-SC_OLD-1cd6b71b60d093b451ba03881ee31efd3eb29a50.tar.bz2 opensim-SC_OLD-1cd6b71b60d093b451ba03881ee31efd3eb29a50.tar.xz |
Mantis#1594. Thank you, Melanie for a patch that:
Fixes:
- Wearable icon and name sreset to default on copy/paste
- Cache is not updated when renaming/moving folders
- Partial refactor to make inventory less dependen on AssetBase having a "Name" field
- Add llGiveInventoryList() function
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 37 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 38 |
2 files changed, 73 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index a9d1309..366b20c 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -4374,10 +4374,45 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4374 | NotImplemented("llGroundRepel"); | 4374 | NotImplemented("llGroundRepel"); |
4375 | } | 4375 | } |
4376 | 4376 | ||
4377 | private LLUUID GetTaskInventoryItem(string name) | ||
4378 | { | ||
4379 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | ||
4380 | { | ||
4381 | if(inv.Value.Name == name) | ||
4382 | return inv.Key; | ||
4383 | } | ||
4384 | return LLUUID.Zero; | ||
4385 | } | ||
4386 | |||
4377 | public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) | 4387 | public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) |
4378 | { | 4388 | { |
4379 | m_host.AddScriptLPS(1); | 4389 | m_host.AddScriptLPS(1); |
4380 | NotImplemented("llGiveInventoryList"); | 4390 | |
4391 | LLUUID destID; | ||
4392 | if(!LLUUID.TryParse(destination, out destID)) | ||
4393 | return; | ||
4394 | |||
4395 | List<LLUUID> itemList = new List<LLUUID>(); | ||
4396 | |||
4397 | foreach (Object item in inventory.Data) | ||
4398 | { | ||
4399 | LLUUID itemID; | ||
4400 | if(LLUUID.TryParse(item.ToString(), out itemID)) | ||
4401 | { | ||
4402 | itemList.Add(itemID); | ||
4403 | } | ||
4404 | else | ||
4405 | { | ||
4406 | itemID = GetTaskInventoryItem(item.ToString()); | ||
4407 | if(itemID != LLUUID.Zero) | ||
4408 | itemList.Add(itemID); | ||
4409 | } | ||
4410 | } | ||
4411 | |||
4412 | if(itemList.Count == 0) | ||
4413 | return; | ||
4414 | |||
4415 | m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList); | ||
4381 | } | 4416 | } |
4382 | 4417 | ||
4383 | public void llSetVehicleType(int type) | 4418 | public void llSetVehicleType(int type) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 57c1e02..1d4a72e 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; |
@@ -4226,10 +4227,45 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4226 | NotImplemented("llGroundRepel"); | 4227 | NotImplemented("llGroundRepel"); |
4227 | } | 4228 | } |
4228 | 4229 | ||
4230 | private LLUUID GetTaskInventoryItem(string name) | ||
4231 | { | ||
4232 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | ||
4233 | { | ||
4234 | if(inv.Value.Name == name) | ||
4235 | return inv.Key; | ||
4236 | } | ||
4237 | return LLUUID.Zero; | ||
4238 | } | ||
4239 | |||
4229 | public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) | 4240 | public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) |
4230 | { | 4241 | { |
4231 | m_host.AddScriptLPS(1); | 4242 | m_host.AddScriptLPS(1); |
4232 | NotImplemented("llGiveInventoryList"); | 4243 | |
4244 | LLUUID destID; | ||
4245 | if(!LLUUID.TryParse(destination, out destID)) | ||
4246 | return; | ||
4247 | |||
4248 | List<LLUUID> itemList = new List<LLUUID>(); | ||
4249 | |||
4250 | foreach (Object item in inventory.Data) | ||
4251 | { | ||
4252 | LLUUID itemID; | ||
4253 | if(LLUUID.TryParse(item.ToString(), out itemID)) | ||
4254 | { | ||
4255 | itemList.Add(itemID); | ||
4256 | } | ||
4257 | else | ||
4258 | { | ||
4259 | itemID = GetTaskInventoryItem(item.ToString()); | ||
4260 | if(itemID != LLUUID.Zero) | ||
4261 | itemList.Add(itemID); | ||
4262 | } | ||
4263 | } | ||
4264 | |||
4265 | if(itemList.Count == 0) | ||
4266 | return; | ||
4267 | |||
4268 | m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList); | ||
4233 | } | 4269 | } |
4234 | 4270 | ||
4235 | public void llSetVehicleType(int type) | 4271 | public void llSetVehicleType(int type) |