minor: Remove some serialization module scene wrappers

0.6.1-post-fixes
Justin Clarke Casey 2008-12-19 19:35:14 +00:00
parent 667a935fff
commit e62016d2c7
5 changed files with 37 additions and 37 deletions

View File

@ -44,6 +44,7 @@ using OpenSim.Framework;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.ApplicationPlugins.Rest; using OpenSim.ApplicationPlugins.Rest;
@ -219,7 +220,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
{ {
httpResponse.SendChunked = true; httpResponse.SendChunked = true;
httpResponse.ContentType = "text/xml"; 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 ""; return "";
} }
} }

View File

@ -44,6 +44,7 @@ using OpenSim.Framework;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.ApplicationPlugins.Rest; using OpenSim.ApplicationPlugins.Rest;
@ -120,7 +121,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene) 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 ""; return "";
} }

View File

@ -1880,34 +1880,6 @@ namespace OpenSim.Region.Environment.Scenes
return false; 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) public void SaveNamedPrimsToXml2(string primName, string fileName)
{ {
m_log.InfoFormat( m_log.InfoFormat(

View File

@ -208,7 +208,9 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="filename"></param> /// <param name="filename"></param>
public void SaveCurrentSceneToXml2(string filename) 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) public void SaveNamedPrimsToXml2(string primName, string filename)
@ -221,7 +223,9 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void LoadCurrentSceneFromXml2(string filename) public void LoadCurrentSceneFromXml2(string filename)
{ {
CurrentOrFirstScene.LoadPrimsFromXml2(filename); IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
if (serialiser != null)
serialiser.LoadPrimsFromXml2(CurrentOrFirstScene, filename);
} }
/// <summary> /// <summary>

View File

@ -116,11 +116,26 @@ namespace OpenSim.Region.Modules.SvnSerialiser
public void LoadRegion(Scene scene) public void LoadRegion(Scene scene)
{ {
scene.LoadPrimsFromXml2(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID + IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
Slash.DirectorySeparatorChar + "objects.xml"); if (serialiser != null)
scene.RequestModuleInterface<ITerrainModule>().LoadFromFile(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID + {
Slash.DirectorySeparatorChar + "heightmap.r32"); serialiser.LoadPrimsFromXml2(
m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ")."); 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() private void CheckoutSvn()