aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-10-16 05:38:44 +0100
committerJustin Clark-Casey (justincc)2010-10-16 05:38:44 +0100
commite41b23a1a4bef55d31f75e1227834da84cbd971a (patch)
treecf0a44403f242cd1aab6beee900e71e73fe0eff0 /OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
parentHave OpenSim throw a strop if it tries to load an OAR with a major version th... (diff)
downloadopensim-SC_OLD-e41b23a1a4bef55d31f75e1227834da84cbd971a.zip
opensim-SC_OLD-e41b23a1a4bef55d31f75e1227834da84cbd971a.tar.gz
opensim-SC_OLD-e41b23a1a4bef55d31f75e1227834da84cbd971a.tar.bz2
opensim-SC_OLD-e41b23a1a4bef55d31f75e1227834da84cbd971a.tar.xz
change --old-guids switch on the save oar command line to --version=<x>
if x is 0, then an old version 0.3 archive is saved. If it is anything else or missing, then a version 1.0 archive is saved version 1.0 archives cannot be loaded on OpenSim 0.7.0.2 and earlier also add various informational notices about what version we've saving/loading
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs26
1 files changed, 22 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index bae1bdd..d21efed 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -172,7 +172,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
172 m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); 172 m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time.");
173 173
174 // Write out control file 174 // Write out control file
175 archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile()); 175 archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile(options));
176 m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); 176 m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
177 177
178 new AssetsRequest( 178 new AssetsRequest(
@@ -184,15 +184,33 @@ namespace OpenSim.Region.CoreModules.World.Archiver
184 /// Create the control file for the most up to date archive 184 /// Create the control file for the most up to date archive
185 /// </summary> 185 /// </summary>
186 /// <returns></returns> 186 /// <returns></returns>
187 public static string Create0p2ControlFile() 187 public static string Create0p2ControlFile(Dictionary<string, object> options)
188 { 188 {
189 int majorVersion, minorVersion;
190 if (options.ContainsKey("version") && (string)options["version"] == "0")
191 {
192 majorVersion = 0;
193 minorVersion = 3;
194 }
195 else
196 {
197 majorVersion = 1;
198 minorVersion = 0;
199 }
200
201 m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
202 if (majorVersion == 1)
203 {
204 m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR");
205 }
206
189 StringWriter sw = new StringWriter(); 207 StringWriter sw = new StringWriter();
190 XmlTextWriter xtw = new XmlTextWriter(sw); 208 XmlTextWriter xtw = new XmlTextWriter(sw);
191 xtw.Formatting = Formatting.Indented; 209 xtw.Formatting = Formatting.Indented;
192 xtw.WriteStartDocument(); 210 xtw.WriteStartDocument();
193 xtw.WriteStartElement("archive"); 211 xtw.WriteStartElement("archive");
194 xtw.WriteAttributeString("major_version", "0"); 212 xtw.WriteAttributeString("major_version", majorVersion.ToString());
195 xtw.WriteAttributeString("minor_version", "3"); 213 xtw.WriteAttributeString("minor_version", minorVersion.ToString());
196 214
197 xtw.WriteStartElement("creation_info"); 215 xtw.WriteStartElement("creation_info");
198 DateTime now = DateTime.UtcNow; 216 DateTime now = DateTime.UtcNow;