* 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.
0.6.0-stable
Justin Clarke Casey 2008-06-21 20:43:13 +00:00
parent e19a76377c
commit 91ffb6722f
1 changed files with 19 additions and 7 deletions

View File

@ -28,9 +28,11 @@
using System;
using System.Collections.Generic;
using System.IO;
//using System.Reflection;
using System.Xml;
using Axiom.Math;
using libsecondlife;
//using log4net;
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
@ -41,6 +43,8 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public class SceneXmlLoader
{
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset)
{
XmlDocument doc = new XmlDocument();
@ -97,11 +101,7 @@ namespace OpenSim.Region.Environment.Scenes
public static string SavePrimGroupToXML2String(SceneObjectGroup grp)
{
string returnstring = "";
returnstring += "<scene>\n";
returnstring += grp.ToXmlString2();
returnstring += "</scene>\n";
return returnstring;
return grp.ToXmlString2();
}
public static void LoadGroupFromXml2String(Scene scene, string xmlString)
@ -115,9 +115,21 @@ namespace OpenSim.Region.Environment.Scenes
reader.Close();
rootNode = doc.FirstChild;
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
// This is to deal with neighbouring regions that are still surrounding the group xml with the <scene>
// tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or
// when some other changes forces all regions to upgrade).
// This might seem rather pointless since prim crossing from this revision to an earlier revision remains
// broken. But it isn't much work to accomodate the old format here.
if (rootNode.LocalName.Equals("scene"))
{
CreatePrimFromXml2(scene, aPrimNode.OuterXml);
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
{
CreatePrimFromXml2(scene, aPrimNode.OuterXml);
}
}
else
{
CreatePrimFromXml2(scene, rootNode.OuterXml);
}
}