Fix adding/removing/replacing outfits in viewer 2

To get this to work, I had to disable the dupe link check I put in a couple of commits ago.
When the viewer adds wearables to an existing outfit, it first requests deletes of all the existing links before creating a new set.
Since these messages are async, the creates were being received before the deletes had a chance to complete, resulting in missing current outfit links.
However, the dupe check shouldn't be as important now that broken links have been fixed - it was the broken links that were causing the client to create dupes.
Tested on kokua 0.1.0 WIP and SL 2.6.3.  I now have no problems managing outfits on my standalone.
0.7.1-dev
Justin Clark-Casey (justincc) 2011-05-14 00:10:27 +01:00
parent d2aea3ef59
commit 472f7844f5
1 changed files with 27 additions and 18 deletions

View File

@ -924,9 +924,9 @@ namespace OpenSim.Region.Framework.Scenes
uint callbackID, string description, string name,
sbyte invType, sbyte type, UUID olditemID)
{
m_log.DebugFormat(
"[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}",
remoteClient.Name, name, folderID, olditemID);
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}",
// remoteClient.Name, name, folderID, olditemID);
if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
return;
@ -934,20 +934,25 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence presence;
if (TryGetScenePresence(remoteClient.AgentId, out presence))
{
bool linkAlreadyExists = false;
List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID);
foreach (InventoryItemBase item in existingItems)
if (item.AssetID == olditemID)
linkAlreadyExists = true;
if (linkAlreadyExists)
{
m_log.WarnFormat(
"[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link already exists",
remoteClient.Name, name, folderID, olditemID);
return;
}
// Disabled the check for duplicate links.
//
// When outfits are being adjusted, the viewer rapidly sends delete link messages followed by
// create links. However, since these are handled asynchronously, the deletes do not complete before
// the creates are handled. Therefore, we cannot enforce a duplicate link check.
// InventoryItemBase existingLink = null;
// List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID);
// foreach (InventoryItemBase item in existingItems)
// if (item.AssetID == olditemID)
// existingLink = item;
//
// if (existingLink != null)
// {
// m_log.WarnFormat(
// "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link named {4} with id {5} already exists",
// remoteClient.Name, name, folderID, olditemID, existingLink.Name, existingLink.ID);
//
// return;
// }
AssetBase asset = new AssetBase();
asset.FullID = olditemID;
@ -975,7 +980,11 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="itemID"></param>
private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs)
{
//m_log.Debug("[SCENE INVENTORY]: user " + remoteClient.AgentId);
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Removing inventory items {0} for {1}",
// string.Join(",", itemIDs.ConvertAll<string>(uuid => uuid.ToString()).ToArray()),
// remoteClient.Name);
InventoryService.DeleteItems(remoteClient.AgentId, itemIDs);
}