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.
viewer-2-initial-appearance
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

@ -265,10 +265,11 @@ namespace OpenSim
LoadOar);
m_console.Commands.AddCommand("region", false, "save oar",
"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
//"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
"save oar [-p|--profile=<url>] [<OAR path>]",
"Save a region's data to an OAR archive.",
"-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
+ "-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine
// "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
"-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine
+ "The OAR path must be a filesystem path."
+ " If this is not given then the oar is saved to region.oar in the current directory.",
SaveOar);

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);