refactor: move DeatchObject() into the AttachmentsModule

slimupdates
Justin Clark-Casey (justincc) 2010-04-17 00:00:45 +01:00
parent ab3af43d5e
commit 26e3884237
3 changed files with 24 additions and 6 deletions

View File

@ -323,6 +323,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
}
public void DetachObject(uint objectLocalID, IClientAPI remoteClient)
{
SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID);
if (group != null)
{
//group.DetachToGround();
ShowDetachInUserInventory(group.GetFromItemID(), remoteClient);
}
}
public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient)
{
ScenePresence presence;

View File

@ -93,6 +93,16 @@ namespace OpenSim.Region.Framework.Interfaces
RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects);
/// <summary>
/// Detach an object from the avatar.
/// </summary>
///
/// This method is called in response to a client's detach request, so we only update the information in
/// inventory
/// <param name="objectLocalID"></param>
/// <param name="remoteClient"></param>
void DetachObject(uint objectLocalID, IClientAPI remoteClient);
/// <summary>
/// Detach the given item to the ground.
/// </summary>

View File

@ -2770,13 +2770,12 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void SubscribeToClientAttachmentEvents(IClientAPI client)
{
client.OnObjectDetach += m_sceneGraph.DetachObject;
if (AttachmentsModule != null)
{
client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory;
client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory;
client.OnObjectAttach += AttachmentsModule.AttachObject;
client.OnObjectDetach += AttachmentsModule.DetachObject;
client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory;
}
}
@ -2926,13 +2925,12 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client)
{
client.OnObjectDetach -= m_sceneGraph.DetachObject;
if (AttachmentsModule != null)
{
client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory;
client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory;
client.OnObjectAttach -= AttachmentsModule.AttachObject;
client.OnObjectDetach -= AttachmentsModule.DetachObject;
client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory;
}
}