* refactor: Making some of the serialization names consistent, both within their pairings and with the others
* This does make some of the names less ideal than others - this should change in the future0.6.0-stable
parent
91ffb6722f
commit
908d91be78
|
@ -99,24 +99,28 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
|||
}
|
||||
|
||||
// Reload serialized prims
|
||||
m_log.InfoFormat("[ARCHIVER]: Loading prim data");
|
||||
m_log.InfoFormat("[ARCHIVER]: Loading scene objects");
|
||||
|
||||
IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
|
||||
|
||||
// Temporary code to read each sog in the file separately, pending actually having these in separate files
|
||||
// XmlTextReader xtr = new XmlTextReader(new StringReader(serializedPrims));
|
||||
// XmlDocument doc = new XmlDocument();
|
||||
// reader.WhitespaceHandling = WhitespaceHandling.None;
|
||||
// doc.Load(xtr);
|
||||
// xtr.Close();
|
||||
// XmlNode sceneNode = doc.FirstChild;
|
||||
//
|
||||
// foreach (XmlNode objectNode in sceneNode.ChildNodes)
|
||||
// {
|
||||
// CreatePrimFromXml2(m_scene, objectNode.OuterXml);
|
||||
// }
|
||||
XmlTextReader xtr = new XmlTextReader(new StringReader(serializedPrims));
|
||||
XmlDocument doc = new XmlDocument();
|
||||
xtr.WhitespaceHandling = WhitespaceHandling.None;
|
||||
doc.Load(xtr);
|
||||
xtr.Close();
|
||||
XmlNode sceneNode = doc.FirstChild;
|
||||
int count = 0;
|
||||
|
||||
foreach (XmlNode objectNode in sceneNode.ChildNodes)
|
||||
{
|
||||
serialiser.LoadGroupFromXml2(m_scene, objectNode.OuterXml.ToString());
|
||||
count++;
|
||||
}
|
||||
|
||||
serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims));
|
||||
//serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims));
|
||||
|
||||
m_log.DebugFormat("[ARCHIVER]: Loaded {0} scene objects", count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,8 +36,20 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
|
|||
{
|
||||
List<string> SerialiseRegion(Scene scene, string saveDir);
|
||||
|
||||
/// <summary>
|
||||
/// Load prims from the xml format
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="fileName"></param>
|
||||
/// <param name="newIDS"></param>
|
||||
/// <param name="loadOffset"></param>
|
||||
void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset);
|
||||
|
||||
/// <summary>
|
||||
/// Save prims in the xml format
|
||||
/// </summary>
|
||||
/// <param name="scene"> </param>
|
||||
/// <param name="fileName"></param>
|
||||
void SavePrimsToXml(Scene scene, string fileName);
|
||||
|
||||
/// <summary>
|
||||
|
@ -54,10 +66,25 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
|
|||
/// <param name="reader"></param>
|
||||
void LoadPrimsFromXml2(Scene scene, TextReader reader);
|
||||
|
||||
/// <summary>
|
||||
/// Save prims in the xml2 format
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="fileName"></param>
|
||||
void SavePrimsToXml2(Scene scene, string fileName);
|
||||
|
||||
void LoadGroupFromXml2String(Scene scene, string xmlString);
|
||||
/// <summary>
|
||||
/// Load an individual scene object from the xml2 format
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="xmlString"></param>
|
||||
void LoadGroupFromXml2(Scene scene, string xmlString);
|
||||
|
||||
string SavePrimGroupToXML2String(SceneObjectGroup grp);
|
||||
/// <summary>
|
||||
/// Serialize an individual scene object into the xml2 format
|
||||
/// </summary>
|
||||
/// <param name="grp"></param>
|
||||
/// <returns></returns>
|
||||
string SaveGroupToXml2(SceneObjectGroup grp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,12 +99,12 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
file.Close();
|
||||
}
|
||||
|
||||
public static string SavePrimGroupToXML2String(SceneObjectGroup grp)
|
||||
public static string SaveGroupToXml2(SceneObjectGroup grp)
|
||||
{
|
||||
return grp.ToXmlString2();
|
||||
}
|
||||
|
||||
public static void LoadGroupFromXml2String(Scene scene, string xmlString)
|
||||
public static void LoadGroupFromXml2(Scene scene, string xmlString)
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
XmlNode rootNode;
|
||||
|
|
|
@ -112,14 +112,14 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
|
|||
SceneXmlLoader.SavePrimsToXml2(scene, fileName);
|
||||
}
|
||||
|
||||
public void LoadGroupFromXml2String(Scene scene, string xmlString)
|
||||
public void LoadGroupFromXml2(Scene scene, string xmlString)
|
||||
{
|
||||
SceneXmlLoader.LoadGroupFromXml2String(scene, xmlString);
|
||||
SceneXmlLoader.LoadGroupFromXml2(scene, xmlString);
|
||||
}
|
||||
|
||||
public string SavePrimGroupToXML2String(SceneObjectGroup grp)
|
||||
public string SaveGroupToXml2(SceneObjectGroup grp)
|
||||
{
|
||||
return SceneXmlLoader.SavePrimGroupToXML2String(grp);
|
||||
return SceneXmlLoader.SaveGroupToXml2(grp);
|
||||
}
|
||||
|
||||
public List<string> SerialiseRegion(Scene scene, string saveDir)
|
||||
|
|
|
@ -1821,7 +1821,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
successYN
|
||||
= m_sceneGridService.PrimCrossToNeighboringRegion(
|
||||
newRegionHandle, grp.UUID, m_serialiser.SavePrimGroupToXML2String(grp), primcrossingXMLmethod);
|
||||
newRegionHandle, grp.UUID, m_serialiser.SaveGroupToXml2(grp), primcrossingXMLmethod);
|
||||
|
||||
if (successYN)
|
||||
{
|
||||
|
@ -1854,7 +1854,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor");
|
||||
if (XMLMethod == 0)
|
||||
{
|
||||
m_serialiser.LoadGroupFromXml2String(this, objXMLData);
|
||||
m_serialiser.LoadGroupFromXml2(this, objXMLData);
|
||||
|
||||
SceneObjectPart RootPrim = GetSceneObjectPart(primID);
|
||||
if (RootPrim != null)
|
||||
|
|
Loading…
Reference in New Issue