diff options
author | UbitUmarov | 2019-08-16 21:22:16 +0100 |
---|---|---|
committer | UbitUmarov | 2019-08-16 21:24:07 +0100 |
commit | 64c56fc52bec87395574ba07bd13d7cdde042ff0 (patch) | |
tree | 2f2a1a2ea856ac34fe79f232e565a3856690d815 /OpenSim/Region/ScriptEngine | |
parent | move file HGworldMapModule to where it belongs( runprebuild) (diff) | |
download | opensim-SC-64c56fc52bec87395574ba07bd13d7cdde042ff0.zip opensim-SC-64c56fc52bec87395574ba07bd13d7cdde042ff0.tar.gz opensim-SC-64c56fc52bec87395574ba07bd13d7cdde042ff0.tar.bz2 opensim-SC-64c56fc52bec87395574ba07bd13d7cdde042ff0.tar.xz |
mantis 8577: add key osGetInventoryItemKey(string name) to get a inventory item ID within prim inventory. the llGetInventory does return the asset it, not item.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
4 files changed, 26 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 62da221..6ee83ae 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -5479,6 +5479,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5479 | return id.ToString(); | 5479 | return id.ToString(); |
5480 | } | 5480 | } |
5481 | 5481 | ||
5482 | public LSL_Key osGetInventoryItemKey(LSL_String name) | ||
5483 | { | ||
5484 | m_host.AddScriptLPS(1); | ||
5485 | |||
5486 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); | ||
5487 | |||
5488 | if (item == null) | ||
5489 | return UUID.Zero.ToString(); | ||
5490 | |||
5491 | if ((item.CurrentPermissions | ||
5492 | & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) | ||
5493 | == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) | ||
5494 | { | ||
5495 | return item.ItemID.ToString(); | ||
5496 | } | ||
5497 | |||
5498 | return UUID.Zero.ToString(); | ||
5499 | } | ||
5500 | |||
5482 | public LSL_String osGetInventoryName(LSL_Key itemId) | 5501 | public LSL_String osGetInventoryName(LSL_Key itemId) |
5483 | { | 5502 | { |
5484 | m_host.AddScriptLPS(1); | 5503 | m_host.AddScriptLPS(1); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 7c5ced8..c65b785 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -549,6 +549,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
549 | LSL_Integer osApproxEquals(rotation ra, rotation rb); | 549 | LSL_Integer osApproxEquals(rotation ra, rotation rb); |
550 | LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin); | 550 | LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin); |
551 | LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId); | 551 | LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId); |
552 | LSL_Key osGetInventoryItemKey(LSL_String name); | ||
552 | LSL_String osGetInventoryName(LSL_Key itemId); | 553 | LSL_String osGetInventoryName(LSL_Key itemId); |
553 | LSL_String osGetInventoryDesc(LSL_String itemNameOrId); | 554 | LSL_String osGetInventoryDesc(LSL_String itemNameOrId); |
554 | LSL_Key osGetLastChangedEventKey(); | 555 | LSL_Key osGetLastChangedEventKey(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index f93cea8..1d39e70 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
35 | public partial class ScriptBaseClass | 35 | public partial class ScriptBaseClass |
36 | { | 36 | { |
37 | // SCRIPTS CONSTANTS | 37 | // SCRIPTS CONSTANTS |
38 | public static readonly LSLInteger OS_APIVERSION = 5; | 38 | public static readonly LSLInteger OS_APIVERSION = 6; |
39 | 39 | ||
40 | public static readonly LSLInteger TRUE = 1; | 40 | public static readonly LSLInteger TRUE = 1; |
41 | public static readonly LSLInteger FALSE = 0; | 41 | public static readonly LSLInteger FALSE = 0; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 6a70305..12c63b3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -1382,6 +1382,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1382 | return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId); | 1382 | return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId); |
1383 | } | 1383 | } |
1384 | 1384 | ||
1385 | public LSL_Key osGetInventoryItemKey(LSL_String name) | ||
1386 | { | ||
1387 | return m_OSSL_Functions.osGetInventoryItemKey(name); | ||
1388 | } | ||
1389 | |||
1385 | public LSL_String osGetInventoryName(LSL_Key itemId) | 1390 | public LSL_String osGetInventoryName(LSL_Key itemId) |
1386 | { | 1391 | { |
1387 | return m_OSSL_Functions.osGetInventoryName(itemId); | 1392 | return m_OSSL_Functions.osGetInventoryName(itemId); |