diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 94161f0..7cc2459 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs | |||
@@ -28,9 +28,11 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | 30 | using System.IO; |
31 | //using System.Reflection; | ||
31 | using System.Xml; | 32 | using System.Xml; |
32 | using Axiom.Math; | 33 | using Axiom.Math; |
33 | using libsecondlife; | 34 | using libsecondlife; |
35 | //using log4net; | ||
34 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
35 | using OpenSim.Region.Physics.Manager; | 37 | using OpenSim.Region.Physics.Manager; |
36 | 38 | ||
@@ -41,6 +43,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
41 | /// </summary> | 43 | /// </summary> |
42 | public class SceneXmlLoader | 44 | public class SceneXmlLoader |
43 | { | 45 | { |
46 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
44 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) | 48 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) |
45 | { | 49 | { |
46 | XmlDocument doc = new XmlDocument(); | 50 | XmlDocument doc = new XmlDocument(); |
@@ -97,11 +101,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
97 | 101 | ||
98 | public static string SavePrimGroupToXML2String(SceneObjectGroup grp) | 102 | public static string SavePrimGroupToXML2String(SceneObjectGroup grp) |
99 | { | 103 | { |
100 | string returnstring = ""; | 104 | return grp.ToXmlString2(); |
101 | returnstring += "<scene>\n"; | ||
102 | returnstring += grp.ToXmlString2(); | ||
103 | returnstring += "</scene>\n"; | ||
104 | return returnstring; | ||
105 | } | 105 | } |
106 | 106 | ||
107 | public static void LoadGroupFromXml2String(Scene scene, string xmlString) | 107 | public static void LoadGroupFromXml2String(Scene scene, string xmlString) |
@@ -115,9 +115,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
115 | reader.Close(); | 115 | reader.Close(); |
116 | rootNode = doc.FirstChild; | 116 | rootNode = doc.FirstChild; |
117 | 117 | ||
118 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) | 118 | // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene> |
119 | // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or | ||
120 | // when some other changes forces all regions to upgrade). | ||
121 | // This might seem rather pointless since prim crossing from this revision to an earlier revision remains | ||
122 | // broken. But it isn't much work to accomodate the old format here. | ||
123 | if (rootNode.LocalName.Equals("scene")) | ||
119 | { | 124 | { |
120 | CreatePrimFromXml2(scene, aPrimNode.OuterXml); | 125 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) |
126 | { | ||
127 | CreatePrimFromXml2(scene, aPrimNode.OuterXml); | ||
128 | } | ||
129 | } | ||
130 | else | ||
131 | { | ||
132 | CreatePrimFromXml2(scene, rootNode.OuterXml); | ||
121 | } | 133 | } |
122 | } | 134 | } |
123 | 135 | ||