diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver')
3 files changed, 25 insertions, 14 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) |