diff options
author | Jonathan Freedman | 2010-10-17 18:45:25 -0400 |
---|---|---|
committer | Jonathan Freedman | 2010-10-17 18:45:25 -0400 |
commit | 4e4fb93fae6c13ca6c6ac521991c4e4969b0fe65 (patch) | |
tree | 79142f2364b658f52b63e3ae688a5521290e2a4f /OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |
parent | * more url / hg cleanup (diff) | |
parent | Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-4e4fb93fae6c13ca6c6ac521991c4e4969b0fe65.zip opensim-SC_OLD-4e4fb93fae6c13ca6c6ac521991c4e4969b0fe65.tar.gz opensim-SC_OLD-4e4fb93fae6c13ca6c6ac521991c4e4969b0fe65.tar.bz2 opensim-SC_OLD-4e4fb93fae6c13ca6c6ac521991c4e4969b0fe65.tar.xz |
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 22 |
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; |