aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScenePresence.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs18
4 files changed, 23 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index 410eda0..11a13e1 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Interfaces
66 /// <param name="sp">The presence closing</param> 66 /// <param name="sp">The presence closing</param>
67 /// <param name="saveChanged">Save changed attachments.</param> 67 /// <param name="saveChanged">Save changed attachments.</param>
68 /// <param name="saveAllScripted">Save attachments with scripts even if they haven't changed.</para> 68 /// <param name="saveAllScripted">Save attachments with scripts even if they haven't changed.</para>
69 void DeRezAttachments(IScenePresence sp, bool saveChanged, bool saveAllScripted); 69 void DeRezAttachments(IScenePresence sp);
70 70
71 /// <summary> 71 /// <summary>
72 /// Delete all the presence's attachments from the scene 72 /// Delete all the presence's attachments from the scene
diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
index e6b926c..3f68ee0 100644
--- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Region.Framework.Interfaces
40 /// </remarks> 40 /// </remarks>
41 public interface IScenePresence : ISceneAgent 41 public interface IScenePresence : ISceneAgent
42 { 42 {
43 PresenceType PresenceType { get; }
44
43 /// <summary> 45 /// <summary>
44 /// Copy of the script states while the agent is in transit. This state may 46 /// Copy of the script states while the agent is in transit. This state may
45 /// need to be placed back in case of transfer fail. 47 /// need to be placed back in case of transfer fail.
@@ -83,4 +85,4 @@ namespace OpenSim.Region.Framework.Interfaces
83 void RemoveAttachment(SceneObjectGroup gobj); 85 void RemoveAttachment(SceneObjectGroup gobj);
84 void ClearAttachments(); 86 void ClearAttachments();
85 } 87 }
86} \ No newline at end of file 88}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index f501828..ad9e91d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3461,17 +3461,7 @@ namespace OpenSim.Region.Framework.Scenes
3461 { 3461 {
3462 if (AttachmentsModule != null) 3462 if (AttachmentsModule != null)
3463 { 3463 {
3464 // Don't save attachments for HG visitors, it 3464 AttachmentsModule.DeRezAttachments(avatar);
3465 // messes up their inventory. When a HG visitor logs
3466 // out on a foreign grid, their attachments will be
3467 // reloaded in the state they were in when they left
3468 // the home grid. This is best anyway as the visited
3469 // grid may use an incompatible script engine.
3470 bool saveChanged
3471 = avatar.PresenceType != PresenceType.Npc
3472 && (UserManagementModule == null || UserManagementModule.IsLocalGridUser(avatar.UUID));
3473
3474 AttachmentsModule.DeRezAttachments(avatar, saveChanged, false);
3475 } 3465 }
3476 3466
3477 ForEachClient( 3467 ForEachClient(
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 2372d6b..0d292e7 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -151,6 +151,24 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
151 ToOriginalXmlFormat(sceneObject, writer, doScriptStates, false); 151 ToOriginalXmlFormat(sceneObject, writer, doScriptStates, false);
152 } 152 }
153 153
154 public static string ToOriginalXmlFormat(SceneObjectGroup sceneObject, string scriptedState)
155 {
156 using (StringWriter sw = new StringWriter())
157 {
158 using (XmlTextWriter writer = new XmlTextWriter(sw))
159 {
160 writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty);
161
162 ToOriginalXmlFormat(sceneObject, writer, false, true);
163
164 writer.WriteRaw(scriptedState);
165
166 writer.WriteEndElement();
167 }
168 return sw.ToString();
169 }
170 }
171
154 /// <summary> 172 /// <summary>
155 /// Serialize a scene object to the original xml format 173 /// Serialize a scene object to the original xml format
156 /// </summary> 174 /// </summary>