diff options
author | Diva Canto | 2010-10-15 17:27:19 -0700 |
---|---|---|
committer | Diva Canto | 2010-10-15 17:27:19 -0700 |
commit | 1499607215aab4994f933a8ed2a54ed037a1f9ba (patch) | |
tree | e343f5115c50c8dbae730a15c41a0d62f5b9f74d /OpenSim/Region/CoreModules | |
parent | UPdated the MySql driver to 6.2.4. Also established a much larger MySqlComman... (diff) | |
download | opensim-SC_OLD-1499607215aab4994f933a8ed2a54ed037a1f9ba.zip opensim-SC_OLD-1499607215aab4994f933a8ed2a54ed037a1f9ba.tar.gz opensim-SC_OLD-1499607215aab4994f933a8ed2a54ed037a1f9ba.tar.bz2 opensim-SC_OLD-1499607215aab4994f933a8ed2a54ed037a1f9ba.tar.xz |
Made OARs use the new serialization procedure. (TPs/crossings still on the old one) Added an options argument down the pipeline. For the time being it takes --old-guids as an option to produce <Guid> instead of <UUID>.
Diffstat (limited to 'OpenSim/Region/CoreModules')
5 files changed, 28 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index 586d98e..eb9688d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -60,6 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
60 | protected Scene m_scene; | 60 | protected Scene m_scene; |
61 | protected TarArchiveWriter m_archiveWriter; | 61 | protected TarArchiveWriter m_archiveWriter; |
62 | protected Guid m_requestId; | 62 | protected Guid m_requestId; |
63 | protected Dictionary<string, object> m_options; | ||
63 | 64 | ||
64 | public ArchiveWriteRequestExecution( | 65 | public ArchiveWriteRequestExecution( |
65 | List<SceneObjectGroup> sceneObjects, | 66 | List<SceneObjectGroup> sceneObjects, |
@@ -67,7 +68,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
67 | IRegionSerialiserModule serialiser, | 68 | IRegionSerialiserModule serialiser, |
68 | Scene scene, | 69 | Scene scene, |
69 | TarArchiveWriter archiveWriter, | 70 | TarArchiveWriter archiveWriter, |
70 | Guid requestId) | 71 | Guid requestId, |
72 | Dictionary<string, object> options) | ||
71 | { | 73 | { |
72 | m_sceneObjects = sceneObjects; | 74 | m_sceneObjects = sceneObjects; |
73 | m_terrainModule = terrainModule; | 75 | m_terrainModule = terrainModule; |
@@ -75,6 +77,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
75 | m_scene = scene; | 77 | m_scene = scene; |
76 | m_archiveWriter = archiveWriter; | 78 | m_archiveWriter = archiveWriter; |
77 | m_requestId = requestId; | 79 | m_requestId = requestId; |
80 | m_options = options; | ||
78 | } | 81 | } |
79 | 82 | ||
80 | protected internal void ReceivedAllAssets( | 83 | protected internal void ReceivedAllAssets( |
@@ -145,7 +148,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
145 | { | 148 | { |
146 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); | 149 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); |
147 | 150 | ||
148 | string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject); | 151 | string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); |
149 | m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); | 152 | m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); |
150 | } | 153 | } |
151 | 154 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index 283b33b..e9a476c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
98 | /// Archive the region requested. | 98 | /// Archive the region requested. |
99 | /// </summary> | 99 | /// </summary> |
100 | /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> | 100 | /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> |
101 | public void ArchiveRegion() | 101 | public void ArchiveRegion(Dictionary<string, object> options) |
102 | { | 102 | { |
103 | Dictionary<UUID, AssetType> assetUuids = new Dictionary<UUID, AssetType>(); | 103 | Dictionary<UUID, AssetType> assetUuids = new Dictionary<UUID, AssetType>(); |
104 | 104 | ||
@@ -165,7 +165,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
165 | m_scene.RequestModuleInterface<IRegionSerialiserModule>(), | 165 | m_scene.RequestModuleInterface<IRegionSerialiserModule>(), |
166 | m_scene, | 166 | m_scene, |
167 | archiveWriter, | 167 | archiveWriter, |
168 | m_requestId); | 168 | m_requestId, |
169 | options); | ||
169 | 170 | ||
170 | new AssetsRequest( | 171 | new AssetsRequest( |
171 | new AssetsArchiver(archiveWriter), assetUuids, | 172 | new AssetsArchiver(archiveWriter), assetUuids, |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 82ede01..98bdcd0 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |||
@@ -122,37 +122,44 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
122 | /// <param name="cmdparams"></param> | 122 | /// <param name="cmdparams"></param> |
123 | public void HandleSaveOarConsoleCommand(string module, string[] cmdparams) | 123 | public void HandleSaveOarConsoleCommand(string module, string[] cmdparams) |
124 | { | 124 | { |
125 | Dictionary<string, object> options = new Dictionary<string, object>(); | ||
126 | |||
127 | OptionSet ops = new OptionSet(); | ||
128 | ops.Add("old|old-guids", delegate(string v) { options["old-guids"] = (v != null); }); | ||
129 | |||
130 | List<string> mainParams = ops.Parse(cmdparams); | ||
131 | |||
125 | if (cmdparams.Length > 2) | 132 | if (cmdparams.Length > 2) |
126 | { | 133 | { |
127 | ArchiveRegion(cmdparams[2]); | 134 | ArchiveRegion(mainParams[2], options); |
128 | } | 135 | } |
129 | else | 136 | else |
130 | { | 137 | { |
131 | ArchiveRegion(DEFAULT_OAR_BACKUP_FILENAME); | 138 | ArchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, options); |
132 | } | 139 | } |
133 | } | 140 | } |
134 | 141 | ||
135 | public void ArchiveRegion(string savePath) | 142 | public void ArchiveRegion(string savePath, Dictionary<string, object> options) |
136 | { | 143 | { |
137 | ArchiveRegion(savePath, Guid.Empty); | 144 | ArchiveRegion(savePath, Guid.Empty, options); |
138 | } | 145 | } |
139 | 146 | ||
140 | public void ArchiveRegion(string savePath, Guid requestId) | 147 | public void ArchiveRegion(string savePath, Guid requestId, Dictionary<string, object> options) |
141 | { | 148 | { |
142 | m_log.InfoFormat( | 149 | m_log.InfoFormat( |
143 | "[ARCHIVER]: Writing archive for region {0} to {1}", m_scene.RegionInfo.RegionName, savePath); | 150 | "[ARCHIVER]: Writing archive for region {0} to {1}", m_scene.RegionInfo.RegionName, savePath); |
144 | 151 | ||
145 | new ArchiveWriteRequestPreparation(m_scene, savePath, requestId).ArchiveRegion(); | 152 | new ArchiveWriteRequestPreparation(m_scene, savePath, requestId).ArchiveRegion(options); |
146 | } | 153 | } |
147 | 154 | ||
148 | public void ArchiveRegion(Stream saveStream) | 155 | public void ArchiveRegion(Stream saveStream) |
149 | { | 156 | { |
150 | ArchiveRegion(saveStream, Guid.Empty); | 157 | ArchiveRegion(saveStream, Guid.Empty); |
151 | } | 158 | } |
152 | 159 | ||
153 | public void ArchiveRegion(Stream saveStream, Guid requestId) | 160 | public void ArchiveRegion(Stream saveStream, Guid requestId) |
154 | { | 161 | { |
155 | new ArchiveWriteRequestPreparation(m_scene, saveStream, requestId).ArchiveRegion(); | 162 | new ArchiveWriteRequestPreparation(m_scene, saveStream, requestId).ArchiveRegion(new Dictionary<string, object>()); |
156 | } | 163 | } |
157 | 164 | ||
158 | public void DearchiveRegion(string loadPath) | 165 | public void DearchiveRegion(string loadPath) |
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs index 04062b0..ec97acd 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs | |||
@@ -160,9 +160,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser | |||
160 | return SceneXmlLoader.DeserializeGroupFromXml2(xmlString); | 160 | return SceneXmlLoader.DeserializeGroupFromXml2(xmlString); |
161 | } | 161 | } |
162 | 162 | ||
163 | public string SerializeGroupToXml2(SceneObjectGroup grp) | 163 | public string SerializeGroupToXml2(SceneObjectGroup grp, Dictionary<string, object> options) |
164 | { | 164 | { |
165 | return SceneXmlLoader.SaveGroupToXml2(grp); | 165 | return SceneXmlLoader.SaveGroupToXml2(grp, options); |
166 | } | 166 | } |
167 | 167 | ||
168 | public void SavePrimListToXml2(EntityBase[] entityList, string fileName) | 168 | public void SavePrimListToXml2(EntityBase[] entityList, string fileName) |
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index 799a448..49bd466 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | |||
@@ -369,7 +369,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
369 | // Need to add the object to the scene so that the request to get script state succeeds | 369 | // Need to add the object to the scene so that the request to get script state succeeds |
370 | m_scene.AddSceneObject(so); | 370 | m_scene.AddSceneObject(so); |
371 | 371 | ||
372 | string xml2 = m_serialiserModule.SerializeGroupToXml2(so); | 372 | string xml2 = m_serialiserModule.SerializeGroupToXml2(so, new System.Collections.Generic.Dictionary<string,object>()); |
373 | 373 | ||
374 | XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); | 374 | XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); |
375 | xtr.ReadStartElement("SceneObjectGroup"); | 375 | xtr.ReadStartElement("SceneObjectGroup"); |