mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
Fix avatar parameter updating for viewer 3 and maybe 2.
When a slider parameter is changed, the viewer uploads a new shape (or other asset) and the item is updated to point to it. Viewer 1 uploaded the data in the initial request itself, so the asset references was almost always correctly updated. However, viewer 3/2 always uploads data in a subsequent xfer, which exposed a race condition where the viewer would make the item update before the asset had uploaded. This commit shuffles the order of operations to avoid this race, the item is updated with the new asset id instead of the old one while the upload was still taking place. A second race had to be fixed where avatar appearance would also be updated with the old asset id rather than the new one. This was fixed by updating the avatar appearance ids when the appearance was actually saved, rather than when the wearables update was made.
This commit is contained in:
@@ -172,11 +172,12 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
/// <summary>
|
||||
/// Update an inventory item with data that has been received through a
|
||||
/// transaction.
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is called when clothing or body parts are updated (for
|
||||
/// instance, with new textures or colours). It may also be called in
|
||||
/// other situations.
|
||||
/// </summary>
|
||||
/// </remarks>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="transactionID"></param>
|
||||
/// <param name="item"></param>
|
||||
@@ -184,14 +185,12 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
UUID transactionID, InventoryItemBase item)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[TRANSACTIONS MANAGER] Called HandleItemUpdateFromTransaction with item {0}",
|
||||
// "[ASSET TRANSACTION MODULE]: Called HandleItemUpdateFromTransaction with item {0}",
|
||||
// item.Name);
|
||||
|
||||
AgentAssetTransactions transactions =
|
||||
GetUserTransactions(remoteClient.AgentId);
|
||||
AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId);
|
||||
|
||||
transactions.RequestUpdateInventoryItem(remoteClient,
|
||||
transactionID, item);
|
||||
transactions.RequestUpdateInventoryItem(remoteClient, transactionID, item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -255,11 +254,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
}
|
||||
}
|
||||
|
||||
AgentAssetTransactions transactions =
|
||||
GetUserTransactions(remoteClient.AgentId);
|
||||
|
||||
AssetXferUploader uploader =
|
||||
transactions.RequestXferUploader(transaction);
|
||||
AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId);
|
||||
AssetXferUploader uploader = transactions.RequestXferUploader(transaction, assetID);
|
||||
|
||||
if (uploader != null)
|
||||
{
|
||||
@@ -279,9 +275,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
public void HandleXfer(IClientAPI remoteClient, ulong xferID,
|
||||
uint packetID, byte[] data)
|
||||
{
|
||||
//m_log.Debug("xferID: " + xferID + " packetID: " + packetID + " data!");
|
||||
AgentAssetTransactions transactions =
|
||||
GetUserTransactions(remoteClient.AgentId);
|
||||
// m_log.Debug("xferID: " + xferID + " packetID: " + packetID + " data length " + data.Length);
|
||||
AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId);
|
||||
|
||||
transactions.HandleXfer(xferID, packetID, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user