Attachment persistence!!! Patch #9170 (Mantis #1171)

Attachments now persist across logouts. Mostly untested.
This commit is contained in:
Melanie Thielker
2008-08-19 07:11:58 +00:00
parent b4355e4564
commit 29530f3029
4 changed files with 61 additions and 16 deletions

View File

@@ -528,22 +528,26 @@ namespace OpenSim.Framework
m_attachments[attachpoint][1] = asset;
}
public void DetachAttachment(LLUUID itemID)
public int GetAttachpoint(LLUUID itemID)
{
int attachpoint = 0;
foreach (KeyValuePair<int, LLUUID[]> kvp in m_attachments)
{
if(kvp.Value[0] == itemID)
{
attachpoint = kvp.Key;
break;
return kvp.Key;
}
}
return 0;
}
public void DetachAttachment(LLUUID itemID)
{
int attachpoint = GetAttachpoint(itemID);
if(attachpoint > 0)
m_attachments.Remove(attachpoint);
}
string GetAttachmentsString()
{
List<string> strings = new List<string>();

View File

@@ -47,11 +47,15 @@ namespace OpenSim.Framework.Communications.Cache
internal delegate void SendInventoryDescendentsDelegate(
IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems);
public delegate void OnItemReceivedDelegate(LLUUID itemID);
/// <summary>
/// Stores user profile and inventory data received from backend services for a particular user.
/// </summary>
public class CachedUserInfo
{
public event OnItemReceivedDelegate OnItemReceived;
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -306,6 +310,9 @@ namespace OpenSim.Framework.Communications.Cache
{
folder.Items[itemInfo.ID] = itemInfo;
}
if (OnItemReceived != null)
OnItemReceived(itemInfo.ID);
}
/// <summary>