add LSL_String osGetInventoryName(LSL_Key itemId) and LSL_String osGetInventoryDescription(LSL_String itemNameOrId)

0.9.1.0-post-fixes
UbitUmarov 2019-02-21 23:11:03 +00:00
parent ece3843798
commit bd27573130
3 changed files with 46 additions and 3 deletions

View File

@ -5404,7 +5404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 1; return 1;
} }
public LSL_Key osGetInventoryLastOwner(string itemNameorid) public LSL_Key osGetInventoryLastOwner(LSL_String itemNameorid)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -5423,5 +5423,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
id= item.OwnerID; id= item.OwnerID;
return id.ToString(); return id.ToString();
} }
public LSL_String osGetInventoryName(LSL_Key itemId)
{
m_host.AddScriptLPS(1);
TaskInventoryItem item = null;
UUID itemID;
if (UUID.TryParse(itemId, out itemID))
item = m_host.Inventory.GetInventoryItem(itemID);
if (item == null)
return String.Empty;
return item.Name;
}
public LSL_String osGetInventoryDescription(LSL_String itemNameorid)
{
m_host.AddScriptLPS(1);
TaskInventoryItem item = null;
UUID itemID;
if (UUID.TryParse(itemNameorid, out itemID))
item = m_host.Inventory.GetInventoryItem(itemID);
else
item = m_host.Inventory.GetInventoryItem(itemNameorid);
if (item == null)
return String.Empty;
return item.Description;
}
} }
} }

View File

@ -547,6 +547,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer osApproxEquals(vector va, vector vb, LSL_Float margin); LSL_Integer osApproxEquals(vector va, vector vb, LSL_Float margin);
LSL_Integer osApproxEquals(rotation ra, rotation rb); LSL_Integer osApproxEquals(rotation ra, rotation rb);
LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin); LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin);
LSL_Key osGetInventoryLastOwner(string itemNameOrId); LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId);
LSL_String osGetInventoryName(LSL_Key itemId);
LSL_String osGetInventoryDescription(LSL_String itemNameOrId);
} }
} }

View File

@ -1367,10 +1367,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osApproxEquals(ra, rb, margin); return m_OSSL_Functions.osApproxEquals(ra, rb, margin);
} }
public LSL_Key osGetInventoryLastOwner(string itemNameOrId) public LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId)
{ {
return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId); return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId);
} }
public LSL_String osGetInventoryName(LSL_Key itemId)
{
return m_OSSL_Functions.osGetInventoryName(itemId);
}
public LSL_String osGetInventoryDescription(LSL_String itemNameOrId)
{
return m_OSSL_Functions.osGetInventoryDescription(itemNameOrId);
}
} }
} }