aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-19 19:35:14 +0000
committerJustin Clarke Casey2008-12-19 19:35:14 +0000
commite62016d2c77270a0dc23e31c5d1ccc2d412fcec3 (patch)
treefb80c1e661e65878e3fa9962aad1aab49e70f939 /OpenSim
parent* refactor: remove xml serialization wrappers from Scene (diff)
downloadopensim-SC-e62016d2c77270a0dc23e31c5d1ccc2d412fcec3.zip
opensim-SC-e62016d2c77270a0dc23e31c5d1ccc2d412fcec3.tar.gz
opensim-SC-e62016d2c77270a0dc23e31c5d1ccc2d412fcec3.tar.bz2
opensim-SC-e62016d2c77270a0dc23e31c5d1ccc2d412fcec3.tar.xz
minor: Remove some serialization module scene wrappers
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs7
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs28
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs8
-rw-r--r--OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs25
5 files changed, 37 insertions, 37 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
index d812e24..35b4d8a 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
@@ -44,6 +44,7 @@ using OpenSim.Framework;
44using OpenSim.Framework.Console; 44using OpenSim.Framework.Console;
45using OpenSim.Framework.Servers; 45using OpenSim.Framework.Servers;
46using OpenSim.Framework.Communications; 46using OpenSim.Framework.Communications;
47using OpenSim.Region.Environment.Interfaces;
47using OpenSim.Region.Environment.Scenes; 48using OpenSim.Region.Environment.Scenes;
48using OpenSim.ApplicationPlugins.Rest; 49using OpenSim.ApplicationPlugins.Rest;
49 50
@@ -219,7 +220,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
219 { 220 {
220 httpResponse.SendChunked = true; 221 httpResponse.SendChunked = true;
221 httpResponse.ContentType = "text/xml"; 222 httpResponse.ContentType = "text/xml";
222 scene.SavePrimsToXml2(new StreamWriter(httpResponse.OutputStream), min, max); 223
224 IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
225 if (serialiser != null)
226 serialiser.SavePrimsToXml2(scene, new StreamWriter(httpResponse.OutputStream), min, max);
227
223 return ""; 228 return "";
224 } 229 }
225 } 230 }
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
index 73a1b9b..932f512 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
@@ -44,6 +44,7 @@ using OpenSim.Framework;
44using OpenSim.Framework.Console; 44using OpenSim.Framework.Console;
45using OpenSim.Framework.Servers; 45using OpenSim.Framework.Servers;
46using OpenSim.Framework.Communications; 46using OpenSim.Framework.Communications;
47using OpenSim.Region.Environment.Interfaces;
47using OpenSim.Region.Environment.Scenes; 48using OpenSim.Region.Environment.Scenes;
48using OpenSim.ApplicationPlugins.Rest; 49using OpenSim.ApplicationPlugins.Rest;
49 50
@@ -120,7 +121,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
120 121
121 public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene) 122 public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene)
122 { 123 {
123 scene.LoadPrimsFromXml2(new StringReader(requestBody), true); 124 IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
125 if (serialiser != null)
126 serialiser.LoadPrimsFromXml2(scene, new StringReader(requestBody), true);
127
124 return ""; 128 return "";
125 } 129 }
126 130
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 7d83ee2..eaf04ea 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1880,34 +1880,6 @@ namespace OpenSim.Region.Environment.Scenes
1880 return false; 1880 return false;
1881 } 1881 }
1882 1882
1883 public void LoadPrimsFromXml2(string fileName)
1884 {
1885 m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName);
1886
1887 m_serialiser.LoadPrimsFromXml2(this, fileName);
1888 }
1889
1890 public void LoadPrimsFromXml2(TextReader reader, bool startScripts)
1891 {
1892 m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName);
1893
1894 m_serialiser.LoadPrimsFromXml2(this, reader, startScripts);
1895 }
1896
1897 public void SavePrimsToXml2(string fileName)
1898 {
1899 m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName);
1900
1901 m_serialiser.SavePrimsToXml2(this, fileName);
1902 }
1903
1904 public void SavePrimsToXml2(TextWriter stream, Vector3 min, Vector3 max)
1905 {
1906 m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName);
1907
1908 m_serialiser.SavePrimsToXml2(this, stream, min, max);
1909 }
1910
1911 public void SaveNamedPrimsToXml2(string primName, string fileName) 1883 public void SaveNamedPrimsToXml2(string primName, string fileName)
1912 { 1884 {
1913 m_log.InfoFormat( 1885 m_log.InfoFormat(
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index b973ced..9e83f25 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -208,7 +208,9 @@ namespace OpenSim.Region.Environment.Scenes
208 /// <param name="filename"></param> 208 /// <param name="filename"></param>
209 public void SaveCurrentSceneToXml2(string filename) 209 public void SaveCurrentSceneToXml2(string filename)
210 { 210 {
211 CurrentOrFirstScene.SavePrimsToXml2(filename); 211 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
212 if (serialiser != null)
213 serialiser.SavePrimsToXml2(CurrentOrFirstScene, filename);
212 } 214 }
213 215
214 public void SaveNamedPrimsToXml2(string primName, string filename) 216 public void SaveNamedPrimsToXml2(string primName, string filename)
@@ -221,7 +223,9 @@ namespace OpenSim.Region.Environment.Scenes
221 /// </summary> 223 /// </summary>
222 public void LoadCurrentSceneFromXml2(string filename) 224 public void LoadCurrentSceneFromXml2(string filename)
223 { 225 {
224 CurrentOrFirstScene.LoadPrimsFromXml2(filename); 226 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
227 if (serialiser != null)
228 serialiser.LoadPrimsFromXml2(CurrentOrFirstScene, filename);
225 } 229 }
226 230
227 /// <summary> 231 /// <summary>
diff --git a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs
index f90c697..ea389d6 100644
--- a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs
+++ b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs
@@ -116,11 +116,26 @@ namespace OpenSim.Region.Modules.SvnSerialiser
116 116
117 public void LoadRegion(Scene scene) 117 public void LoadRegion(Scene scene)
118 { 118 {
119 scene.LoadPrimsFromXml2(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID + 119 IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
120 Slash.DirectorySeparatorChar + "objects.xml"); 120 if (serialiser != null)
121 scene.RequestModuleInterface<ITerrainModule>().LoadFromFile(m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID + 121 {
122 Slash.DirectorySeparatorChar + "heightmap.r32"); 122 serialiser.LoadPrimsFromXml2(
123 m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ")."); 123 scene,
124 m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
125 + Slash.DirectorySeparatorChar + "objects.xml");
126
127 scene.RequestModuleInterface<ITerrainModule>().LoadFromFile(
128 m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
129 + Slash.DirectorySeparatorChar + "heightmap.r32");
130
131 m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ").");
132 }
133 else
134 {
135 m_log.ErrorFormat(
136 "[SVNBACKUP]: Region load of {0} failed - no serialisation module available",
137 scene.RegionInfo.RegionName);
138 }
124 } 139 }
125 140
126 private void CheckoutSvn() 141 private void CheckoutSvn()