aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 6b538f6..f1f5258 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -51,6 +51,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
51 public class ArchiveReadRequest 51 public class ArchiveReadRequest
52 { 52 {
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54
55 /// <summary>
56 /// The maximum major version of OAR that we can read. Minor versions shouldn't need a number since version
57 /// bumps here should be compatible.
58 /// </summary>
59 public static int MAX_MAJOR_VERSION = 0;
54 60
55 protected Scene m_scene; 61 protected Scene m_scene;
56 protected Stream m_loadStream; 62 protected Stream m_loadStream;
@@ -497,6 +503,22 @@ namespace OpenSim.Region.CoreModules.World.Archiver
497 { 503 {
498 if (xtr.NodeType == XmlNodeType.Element) 504 if (xtr.NodeType == XmlNodeType.Element)
499 { 505 {
506 if (xtr.Name.ToString() == "archive")
507 {
508 int majorVersion = int.Parse(xtr["major_version"]);
509 int minorVersion = int.Parse(xtr["minor_version"]);
510 string version = string.Format("{0}.{1}", majorVersion, minorVersion);
511
512 if (majorVersion > MAX_MAJOR_VERSION)
513 {
514 throw new Exception(
515 string.Format(
516 "The OAR you are trying to load has major version number of {0} but this version of OpenSim can only load OARs with major version number {1} and below",
517 majorVersion, MAX_MAJOR_VERSION));
518 }
519
520 m_log.InfoFormat("[ARCHIVER]: Loading OAR with version {0}", version);
521 }
500 if (xtr.Name.ToString() == "datetime") 522 if (xtr.Name.ToString() == "datetime")
501 { 523 {
502 int value; 524 int value;