refactor: Move DetachSingleAttachmentToInv to region module

need to rationalize method names later
This commit is contained in:
Justin Clark-Casey (justincc)
2010-03-06 00:07:47 +00:00
parent e7422fe9b2
commit 395f343498
6 changed files with 82 additions and 78 deletions

View File

@@ -1858,7 +1858,7 @@ namespace OpenSim.Region.Framework.Scenes
if (att == null)
{
DetachSingleAttachmentToInv(itemID, remoteClient);
AttachmentsModule.ShowDetachInUserInventory(itemID, remoteClient);
return UUID.Zero;
}
@@ -1904,24 +1904,6 @@ namespace OpenSim.Region.Framework.Scenes
SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero);
}
public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient)
{
ScenePresence presence;
if (TryGetAvatar(remoteClient.AgentId, out presence))
{
presence.Appearance.DetachAttachment(itemID);
// Save avatar attachment information
if (m_AvatarFactory != null)
{
m_log.Info("[SCENE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", ItemID: " + itemID);
m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
}
}
m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient);
}
public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
{
EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID);