diff options
author | UbitUmarov | 2019-02-21 23:11:03 +0000 |
---|---|---|
committer | UbitUmarov | 2019-02-21 23:11:03 +0000 |
commit | bd27573130d4a40d678c81c687591708ab4e4f34 (patch) | |
tree | f757635e4dbffa158de3e8782d0676f319353e15 | |
parent | let changed allowed drop have lldetectedkey[0] return the dropped item id, Ye... (diff) | |
download | opensim-SC-bd27573130d4a40d678c81c687591708ab4e4f34.zip opensim-SC-bd27573130d4a40d678c81c687591708ab4e4f34.tar.gz opensim-SC-bd27573130d4a40d678c81c687591708ab4e4f34.tar.bz2 opensim-SC-bd27573130d4a40d678c81c687591708ab4e4f34.tar.xz |
add LSL_String osGetInventoryName(LSL_Key itemId) and LSL_String osGetInventoryDescription(LSL_String itemNameOrId)
Diffstat (limited to '')
3 files changed, 46 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 070176b..e4cc3aa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -5404,7 +5404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5404 | return 1; | 5404 | return 1; |
5405 | } | 5405 | } |
5406 | 5406 | ||
5407 | public LSL_Key osGetInventoryLastOwner(string itemNameorid) | 5407 | public LSL_Key osGetInventoryLastOwner(LSL_String itemNameorid) |
5408 | { | 5408 | { |
5409 | m_host.AddScriptLPS(1); | 5409 | m_host.AddScriptLPS(1); |
5410 | 5410 | ||
@@ -5423,5 +5423,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5423 | id= item.OwnerID; | 5423 | id= item.OwnerID; |
5424 | return id.ToString(); | 5424 | return id.ToString(); |
5425 | } | 5425 | } |
5426 | |||
5427 | public LSL_String osGetInventoryName(LSL_Key itemId) | ||
5428 | { | ||
5429 | m_host.AddScriptLPS(1); | ||
5430 | |||
5431 | TaskInventoryItem item = null; | ||
5432 | UUID itemID; | ||
5433 | if (UUID.TryParse(itemId, out itemID)) | ||
5434 | item = m_host.Inventory.GetInventoryItem(itemID); | ||
5435 | |||
5436 | if (item == null) | ||
5437 | return String.Empty; | ||
5438 | |||
5439 | return item.Name; | ||
5440 | } | ||
5441 | |||
5442 | public LSL_String osGetInventoryDescription(LSL_String itemNameorid) | ||
5443 | { | ||
5444 | m_host.AddScriptLPS(1); | ||
5445 | |||
5446 | TaskInventoryItem item = null; | ||
5447 | UUID itemID; | ||
5448 | if (UUID.TryParse(itemNameorid, out itemID)) | ||
5449 | item = m_host.Inventory.GetInventoryItem(itemID); | ||
5450 | else | ||
5451 | item = m_host.Inventory.GetInventoryItem(itemNameorid); | ||
5452 | |||
5453 | if (item == null) | ||
5454 | return String.Empty; | ||
5455 | |||
5456 | return item.Description; | ||
5457 | } | ||
5426 | } | 5458 | } |
5427 | } \ No newline at end of file | 5459 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 7277577..711108b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -547,6 +547,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
547 | LSL_Integer osApproxEquals(vector va, vector vb, LSL_Float margin); | 547 | LSL_Integer osApproxEquals(vector va, vector vb, LSL_Float margin); |
548 | LSL_Integer osApproxEquals(rotation ra, rotation rb); | 548 | LSL_Integer osApproxEquals(rotation ra, rotation rb); |
549 | LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin); | 549 | LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin); |
550 | LSL_Key osGetInventoryLastOwner(string itemNameOrId); | 550 | LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId); |
551 | LSL_String osGetInventoryName(LSL_Key itemId); | ||
552 | LSL_String osGetInventoryDescription(LSL_String itemNameOrId); | ||
551 | } | 553 | } |
552 | } | 554 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index bc64ac4..86c8ba3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -1367,10 +1367,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1367 | return m_OSSL_Functions.osApproxEquals(ra, rb, margin); | 1367 | return m_OSSL_Functions.osApproxEquals(ra, rb, margin); |
1368 | } | 1368 | } |
1369 | 1369 | ||
1370 | public LSL_Key osGetInventoryLastOwner(string itemNameOrId) | 1370 | public LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId) |
1371 | { | 1371 | { |
1372 | return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId); | 1372 | return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId); |
1373 | } | 1373 | } |
1374 | 1374 | ||
1375 | public LSL_String osGetInventoryName(LSL_Key itemId) | ||
1376 | { | ||
1377 | return m_OSSL_Functions.osGetInventoryName(itemId); | ||
1378 | } | ||
1379 | |||
1380 | public LSL_String osGetInventoryDescription(LSL_String itemNameOrId) | ||
1381 | { | ||
1382 | return m_OSSL_Functions.osGetInventoryDescription(itemNameOrId); | ||
1383 | } | ||
1375 | } | 1384 | } |
1376 | } | 1385 | } |