refactor: move DeatchObject() into the AttachmentsModule
parent
ab3af43d5e
commit
26e3884237
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -2769,14 +2769,13 @@ 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;
|
||||
}
|
||||
}
|
||||
|
@ -2925,14 +2924,13 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue