minor: Remove some serialization module scene wrappers
parent
667a935fff
commit
e62016d2c7
|
@ -44,6 +44,7 @@ using OpenSim.Framework;
|
|||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.ApplicationPlugins.Rest;
|
||||
|
||||
|
@ -219,7 +220,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
{
|
||||
httpResponse.SendChunked = true;
|
||||
httpResponse.ContentType = "text/xml";
|
||||
scene.SavePrimsToXml2(new StreamWriter(httpResponse.OutputStream), min, max);
|
||||
|
||||
IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
|
||||
if (serialiser != null)
|
||||
serialiser.SavePrimsToXml2(scene, new StreamWriter(httpResponse.OutputStream), min, max);
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ using OpenSim.Framework;
|
|||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.ApplicationPlugins.Rest;
|
||||
|
||||
|
@ -120,7 +121,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
|
||||
public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene)
|
||||
{
|
||||
scene.LoadPrimsFromXml2(new StringReader(requestBody), true);
|
||||
IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
|
||||
if (serialiser != null)
|
||||
serialiser.LoadPrimsFromXml2(scene, new StringReader(requestBody), true);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -1880,34 +1880,6 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
return false;
|
||||
}
|
||||
|
||||
public void LoadPrimsFromXml2(string fileName)
|
||||
{
|
||||
m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName);
|
||||
|
||||
m_serialiser.LoadPrimsFromXml2(this, fileName);
|
||||
}
|
||||
|
||||
public void LoadPrimsFromXml2(TextReader reader, bool startScripts)
|
||||
{
|
||||
m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName);
|
||||
|
||||
m_serialiser.LoadPrimsFromXml2(this, reader, startScripts);
|
||||
}
|
||||
|
||||
public void SavePrimsToXml2(string fileName)
|
||||
{
|
||||
m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName);
|
||||
|
||||
m_serialiser.SavePrimsToXml2(this, fileName);
|
||||
}
|
||||
|
||||
public void SavePrimsToXml2(TextWriter stream, Vector3 min, Vector3 max)
|
||||
{
|
||||
m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName);
|
||||
|
||||
m_serialiser.SavePrimsToXml2(this, stream, min, max);
|
||||
}
|
||||
|
||||
public void SaveNamedPrimsToXml2(string primName, string fileName)
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
|
|
|
@ -208,7 +208,9 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <param name="filename"></param>
|
||||
public void SaveCurrentSceneToXml2(string filename)
|
||||
{
|
||||
CurrentOrFirstScene.SavePrimsToXml2(filename);
|
||||
IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
|
||||
if (serialiser != null)
|
||||
serialiser.SavePrimsToXml2(CurrentOrFirstScene, filename);
|
||||
}
|
||||
|
||||
public void SaveNamedPrimsToXml2(string primName, string filename)
|
||||
|
@ -221,7 +223,9 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// </summary>
|
||||
public void LoadCurrentSceneFromXml2(string filename)
|
||||
{
|
||||
CurrentOrFirstScene.LoadPrimsFromXml2(filename);
|
||||
IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
|
||||
if (serialiser != null)
|
||||
serialiser.LoadPrimsFromXml2(CurrentOrFirstScene, filename);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -116,12 +116,27 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
|||
|
||||
public void LoadRegion(Scene scene)
|
||||
{
|
||||
scene.LoadPrimsFromXml2(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID +
|
||||
Slash.DirectorySeparatorChar + "objects.xml");
|
||||
scene.RequestModuleInterface<ITerrainModule>().LoadFromFile(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID +
|
||||
Slash.DirectorySeparatorChar + "heightmap.r32");
|
||||
IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
|
||||
if (serialiser != null)
|
||||
{
|
||||
serialiser.LoadPrimsFromXml2(
|
||||
scene,
|
||||
m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
|
||||
+ Slash.DirectorySeparatorChar + "objects.xml");
|
||||
|
||||
scene.RequestModuleInterface<ITerrainModule>().LoadFromFile(
|
||||
m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
|
||||
+ Slash.DirectorySeparatorChar + "heightmap.r32");
|
||||
|
||||
m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ").");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[SVNBACKUP]: Region load of {0} failed - no serialisation module available",
|
||||
scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckoutSvn()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue