diff options
author | Justin Clarke Casey | 2008-06-21 20:43:13 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-06-21 20:43:13 +0000 |
commit | 91ffb6722f40f1eeda9cda461992d1cd211bdbd2 (patch) | |
tree | a36567962486f87678adbcb0ad1e92a4bfd4a99b /OpenSim/Region/Environment/Modules/World | |
parent | * Refactor: Fold sog.DeleteParts() functionality into existing sog.DeleteGroup() (diff) | |
download | opensim-SC-91ffb6722f40f1eeda9cda461992d1cd211bdbd2.zip opensim-SC-91ffb6722f40f1eeda9cda461992d1cd211bdbd2.tar.gz opensim-SC-91ffb6722f40f1eeda9cda461992d1cd211bdbd2.tar.bz2 opensim-SC-91ffb6722f40f1eeda9cda461992d1cd211bdbd2.tar.xz |
* Remove redundant <scene> tag from individual object xml representation
* WARNING: Until both regions upgrade to this revision, prim crossings from regions on this revision to earlier region revisions will not work properly
* e.g. in the attachments cases, the attachments will remain visible but won't be individually detachable
* This change may seem to have more costs than benefits, but I'm doing it because I can soon reuse this changed existing code in another context - it seems better not to
proliferate similar but slightly different xml serializations.
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 | ||