Drop current OAR version back to 0.5 since these are currently now compatible with older OpenSim versions again.

Removed ability to choose 0.4 to avoid having to write code that polices this properly.  Please shout on the ml if you really need this.
This commit is contained in:
Justin Clark-Casey (justincc)
2010-12-11 01:57:32 +00:00
parent b512ecd1dc
commit 373ef594ba
4 changed files with 38 additions and 38 deletions

View File

@@ -136,14 +136,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
ms.Close();
m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
// Write out scene object metadata
foreach (SceneObjectGroup sceneObject in m_sceneObjects)
{
//m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType());
string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
}

View File

@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <summary>
/// The maximum major version of OAR that we can write.
/// </summary>
public static int MAX_MAJOR_VERSION = 1;
public static int MAX_MAJOR_VERSION = 0;
protected Scene m_scene;
protected Stream m_saveStream;
@@ -206,37 +206,37 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <returns></returns>
public static string CreateControlFile(Dictionary<string, object> options)
{
int majorVersion = MAX_MAJOR_VERSION, minorVersion = 0;
if (options.ContainsKey("version"))
{
string[] parts = options["version"].ToString().Split('.');
if (parts.Length >= 1)
{
majorVersion = Int32.Parse(parts[0]);
if (parts.Length >= 2)
minorVersion = Int32.Parse(parts[1]);
}
}
if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION)
{
throw new Exception(
string.Format(
"OAR version number for save must be between {0} and {1}",
MIN_MAJOR_VERSION, MAX_MAJOR_VERSION));
}
else if (majorVersion == MAX_MAJOR_VERSION)
{
// Force 1.0
minorVersion = 0;
}
else if (majorVersion == MIN_MAJOR_VERSION)
{
// Force 0.4
minorVersion = 4;
}
int majorVersion = MAX_MAJOR_VERSION, minorVersion = 5;
//
// if (options.ContainsKey("version"))
// {
// string[] parts = options["version"].ToString().Split('.');
// if (parts.Length >= 1)
// {
// majorVersion = Int32.Parse(parts[0]);
//
// if (parts.Length >= 2)
// minorVersion = Int32.Parse(parts[1]);
// }
// }
//
// if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION)
// {
// throw new Exception(
// string.Format(
// "OAR version number for save must be between {0} and {1}",
// MIN_MAJOR_VERSION, MAX_MAJOR_VERSION));
// }
// else if (majorVersion == MAX_MAJOR_VERSION)
// {
// // Force 1.0
// minorVersion = 0;
// }
// else if (majorVersion == MIN_MAJOR_VERSION)
// {
// // Force 0.4
// minorVersion = 4;
// }
m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
//if (majorVersion == 1)

View File

@@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
Dictionary<string, object> options = new Dictionary<string, object>();
OptionSet ops = new OptionSet();
ops.Add("v|version=", delegate(string v) { options["version"] = v; });
// ops.Add("v|version=", delegate(string v) { options["version"] = v; });
ops.Add("p|profile=", delegate(string v) { options["profile"] = v; });
List<string> mainParams = ops.Parse(cmdparams);