diff options
author | Melanie | 2012-07-23 21:55:18 +0100 |
---|---|---|
committer | Melanie | 2012-07-23 21:55:18 +0100 |
commit | d69f186f5aa6897f17c04db1e26e45398b5f2eb4 (patch) | |
tree | 32f744c8f35ed7faa2ff36339a9b9e1595316ed1 /OpenSim/Region/Framework/Scenes | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Change attachment handling to remove object from the scene first as per (diff) | |
download | opensim-SC-d69f186f5aa6897f17c04db1e26e45398b5f2eb4.zip opensim-SC-d69f186f5aa6897f17c04db1e26e45398b5f2eb4.tar.gz opensim-SC-d69f186f5aa6897f17c04db1e26e45398b5f2eb4.tar.bz2 opensim-SC-d69f186f5aa6897f17c04db1e26e45398b5f2eb4.tar.xz |
Merge branch 'avination' into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 18 |
2 files changed, 19 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 56c58b7..0bf2259 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3467,17 +3467,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3467 | { | 3467 | { |
3468 | if (AttachmentsModule != null) | 3468 | if (AttachmentsModule != null) |
3469 | { | 3469 | { |
3470 | // Don't save attachments for HG visitors, it | 3470 | AttachmentsModule.DeRezAttachments(avatar); |
3471 | // messes up their inventory. When a HG visitor logs | ||
3472 | // out on a foreign grid, their attachments will be | ||
3473 | // reloaded in the state they were in when they left | ||
3474 | // the home grid. This is best anyway as the visited | ||
3475 | // grid may use an incompatible script engine. | ||
3476 | bool saveChanged | ||
3477 | = avatar.PresenceType != PresenceType.Npc | ||
3478 | && (UserManagementModule == null || UserManagementModule.IsLocalGridUser(avatar.UUID)); | ||
3479 | |||
3480 | AttachmentsModule.DeRezAttachments(avatar, saveChanged, false); | ||
3481 | } | 3471 | } |
3482 | 3472 | ||
3483 | ForEachClient( | 3473 | 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> |