mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -66,12 +66,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig startupConfig = source.Configs["Startup"];
|
||||
if (startupConfig == null)
|
||||
IConfig meshConfig = source.Configs["Mesh"];
|
||||
if (meshConfig == null)
|
||||
return;
|
||||
|
||||
if (!startupConfig.GetBoolean("ColladaMesh",true))
|
||||
m_enabled = false;
|
||||
m_enabled = meshConfig.GetBoolean("ColladaMesh", true);
|
||||
}
|
||||
|
||||
public void AddRegion(Scene pScene)
|
||||
|
||||
@@ -68,12 +68,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig startupConfig = source.Configs["Startup"];
|
||||
if (startupConfig == null)
|
||||
IConfig meshConfig = source.Configs["Mesh"];
|
||||
if (meshConfig == null)
|
||||
return;
|
||||
|
||||
if (!startupConfig.GetBoolean("ColladaMesh",true))
|
||||
m_enabled = false;
|
||||
m_enabled = meshConfig.GetBoolean("ColladaMesh", true);
|
||||
}
|
||||
|
||||
public void AddRegion(Scene pScene)
|
||||
|
||||
@@ -77,7 +77,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// </value>
|
||||
private Stream m_loadStream;
|
||||
|
||||
protected bool m_controlFileLoaded;
|
||||
/// <summary>
|
||||
/// Has the control file been loaded for this archive?
|
||||
/// </summary>
|
||||
public bool ControlFileLoaded { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't
|
||||
/// enforce.
|
||||
/// </summary>
|
||||
public bool EnforceControlFileCheck { get; private set; }
|
||||
|
||||
protected bool m_assetsLoaded;
|
||||
protected bool m_inventoryNodesLoaded;
|
||||
|
||||
@@ -126,6 +136,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_userInfo = userInfo;
|
||||
m_invPath = invPath;
|
||||
m_loadStream = loadStream;
|
||||
|
||||
// FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things
|
||||
// (I thought they weren't). We will need to bump the version number and perform this check on all
|
||||
// subsequent IAR versions only
|
||||
ControlFileLoaded = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -517,7 +532,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="data"></param>
|
||||
protected void LoadControlFile(string path, byte[] data)
|
||||
public void LoadControlFile(string path, byte[] data)
|
||||
{
|
||||
XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
|
||||
XElement archiveElement = doc.Element("archive");
|
||||
@@ -533,7 +548,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
majorVersion, MAX_MAJOR_VERSION));
|
||||
}
|
||||
|
||||
m_controlFileLoaded = true;
|
||||
ControlFileLoaded = true;
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
|
||||
}
|
||||
|
||||
@@ -545,7 +560,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// <param name="data"></param>
|
||||
protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data)
|
||||
{
|
||||
if (!m_controlFileLoaded)
|
||||
if (!ControlFileLoaded)
|
||||
throw new Exception(
|
||||
string.Format(
|
||||
"The IAR you are trying to load does not list {0} before {1}. Aborting load",
|
||||
@@ -592,7 +607,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// <param name="data"></param>
|
||||
protected void LoadAssetFile(string path, byte[] data)
|
||||
{
|
||||
if (!m_controlFileLoaded)
|
||||
if (!ControlFileLoaded)
|
||||
throw new Exception(
|
||||
string.Format(
|
||||
"The IAR you are trying to load does not list {0} before {1}. Aborting load",
|
||||
@@ -617,4 +632,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_assetsLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,12 +388,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
if (options.ContainsKey("profile"))
|
||||
{
|
||||
majorVersion = 1;
|
||||
minorVersion = 0;
|
||||
minorVersion = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
majorVersion = 0;
|
||||
minorVersion = 1;
|
||||
minorVersion = 2;
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);
|
||||
|
||||
@@ -94,7 +94,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
|
||||
Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140")));
|
||||
Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75)));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test that the IAR has the required files in the right order.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// At the moment, the only thing that matters is that the control file is the very first one.
|
||||
/// </remarks>
|
||||
[Test]
|
||||
public void TestOrder()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes);
|
||||
TarArchiveReader tar = new TarArchiveReader(archiveReadStream);
|
||||
string filePath;
|
||||
TarArchiveReader.TarEntryType tarEntryType;
|
||||
|
||||
byte[] data = tar.ReadEntry(out filePath, out tarEntryType);
|
||||
Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
|
||||
|
||||
InventoryArchiveReadRequest iarr
|
||||
= new InventoryArchiveReadRequest(null, null, null, (Stream)null, false);
|
||||
iarr.LoadControlFile(filePath, data);
|
||||
|
||||
Assert.That(iarr.ControlFileLoaded, Is.True);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive
|
||||
|
||||
Reference in New Issue
Block a user