aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2010-04-23 14:41:20 +0200
committerMelanie Thielker2010-04-23 14:41:20 +0200
commit780630d7c05f7306ffceb52db0eda1401112f426 (patch)
treeec66c7e8e1bd3b94e543d87e389d23753bda2dd8 /OpenSim/Region
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC_OLD-780630d7c05f7306ffceb52db0eda1401112f426.zip
opensim-SC_OLD-780630d7c05f7306ffceb52db0eda1401112f426.tar.gz
opensim-SC_OLD-780630d7c05f7306ffceb52db0eda1401112f426.tar.bz2
opensim-SC_OLD-780630d7c05f7306ffceb52db0eda1401112f426.tar.xz
Fix a nullref in attachment handling. Add some debug to find the attachment
state issue
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs6
4 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 354994b..a667b80 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -271,7 +271,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
271 if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) 271 if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
272 { 272 {
273 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); 273 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
274 item = m_scene.InventoryService.GetItem(item); 274 if (m_scene.InventoryService != null)
275 item = m_scene.InventoryService.GetItem(item);
275 276
276 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); 277 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
277 } 278 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index e6e414f..44fd2e1 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1628,6 +1628,7 @@ namespace OpenSim.Region.Framework.Scenes
1628 remoteClient.AgentId); 1628 remoteClient.AgentId);
1629 AssetService.Store(asset); 1629 AssetService.Store(asset);
1630 1630
1631 m_log.DebugFormat("[ScriptState]: Saved attachment as asset {0}", asset.FullID);
1631 item.AssetID = asset.FullID; 1632 item.AssetID = asset.FullID;
1632 item.Description = asset.Description; 1633 item.Description = asset.Description;
1633 item.Name = asset.Name; 1634 item.Name = asset.Name;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 84c3719..1f8c732 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -612,6 +612,7 @@ namespace OpenSim.Region.Framework.Scenes
612 { 612 {
613 UUID itemid = new UUID(node.Attributes["UUID"].Value); 613 UUID itemid = new UUID(node.Attributes["UUID"].Value);
614 m_savedScriptState.Add(itemid, node.InnerXml); 614 m_savedScriptState.Add(itemid, node.InnerXml);
615 m_log.DebugFormat("[ScriptState]: Retrieved state for script item ID {0}", itemid.ToString());
615 } 616 }
616 } 617 }
617 } 618 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 04df35a..ce4802d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -333,8 +333,10 @@ namespace OpenSim.Region.Framework.Scenes
333 if (engines == null) // No engine at all 333 if (engines == null) // No engine at all
334 return; 334 return;
335 335
336 m_log.DebugFormat("[ScriptState]: Item ID changed: {0} to {1}", oldID, newID);
336 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) 337 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID))
337 { 338 {
339 m_log.DebugFormat("[ScriptState]: Found script state for {0}, applying to new script item {1}", oldID, newID);
338 XmlDocument doc = new XmlDocument(); 340 XmlDocument doc = new XmlDocument();
339 341
340 doc.LoadXml(m_part.ParentGroup.m_savedScriptState[oldID]); 342 doc.LoadXml(m_part.ParentGroup.m_savedScriptState[oldID]);
@@ -380,6 +382,10 @@ namespace OpenSim.Region.Framework.Scenes
380 } 382 }
381 m_part.ParentGroup.m_savedScriptState.Remove(oldID); 383 m_part.ParentGroup.m_savedScriptState.Remove(oldID);
382 } 384 }
385 else
386 {
387 m_log.DebugFormat("[ScriptState]: No state for old ID {0}", oldID);
388 }
383 } 389 }
384 390
385 /// <summary> 391 /// <summary>