a few test changes

This commit is contained in:
UbitUmarov
2023-03-09 08:26:12 +00:00
parent eb57c75f00
commit b1f2a5b661
4 changed files with 62 additions and 4 deletions

View File

@@ -186,7 +186,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (folder is null || folder.Owner.NotEqual(remoteClient.AgentId))
return;
if (transactionID.IsNotZero() && assetType != (byte)AssetType.Settings)
if (transactionID.IsNotZero() &&
assetType != (byte)AssetType.Settings &&
assetType != (byte)AssetType.Material)
{
IAgentAssetTransactions agentTransactions = m_Scene.AgentTransactionsModule;
if (agentTransactions is not null)
@@ -395,8 +397,22 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return UUID.Zero;
}
UUID mid = data is null ? Util.ComputeSHA1UUID(UUID.ZeroString) : Util.ComputeSHA1UUID(data);
// this may be bad
if (mid.Equals(item.AssetID))
return mid;
AssetBase matasset = new(mid, item.Name, (sbyte)item.AssetType, remoteClient.AgentId.ToString())
{
Description = item.Description,
Data = data ?? (new byte[1])
};
item.AssetID = matasset.FullID;
m_Scene.AssetService.Store(matasset);
m_Scene.InventoryService.UpdateItem(item);
remoteClient.SendAlertMessage("Material updated");
break;
return matasset.FullID;
}
}