mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
a few , mostly cosmetic, changes to osSetTerrainTextures and add prim inventory osSetTerrainTextures with a list of possible asset types to match
This commit is contained in:
@@ -1075,12 +1075,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return item;
|
||||
}
|
||||
|
||||
public TaskInventoryItem GetInventoryItem(string name)
|
||||
public TaskInventoryItem GetInventoryItem(ReadOnlySpan<char> name)
|
||||
{
|
||||
m_items.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (item.Name == name)
|
||||
if (name.Equals(item.Name, StringComparison.Ordinal))
|
||||
{
|
||||
m_items.LockItemsForRead(false);
|
||||
return item;
|
||||
@@ -1091,12 +1091,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return null;
|
||||
}
|
||||
|
||||
public TaskInventoryItem GetInventoryItem(string name, int type)
|
||||
public TaskInventoryItem GetInventoryItem(ReadOnlySpan<char> name, int type)
|
||||
{
|
||||
m_items.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (item.Type == type && item.Name == name)
|
||||
if (item.Type == type && name.Equals(item.Name, StringComparison.Ordinal))
|
||||
{
|
||||
m_items.LockItemsForRead(false);
|
||||
return item;
|
||||
@@ -1107,15 +1107,41 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<TaskInventoryItem> GetInventoryItems(string name)
|
||||
public TaskInventoryItem GetInventoryItem(ReadOnlySpan<char> name, ReadOnlySpan<int> types)
|
||||
{
|
||||
List<TaskInventoryItem> items = new List<TaskInventoryItem>();
|
||||
if(types.Length == 0)
|
||||
return null;
|
||||
m_items.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (name.Equals(item.Name, StringComparison.Ordinal))
|
||||
{
|
||||
int type = item.Type;
|
||||
int i = 0;
|
||||
do
|
||||
{
|
||||
if(type == types[i])
|
||||
{
|
||||
m_items.LockItemsForRead(false);
|
||||
return item;
|
||||
}
|
||||
i++;
|
||||
}while(i < types.Length);
|
||||
}
|
||||
}
|
||||
m_items.LockItemsForRead(false);
|
||||
|
||||
return null;
|
||||
}
|
||||
public List<TaskInventoryItem> GetInventoryItems(ReadOnlySpan<char> name)
|
||||
{
|
||||
List<TaskInventoryItem> items = [];
|
||||
|
||||
m_items.LockItemsForRead(true);
|
||||
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (item.Name == name)
|
||||
if (name.Equals(item.Name, StringComparison.Ordinal))
|
||||
items.Add(item);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user