Simplify updating of agent inventory assets. Make newly created asset IDs
random rather than using IDs known by the client ahead of time.avinationmerge
parent
349767f8a2
commit
f41dfbabc8
|
@ -149,10 +149,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||||
|
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
asset.FullID = UUID.Random();
|
||||||
"[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}",
|
|
||||||
item.Name, part.Name, transactionID);
|
|
||||||
|
|
||||||
asset.Name = item.Name;
|
asset.Name = item.Name;
|
||||||
asset.Description = item.Description;
|
asset.Description = item.Description;
|
||||||
asset.Type = (sbyte)item.Type;
|
asset.Type = (sbyte)item.Type;
|
||||||
|
@ -170,20 +167,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||||
{
|
{
|
||||||
if (XferUploaders.ContainsKey(transactionID))
|
if (XferUploaders.ContainsKey(transactionID))
|
||||||
{
|
{
|
||||||
UUID assetID = UUID.Combine(transactionID,
|
AssetBase asset = GetTransactionAsset(transactionID);
|
||||||
remoteClient.SecureSessionId);
|
|
||||||
|
|
||||||
AssetBase asset = m_Scene.AssetService.Get(
|
if (asset != null)
|
||||||
assetID.ToString());
|
|
||||||
|
|
||||||
if (asset == null)
|
|
||||||
{
|
{
|
||||||
asset = GetTransactionAsset(transactionID);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (asset != null && asset.FullID == assetID)
|
|
||||||
{
|
|
||||||
// Assets never get updated, new ones get created
|
|
||||||
asset.FullID = UUID.Random();
|
asset.FullID = UUID.Random();
|
||||||
asset.Name = item.Name;
|
asset.Name = item.Name;
|
||||||
asset.Description = item.Description;
|
asset.Description = item.Description;
|
||||||
|
@ -191,10 +178,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||||
item.AssetID = asset.FullID;
|
item.AssetID = asset.FullID;
|
||||||
|
|
||||||
m_Scene.AssetService.Store(asset);
|
m_Scene.AssetService.Store(asset);
|
||||||
}
|
|
||||||
|
|
||||||
IInventoryService invService = m_Scene.InventoryService;
|
IInventoryService invService = m_Scene.InventoryService;
|
||||||
invService.UpdateItem(item);
|
invService.UpdateItem(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue