From ff098ae110bb3175fe6a7bf37a03e3f22eb829e3 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 13 Sep 2010 20:44:32 +0100
Subject: minor: Clean up log messages generated when an item is attached
---
OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Attachments')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 5604f49..a3712d1 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -218,14 +218,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
{
- m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
-
return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true);
}
public UUID RezSingleAttachmentFromInventory(
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
{
+ m_log.DebugFormat(
+ "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}",
+ (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name);
+
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt);
if (updateInventoryStatus)
--
cgit v1.1
From 366de0a7b57919625429db571f4ed4a231f043da Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 13 Sep 2010 20:58:50 +0100
Subject: If attachment fails (e.g. because asset wasn't found) then don't try
to set attachment as shown in inventory
Doing this results in a null reference exception
---
OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Attachments')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index a3712d1..b7ecb55 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -233,11 +233,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (updateInventoryStatus)
{
if (att == null)
- {
ShowDetachInUserInventory(itemID, remoteClient);
- }
-
- SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt);
+ else
+ SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt);
}
if (null == att)
--
cgit v1.1
From cd153a20b7e50edfa6a8c0098a456876b3088adf Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 13 Sep 2010 21:05:03 +0100
Subject: Remove IAttachmentsModule.SetAttachmentInventoryStatus() from public
interface
No core module is calling and it makes more sense to call methods such as AttachObject() which attach both to the avatar and update inventory appropriately
---
.../Avatar/Attachments/AttachmentsModule.cs | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Attachments')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index b7ecb55..fe19099 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -300,12 +300,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
return null;
}
- public UUID SetAttachmentInventoryStatus(
+ ///
+ /// Update the user inventory to the attachment of an item
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected UUID SetAttachmentInventoryStatus(
SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
{
- m_log.DebugFormat(
- "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
- remoteClient.Name, att.Name, itemID);
+// m_log.DebugFormat(
+// "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
+// remoteClient.Name, att.Name, itemID);
if (!att.IsDeleted)
AttachmentPt = att.RootPart.AttachmentPoint;
@@ -387,7 +395,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// Save avatar attachment information
if (m_scene.AvatarFactory != null)
{
- m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
+ m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
}
}
--
cgit v1.1
From ae1a0150a1951d8cee67b253aa63301fdafbff89 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 13 Sep 2010 21:15:12 +0100
Subject: Rename now protected method SetAttachmentInventoryStatus() to
ShowAttachInUserInventory() to match ShowDetachInUserInventory()
---
.../Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Avatar/Attachments')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index fe19099..1ebac42 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
itemID = group.GetFromItemID();
}
- SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group);
+ ShowAttachInUserInventory(remoteClient, AttachmentPt, itemID, group);
AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
}
@@ -235,7 +235,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (att == null)
ShowDetachInUserInventory(itemID, remoteClient);
else
- SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt);
+ ShowAttachInUserInventory(att, remoteClient, itemID, AttachmentPt);
}
if (null == att)
@@ -308,7 +308,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
///
///
///
- protected UUID SetAttachmentInventoryStatus(
+ protected UUID ShowAttachInUserInventory(
SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
{
// m_log.DebugFormat(
@@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
///
///
///
- public void SetAttachmentInventoryStatus(
+ protected void ShowAttachInUserInventory(
IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
{
// m_log.DebugFormat(
--
cgit v1.1