mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
refactor: Move another RezSingleAttachment() from Scene.Inventory to AttachmentsModule
This commit is contained in:
@@ -1842,35 +1842,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
EventManager.TriggerOnAttach(localID, itemID, avatarID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the client receives a request to rez a single attachment on to the avatar from inventory
|
||||
/// (RezSingleAttachmentFromInv packet).
|
||||
/// </summary>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="itemID"></param>
|
||||
/// <param name="AttachmentPt"></param>
|
||||
/// <returns></returns>
|
||||
public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
{
|
||||
m_log.DebugFormat("[USER INVENTORY]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
|
||||
|
||||
SceneObjectGroup att = AttachmentsModule.RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt);
|
||||
|
||||
if (att == null)
|
||||
{
|
||||
AttachmentsModule.ShowDetachInUserInventory(itemID, remoteClient);
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
return AttachmentsModule.SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt);
|
||||
}
|
||||
|
||||
public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
|
||||
RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects)
|
||||
{
|
||||
foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects)
|
||||
{
|
||||
RezSingleAttachment(remoteClient, obj.ItemID, obj.AttachmentPt);
|
||||
AttachmentsModule.RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2642,13 +2642,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
public virtual void SubscribeToClientAttachmentEvents(IClientAPI client)
|
||||
{
|
||||
client.OnRezSingleAttachmentFromInv += RezSingleAttachment;
|
||||
{
|
||||
client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments;
|
||||
client.OnObjectDetach += m_sceneGraph.DetachObject;
|
||||
|
||||
if (AttachmentsModule != null)
|
||||
{
|
||||
client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory;
|
||||
client.OnObjectAttach += AttachmentsModule.AttachObject;
|
||||
client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory;
|
||||
}
|
||||
@@ -2799,12 +2799,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client)
|
||||
{
|
||||
client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments;
|
||||
client.OnRezSingleAttachmentFromInv -= RezSingleAttachment;
|
||||
client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments;
|
||||
client.OnObjectDetach -= m_sceneGraph.DetachObject;
|
||||
|
||||
if (AttachmentsModule != null)
|
||||
{
|
||||
client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory;
|
||||
client.OnObjectAttach -= AttachmentsModule.AttachObject;
|
||||
client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory;
|
||||
}
|
||||
|
||||
@@ -3738,7 +3738,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (null == m_appearance)
|
||||
{
|
||||
m_log.WarnFormat("[ATTACHMENT] Appearance has not been initialized for agent {0}", UUID);
|
||||
m_log.WarnFormat("[ATTACHMENT]: Appearance has not been initialized for agent {0}", UUID);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3762,12 +3762,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
try
|
||||
{
|
||||
// Rez from inventory
|
||||
UUID asset = m_scene.RezSingleAttachment(ControllingClient,
|
||||
itemID, (uint)p);
|
||||
|
||||
m_log.InfoFormat("[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2} ({3})",
|
||||
p, itemID, assetID, asset);
|
||||
UUID asset
|
||||
= m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2} ({3})",
|
||||
p, itemID, assetID, asset);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user