remove redundant osInventoryDescription() and improve osInventoryDesc() to do the same

0.9.1.0-post-fixes
UbitUmarov 2019-02-22 22:28:47 +00:00
parent 6e05695244
commit d89a089ca2
3 changed files with 4 additions and 34 deletions

View File

@ -3889,29 +3889,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
} }
/// <summary>
/// Get the description from an inventory item
/// </summary>
/// <param name="inventoryName"></param>
/// <returns>Item description</returns>
public LSL_String osGetInventoryDesc(string item)
{
CheckThreatLevel();
lock (m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if (inv.Value.Name == item)
{
return inv.Value.Description.ToString();
}
}
}
return String.Empty;
}
/// <summary> /// <summary>
/// Invite user to the group this object is set to /// Invite user to the group this object is set to
/// </summary> /// </summary>
@ -5439,7 +5416,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return item.Name; return item.Name;
} }
public LSL_String osGetInventoryDescription(LSL_String itemNameorid) public LSL_String osGetInventoryDesc(LSL_String itemNameorid)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);

View File

@ -401,8 +401,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String osUnixTimeToTimestamp(LSL_Integer time); LSL_String osUnixTimeToTimestamp(LSL_Integer time);
LSL_String osGetInventoryDesc(string item);
LSL_Integer osInviteToGroup(LSL_Key agentId); LSL_Integer osInviteToGroup(LSL_Key agentId);
LSL_Integer osEjectFromGroup(LSL_Key agentId); LSL_Integer osEjectFromGroup(LSL_Key agentId);
@ -549,7 +547,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin); LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin);
LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId); LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId);
LSL_String osGetInventoryName(LSL_Key itemId); LSL_String osGetInventoryName(LSL_Key itemId);
LSL_String osGetInventoryDescription(LSL_String itemNameOrId); LSL_String osGetInventoryDesc(LSL_String itemNameOrId);
LSL_Key osGetLastChangedEventKey(); LSL_Key osGetLastChangedEventKey();
} }
} }

View File

@ -1060,11 +1060,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osUnixTimeToTimestamp(time); return m_OSSL_Functions.osUnixTimeToTimestamp(time);
} }
public LSL_String osGetInventoryDesc(string item)
{
return m_OSSL_Functions.osGetInventoryDesc(item);
}
public LSL_Integer osInviteToGroup(LSL_Key agentId) public LSL_Integer osInviteToGroup(LSL_Key agentId)
{ {
return m_OSSL_Functions.osInviteToGroup(agentId); return m_OSSL_Functions.osInviteToGroup(agentId);
@ -1377,9 +1372,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetInventoryName(itemId); return m_OSSL_Functions.osGetInventoryName(itemId);
} }
public LSL_String osGetInventoryDescription(LSL_String itemNameOrId) public LSL_String osGetInventoryDesc(LSL_String itemNameOrId)
{ {
return m_OSSL_Functions.osGetInventoryDescription(itemNameOrId); return m_OSSL_Functions.osGetInventoryDesc(itemNameOrId);
} }
public LSL_Key osGetLastChangedEventKey() public LSL_Key osGetLastChangedEventKey()