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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue