diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index ccec9b70eb..ba89e2117b 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -430,7 +430,7 @@ namespace OpenSim.Framework.Servers.HttpServer
string path = request.RawUrl;
string handlerKey = GetHandlerKey(request.HttpMethod, path);
- //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
+// m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
if (TryGetStreamHandler(handlerKey, out requestHandler))
{
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
index d2278bc3de..deec444e8b 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
@@ -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)
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
index fb07cc9ca0..d651cb26f8 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
@@ -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)
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 2fff53350f..a19bbfdddf 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -77,7 +77,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
private Stream m_loadStream;
- protected bool m_controlFileLoaded;
+ ///
+ /// Has the control file been loaded for this archive?
+ ///
+ public bool ControlFileLoaded { get; private set; }
+
+ ///
+ /// 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.
+ ///
+ 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;
}
///
@@ -517,7 +532,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
///
///
- 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
///
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
///
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;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 5e5f6c0590..dd16bfec1f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -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);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index d03f6da295..52232a0c9e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -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)));
- }
+ }
+
+ ///
+ /// Test that the IAR has the required files in the right order.
+ ///
+ ///
+ /// At the moment, the only thing that matters is that the control file is the very first one.
+ ///
+ [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);
+ }
///
/// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 6d40e12cd3..a165bbd123 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -213,19 +213,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return UUID.Zero;
}
-
- ///
- /// Delete a scene object from a scene and place in the given avatar's inventory.
- /// Returns the UUID of the newly created asset.
- ///
- ///
- ///
- ///
- ///
- public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
+
+ public virtual UUID CopyToInventory(DeRezAction action, UUID folderID,
List objectGroups, IClientAPI remoteClient)
{
- Dictionary> deletes = new Dictionary>();
+ Dictionary> bundlesToCopy = new Dictionary>();
if (CoalesceMultipleObjectsToInventory)
{
@@ -234,10 +226,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// reasons.
foreach (SceneObjectGroup g in objectGroups)
{
- if (!deletes.ContainsKey(g.OwnerID))
- deletes[g.OwnerID] = new List();
+ if (!bundlesToCopy.ContainsKey(g.OwnerID))
+ bundlesToCopy[g.OwnerID] = new List();
- deletes[g.OwnerID].Add(g);
+ bundlesToCopy[g.OwnerID].Add(g);
}
}
else
@@ -247,7 +239,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
List bundle = new List();
bundle.Add(g);
- deletes[g.UUID] = bundle;
+ bundlesToCopy[g.UUID] = bundle;
}
}
@@ -257,328 +249,348 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// Each iteration is really a separate asset being created,
// with distinct destinations as well.
- foreach (List objlist in deletes.Values)
+ foreach (List bundle in bundlesToCopy.Values)
+ assetID = CopyBundleToInventory(action, folderID, bundle, remoteClient);
+
+ return assetID;
+ }
+
+ ///
+ /// Copy a bundle of objects to inventory. If there is only one object, then this will create an object
+ /// item. If there are multiple objects then these will be saved as a single coalesced item.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected UUID CopyBundleToInventory(
+ DeRezAction action, UUID folderID, List objlist, IClientAPI remoteClient)
+ {
+ UUID assetID = UUID.Zero;
+
+ CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero);
+ Dictionary originalPositions = new Dictionary();
+
+ Dictionary xmlStrings =
+ new Dictionary();
+
+ foreach (SceneObjectGroup objectGroup in objlist)
{
- Dictionary xmlStrings =
- new Dictionary();
+ Vector3 inventoryStoredPosition = new Vector3
+ (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
+ ? 250
+ : objectGroup.AbsolutePosition.X)
+ ,
+ (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize)
+ ? 250
+ : objectGroup.AbsolutePosition.Y,
+ objectGroup.AbsolutePosition.Z);
- foreach (SceneObjectGroup objectGroup in objlist)
+ Vector3 originalPosition = objectGroup.AbsolutePosition;
+
+ // Restore attachment data after trip through the sim
+ if (objectGroup.RootPart.AttachPoint > 0)
+ inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
+ objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
+
+ objectGroup.AbsolutePosition = inventoryStoredPosition;
+
+ // Make sure all bits but the ones we want are clear
+ // on take.
+ // This will be applied to the current perms, so
+ // it will do what we want.
+ objectGroup.RootPart.NextOwnerMask &=
+ ((uint)PermissionMask.Copy |
+ (uint)PermissionMask.Transfer |
+ (uint)PermissionMask.Modify);
+ objectGroup.RootPart.NextOwnerMask |=
+ (uint)PermissionMask.Move;
+
+ string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
+
+ objectGroup.AbsolutePosition = originalPosition;
+
+ xmlStrings[objectGroup.UUID] = sceneObjectXml;
+ }
+
+ string itemXml;
+
+ if (objlist.Count > 1)
+ {
+ float minX, minY, minZ;
+ float maxX, maxY, maxZ;
+
+ Vector3[] offsets = Scene.GetCombinedBoundingBox(objlist,
+ out minX, out maxX, out minY, out maxY,
+ out minZ, out maxZ);
+
+ // CreateWrapper
+ XmlDocument itemDoc = new XmlDocument();
+ XmlElement root = itemDoc.CreateElement("", "CoalescedObject", "");
+ itemDoc.AppendChild(root);
+
+ // Embed the offsets into the group XML
+ for ( int i = 0 ; i < objlist.Count ; i++ )
{
- Vector3 inventoryStoredPosition = new Vector3
- (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
- ? 250
- : objectGroup.AbsolutePosition.X)
- ,
- (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize)
- ? 250
- : objectGroup.AbsolutePosition.Y,
- objectGroup.AbsolutePosition.Z);
+ XmlDocument doc = new XmlDocument();
+ SceneObjectGroup g = objlist[i];
+ doc.LoadXml(xmlStrings[g.UUID]);
+ XmlElement e = (XmlElement)doc.SelectSingleNode("/SceneObjectGroup");
+ e.SetAttribute("offsetx", offsets[i].X.ToString());
+ e.SetAttribute("offsety", offsets[i].Y.ToString());
+ e.SetAttribute("offsetz", offsets[i].Z.ToString());
- Vector3 originalPosition = objectGroup.AbsolutePosition;
-
- // Restore attachment data after trip through the sim
- if (objectGroup.RootPart.AttachPoint > 0)
- inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
- objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
-
- objectGroup.AbsolutePosition = inventoryStoredPosition;
-
- // Make sure all bits but the ones we want are clear
- // on take.
- // This will be applied to the current perms, so
- // it will do what we want.
- objectGroup.RootPart.NextOwnerMask &=
- ((uint)PermissionMask.Copy |
- (uint)PermissionMask.Transfer |
- (uint)PermissionMask.Modify);
- objectGroup.RootPart.NextOwnerMask |=
- (uint)PermissionMask.Move;
-
- string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
-
- objectGroup.AbsolutePosition = originalPosition;
-
- xmlStrings[objectGroup.UUID] = sceneObjectXml;
+ XmlNode objectNode = itemDoc.ImportNode(e, true);
+ root.AppendChild(objectNode);
}
- string itemXml;
+ float sizeX = maxX - minX;
+ float sizeY = maxY - minY;
+ float sizeZ = maxZ - minZ;
- if (objlist.Count > 1)
- {
- float minX, minY, minZ;
- float maxX, maxY, maxZ;
+ root.SetAttribute("x", sizeX.ToString());
+ root.SetAttribute("y", sizeY.ToString());
+ root.SetAttribute("z", sizeZ.ToString());
- Vector3[] offsets = Scene.GetCombinedBoundingBox(objlist,
- out minX, out maxX, out minY, out maxY,
- out minZ, out maxZ);
+ itemXml = itemDoc.InnerXml;
+ }
+ else
+ {
+ itemXml = xmlStrings[objlist[0].UUID];
+ }
- // CreateWrapper
- XmlDocument itemDoc = new XmlDocument();
- XmlElement root = itemDoc.CreateElement("", "CoalescedObject", "");
- itemDoc.AppendChild(root);
+ // Get the user info of the item destination
+ //
+ UUID userID = UUID.Zero;
- // Embed the offsets into the group XML
- for ( int i = 0 ; i < objlist.Count ; i++ )
- {
- XmlDocument doc = new XmlDocument();
- SceneObjectGroup g = objlist[i];
- doc.LoadXml(xmlStrings[g.UUID]);
- XmlElement e = (XmlElement)doc.SelectSingleNode("/SceneObjectGroup");
- e.SetAttribute("offsetx", offsets[i].X.ToString());
- e.SetAttribute("offsety", offsets[i].Y.ToString());
- e.SetAttribute("offsetz", offsets[i].Z.ToString());
-
- XmlNode objectNode = itemDoc.ImportNode(e, true);
- root.AppendChild(objectNode);
- }
-
- float sizeX = maxX - minX;
- float sizeY = maxY - minY;
- float sizeZ = maxZ - minZ;
-
- root.SetAttribute("x", sizeX.ToString());
- root.SetAttribute("y", sizeY.ToString());
- root.SetAttribute("z", sizeZ.ToString());
-
- itemXml = itemDoc.InnerXml;
- }
- else
- {
- itemXml = xmlStrings[objlist[0].UUID];
- }
-
- // Get the user info of the item destination
+ if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
+ action == DeRezAction.SaveToExistingUserInventoryItem)
+ {
+ // Take or take copy require a taker
+ // Saving changes requires a local user
//
- UUID userID = UUID.Zero;
+ if (remoteClient == null)
+ return UUID.Zero;
- if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
- action == DeRezAction.SaveToExistingUserInventoryItem)
- {
- // Take or take copy require a taker
- // Saving changes requires a local user
- //
- if (remoteClient == null)
- return UUID.Zero;
-
- userID = remoteClient.AgentId;
- }
- else
- {
- // All returns / deletes go to the object owner
- //
-
- userID = objlist[0].RootPart.OwnerID;
- }
-
- if (userID == UUID.Zero) // Can't proceed
+ userID = remoteClient.AgentId;
+ }
+ else
+ {
+ // All returns / deletes go to the object owner
+ //
+
+ userID = objlist[0].RootPart.OwnerID;
+ }
+
+ if (userID == UUID.Zero) // Can't proceed
+ {
+ return UUID.Zero;
+ }
+
+ // If we're returning someone's item, it goes back to the
+ // owner's Lost And Found folder.
+ // Delete is treated like return in this case
+ // Deleting your own items makes them go to trash
+ //
+
+ InventoryFolderBase folder = null;
+ InventoryItemBase item = null;
+
+ if (DeRezAction.SaveToExistingUserInventoryItem == action)
+ {
+ item = new InventoryItemBase(objlist[0].RootPart.FromUserInventoryItemID, userID);
+ item = m_Scene.InventoryService.GetItem(item);
+
+ //item = userInfo.RootFolder.FindItem(
+ // objectGroup.RootPart.FromUserInventoryItemID);
+
+ if (null == item)
{
+ m_log.DebugFormat(
+ "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
+ objlist[0].Name, objlist[0].UUID);
return UUID.Zero;
}
-
- // If we're returning someone's item, it goes back to the
- // owner's Lost And Found folder.
- // Delete is treated like return in this case
- // Deleting your own items makes them go to trash
+ }
+ else
+ {
+ // Folder magic
//
-
- InventoryFolderBase folder = null;
- InventoryItemBase item = null;
-
- if (DeRezAction.SaveToExistingUserInventoryItem == action)
+ if (action == DeRezAction.Delete)
{
- item = new InventoryItemBase(objlist[0].RootPart.FromUserInventoryItemID, userID);
- item = m_Scene.InventoryService.GetItem(item);
-
- //item = userInfo.RootFolder.FindItem(
- // objectGroup.RootPart.FromUserInventoryItemID);
-
- if (null == item)
+ // Deleting someone else's item
+ //
+ if (remoteClient == null ||
+ objlist[0].OwnerID != remoteClient.AgentId)
{
- m_log.DebugFormat(
- "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
- objlist[0].Name, objlist[0].UUID);
- return UUID.Zero;
+
+ folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
+ }
+ else
+ {
+ folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
}
}
- else
+ else if (action == DeRezAction.Return)
{
- // Folder magic
+
+ // Dump to lost + found unconditionally
//
+ folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
+ }
+
+ if (folderID == UUID.Zero && folder == null)
+ {
if (action == DeRezAction.Delete)
{
- // Deleting someone else's item
+ // Deletes go to trash by default
//
+ folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
+ }
+ else
+ {
if (remoteClient == null ||
objlist[0].OwnerID != remoteClient.AgentId)
{
+ // Taking copy of another person's item. Take to
+ // Objects folder.
+ folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
+ }
+ else
+ {
+ // Catch all. Use lost & found
+ //
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
}
- else
- {
- folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
- }
- }
- else if (action == DeRezAction.Return)
- {
-
- // Dump to lost + found unconditionally
- //
- folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
- }
-
- if (folderID == UUID.Zero && folder == null)
- {
- if (action == DeRezAction.Delete)
- {
- // Deletes go to trash by default
- //
- folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
- }
- else
- {
- if (remoteClient == null ||
- objlist[0].OwnerID != remoteClient.AgentId)
- {
- // Taking copy of another person's item. Take to
- // Objects folder.
- folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
- }
- else
- {
- // Catch all. Use lost & found
- //
-
- folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
- }
- }
- }
-
- // Override and put into where it came from, if it came
- // from anywhere in inventory
- //
- if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
- {
- if (objlist[0].RootPart.FromFolderID != UUID.Zero && objlist[0].OwnerID == remoteClient.AgentId)
- {
- InventoryFolderBase f = new InventoryFolderBase(objlist[0].RootPart.FromFolderID, userID);
- folder = m_Scene.InventoryService.GetFolder(f);
- }
- }
-
- if (folder == null) // None of the above
- {
- folder = new InventoryFolderBase(folderID);
-
- if (folder == null) // Nowhere to put it
- {
- return UUID.Zero;
- }
- }
-
- item = new InventoryItemBase();
- // Can't know creator is the same, so null it in inventory
- if (objlist.Count > 1)
- {
- item.CreatorId = UUID.Zero.ToString();
- item.CreatorData = String.Empty;
- }
- else
- {
- item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
- item.CreatorData = objlist[0].RootPart.CreatorData;
- }
- item.ID = UUID.Random();
- item.InvType = (int)InventoryType.Object;
- item.Folder = folder.ID;
- item.Owner = userID;
- if (objlist.Count > 1)
- {
- item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems;
- }
- else
- {
- item.SaleType = objlist[0].RootPart.ObjectSaleType;
- item.SalePrice = objlist[0].RootPart.SalePrice;
}
}
- AssetBase asset = CreateAsset(
- objlist[0].GetPartName(objlist[0].RootPart.LocalId),
- objlist[0].GetPartDescription(objlist[0].RootPart.LocalId),
- (sbyte)AssetType.Object,
- Utils.StringToBytes(itemXml),
- objlist[0].OwnerID.ToString());
- m_Scene.AssetService.Store(asset);
- assetID = asset.FullID;
-
- if (DeRezAction.SaveToExistingUserInventoryItem == action)
+ // Override and put into where it came from, if it came
+ // from anywhere in inventory
+ //
+ if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
{
- item.AssetID = asset.FullID;
- m_Scene.InventoryService.UpdateItem(item);
+ if (objlist[0].RootPart.FromFolderID != UUID.Zero && objlist[0].OwnerID == remoteClient.AgentId)
+ {
+ InventoryFolderBase f = new InventoryFolderBase(objlist[0].RootPart.FromFolderID, userID);
+ folder = m_Scene.InventoryService.GetFolder(f);
+ }
+ }
+
+ if (folder == null) // None of the above
+ {
+ folder = new InventoryFolderBase(folderID);
+
+ if (folder == null) // Nowhere to put it
+ {
+ return UUID.Zero;
+ }
+ }
+
+ item = new InventoryItemBase();
+ // Can't know creator is the same, so null it in inventory
+ if (objlist.Count > 1)
+ {
+ item.CreatorId = UUID.Zero.ToString();
+ item.CreatorData = String.Empty;
}
else
{
- item.AssetID = asset.FullID;
+ item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
+ item.CreatorData = objlist[0].RootPart.CreatorData;
+ }
+ item.ID = UUID.Random();
+ item.InvType = (int)InventoryType.Object;
+ item.Folder = folder.ID;
+ item.Owner = userID;
+ if (objlist.Count > 1)
+ {
+ item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems;
+ }
+ else
+ {
+ item.SaleType = objlist[0].RootPart.ObjectSaleType;
+ item.SalePrice = objlist[0].RootPart.SalePrice;
+ }
+ }
- uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move) | 7;
- foreach (SceneObjectGroup grp in objlist)
- effectivePerms &= grp.GetEffectivePermissions();
- effectivePerms |= (uint)PermissionMask.Move;
+ AssetBase asset = CreateAsset(
+ objlist[0].GetPartName(objlist[0].RootPart.LocalId),
+ objlist[0].GetPartDescription(objlist[0].RootPart.LocalId),
+ (sbyte)AssetType.Object,
+ Utils.StringToBytes(itemXml),
+ objlist[0].OwnerID.ToString());
+ m_Scene.AssetService.Store(asset);
+ assetID = asset.FullID;
- if (remoteClient != null && (remoteClient.AgentId != objlist[0].RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
+ if (DeRezAction.SaveToExistingUserInventoryItem == action)
+ {
+ item.AssetID = asset.FullID;
+ m_Scene.InventoryService.UpdateItem(item);
+ }
+ else
+ {
+ item.AssetID = asset.FullID;
+
+ uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move) | 7;
+ foreach (SceneObjectGroup grp in objlist)
+ effectivePerms &= grp.GetEffectivePermissions();
+ effectivePerms |= (uint)PermissionMask.Move;
+
+ if (remoteClient != null && (remoteClient.AgentId != objlist[0].RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
+ {
+ uint perms = effectivePerms;
+ uint nextPerms = (perms & 7) << 13;
+ if ((nextPerms & (uint)PermissionMask.Copy) == 0)
+ perms &= ~(uint)PermissionMask.Copy;
+ if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
+ perms &= ~(uint)PermissionMask.Transfer;
+ if ((nextPerms & (uint)PermissionMask.Modify) == 0)
+ perms &= ~(uint)PermissionMask.Modify;
+
+ item.BasePermissions = perms & objlist[0].RootPart.NextOwnerMask;
+ item.CurrentPermissions = item.BasePermissions;
+ item.NextPermissions = perms & objlist[0].RootPart.NextOwnerMask;
+ item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask;
+ item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask;
+
+ item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
+ }
+ else
+ {
+ item.BasePermissions = effectivePerms;
+ item.CurrentPermissions = effectivePerms;
+ item.NextPermissions = objlist[0].RootPart.NextOwnerMask & effectivePerms;
+ item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & effectivePerms;
+ item.GroupPermissions = objlist[0].RootPart.GroupMask & effectivePerms;
+
+ item.CurrentPermissions &=
+ ((uint)PermissionMask.Copy |
+ (uint)PermissionMask.Transfer |
+ (uint)PermissionMask.Modify |
+ (uint)PermissionMask.Move |
+ 7); // Preserve folded permissions
+ }
+
+ item.CreationDate = Util.UnixTimeSinceEpoch();
+ item.Description = asset.Description;
+ item.Name = asset.Name;
+ item.AssetType = asset.Type;
+
+ m_Scene.AddInventoryItem(item);
+
+ if (remoteClient != null && item.Owner == remoteClient.AgentId)
+ {
+ remoteClient.SendInventoryItemCreateUpdate(item, 0);
+ }
+ else
+ {
+ ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner);
+ if (notifyUser != null)
{
- uint perms = effectivePerms;
- uint nextPerms = (perms & 7) << 13;
- if ((nextPerms & (uint)PermissionMask.Copy) == 0)
- perms &= ~(uint)PermissionMask.Copy;
- if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
- perms &= ~(uint)PermissionMask.Transfer;
- if ((nextPerms & (uint)PermissionMask.Modify) == 0)
- perms &= ~(uint)PermissionMask.Modify;
-
- item.BasePermissions = perms & objlist[0].RootPart.NextOwnerMask;
- item.CurrentPermissions = item.BasePermissions;
- item.NextPermissions = perms & objlist[0].RootPart.NextOwnerMask;
- item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask;
- item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask;
-
- item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
- }
- else
- {
- item.BasePermissions = effectivePerms;
- item.CurrentPermissions = effectivePerms;
- item.NextPermissions = objlist[0].RootPart.NextOwnerMask & effectivePerms;
- item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & effectivePerms;
- item.GroupPermissions = objlist[0].RootPart.GroupMask & effectivePerms;
-
- item.CurrentPermissions &=
- ((uint)PermissionMask.Copy |
- (uint)PermissionMask.Transfer |
- (uint)PermissionMask.Modify |
- (uint)PermissionMask.Move |
- 7); // Preserve folded permissions
- }
-
- item.CreationDate = Util.UnixTimeSinceEpoch();
- item.Description = asset.Description;
- item.Name = asset.Name;
- item.AssetType = asset.Type;
-
- m_Scene.AddInventoryItem(item);
-
- if (remoteClient != null && item.Owner == remoteClient.AgentId)
- {
- remoteClient.SendInventoryItemCreateUpdate(item, 0);
- }
- else
- {
- ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner);
- if (notifyUser != null)
- {
- notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
- }
+ notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
}
}
}
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index b1dec4cc2d..930a1177db 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -57,6 +57,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// bumps here should be compatible.
///
public static int MAX_MAJOR_VERSION = 1;
+
+ ///
+ /// Has the control file been loaded for this archive?
+ ///
+ public bool ControlFileLoaded { get; private set; }
protected Scene m_scene;
protected Stream m_loadStream;
@@ -545,7 +550,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
///
///
///
- protected void LoadControlFile(string path, byte[] data)
+ public void LoadControlFile(string path, byte[] data)
{
XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
@@ -591,6 +596,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
}
currentRegionSettings.Save();
+
+ ControlFileLoaded = true;
}
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index f2d487ef94..597b7809e5 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
///
public static string CreateControlFile(Dictionary options)
{
- int majorVersion = MAX_MAJOR_VERSION, minorVersion = 5;
+ int majorVersion = MAX_MAJOR_VERSION, minorVersion = 6;
//
// if (options.ContainsKey("version"))
// {
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index e2760a2065..2307c8e585 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -171,7 +171,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
MemoryStream archiveReadStream = new MemoryStream(archive);
TarArchiveReader tar = new TarArchiveReader(archiveReadStream);
- bool gotControlFile = false;
bool gotNcAssetFile = false;
string expectedNcAssetFileName = string.Format("{0}_{1}", ncAssetUuid, "notecard.txt");
@@ -182,15 +181,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2));
string filePath;
- TarArchiveReader.TarEntryType tarEntryType;
+ TarArchiveReader.TarEntryType tarEntryType;
+ byte[] data = tar.ReadEntry(out filePath, out tarEntryType);
+ Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
+
+ ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, false, false, Guid.Empty);
+ arr.LoadControlFile(filePath, data);
+
+ Assert.That(arr.ControlFileLoaded, Is.True);
+
while (tar.ReadEntry(out filePath, out tarEntryType) != null)
{
- if (ArchiveConstants.CONTROL_FILE_PATH == filePath)
- {
- gotControlFile = true;
- }
- else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
+ if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
{
string fileName = filePath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
@@ -203,7 +206,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
}
}
- Assert.That(gotControlFile, Is.True, "No control file in archive");
Assert.That(gotNcAssetFile, Is.True, "No notecard asset file in archive");
Assert.That(foundPaths, Is.EquivalentTo(expectedPaths));
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
index 05fc2add3e..305975e855 100644
--- a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
@@ -38,7 +38,23 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IInventoryAccessModule
{
UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data);
- UUID DeleteToInventory(DeRezAction action, UUID folderID, List objectGroups, IClientAPI remoteClient);
+
+ ///
+ /// Copy objects to a user's inventory.
+ ///
+ ///
+ /// Is it left to the caller to delete them from the scene if required.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Returns the UUID of the newly created item asset (not the item itself).
+ /// FIXME: This is not very useful. It would be far more useful to return a list of items instead.
+ ///
+ UUID CopyToInventory(DeRezAction action, UUID folderID, List objectGroups, IClientAPI remoteClient);
+
SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index a8d24fd13f..088839d080 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -150,7 +150,8 @@ namespace OpenSim.Region.Framework.Scenes
{
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface();
if (invAccess != null)
- invAccess.DeleteToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient);
+ invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient);
+
if (x.permissionToDelete)
{
foreach (SceneObjectGroup g in x.objectGroups)
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 0e679a9b4a..b59f6e1ea9 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
if (serviceDll == String.Empty)
{
- m_log.Error("[FreeSwitchVoice]: No LocalServiceModule named in section FreeSwitchVoice");
+ m_log.Error("[FreeSwitchVoice]: No LocalServiceModule named in section FreeSwitchVoice. Not starting.");
return;
}
@@ -143,8 +143,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
if (String.IsNullOrEmpty(m_freeSwitchRealm) ||
String.IsNullOrEmpty(m_freeSwitchAPIPrefix))
{
- m_log.Error("[FreeSwitchVoice] plugin mis-configured");
- m_log.Info("[FreeSwitchVoice] plugin disabled: incomplete configuration");
+ m_log.Error("[FreeSwitchVoice]: Freeswitch service mis-configured. Not starting.");
return;
}
@@ -164,24 +163,24 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
// String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler);
// MainServer.Instance.AddStreamHandler(h);
-
-
MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix),
FreeSwitchSLVoiceSigninHTTPHandler);
MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix),
FreeSwitchSLVoiceBuddyHTTPHandler);
+
+ MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_watcher.php", m_freeSwitchAPIPrefix),
+ FreeSwitchSLVoiceWatcherHTTPHandler);
- m_log.InfoFormat("[FreeSwitchVoice] using FreeSwitch server {0}", m_freeSwitchRealm);
+ m_log.InfoFormat("[FreeSwitchVoice]: using FreeSwitch server {0}", m_freeSwitchRealm);
m_Enabled = true;
- m_log.Info("[FreeSwitchVoice] plugin enabled");
+ m_log.Info("[FreeSwitchVoice]: plugin enabled");
}
catch (Exception e)
{
- m_log.ErrorFormat("[FreeSwitchVoice] plugin initialization failed: {0}", e.Message);
- m_log.DebugFormat("[FreeSwitchVoice] plugin initialization failed: {0}", e.ToString());
+ m_log.ErrorFormat("[FreeSwitchVoice]: plugin initialization failed: {0} {1}", e.Message, e.StackTrace);
return;
}
@@ -240,7 +239,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
{
if (m_Enabled)
{
- m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene");
+ m_log.Info("[FreeSwitchVoice]: registering IVoiceModule with the scene");
// register the voice interface for this module, so the script engine can call us
scene.RegisterModuleInterface(this);
@@ -302,7 +301,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
//
public void OnRegisterCaps(Scene scene, UUID agentID, Caps caps)
{
- m_log.DebugFormat("[FreeSwitchVoice] OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
+ m_log.DebugFormat(
+ "[FreeSwitchVoice]: OnRegisterCaps() called with agentID {0} caps {1} in scene {2}",
+ agentID, caps, scene.RegionInfo.RegionName);
string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler("ProvisionVoiceAccountRequest",
@@ -344,6 +345,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
public string ProvisionVoiceAccountRequest(Scene scene, string request, string path, string param,
UUID agentID, Caps caps)
{
+ m_log.DebugFormat(
+ "[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request: {0}, path: {1}, param: {2}", request, path, param);
+
ScenePresence avatar = scene.GetScenePresence(agentID);
if (avatar == null)
{
@@ -357,9 +361,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
try
{
- //m_log.DebugFormat("[FreeSwitchVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}",
- // request, path, param);
-
//XmlElement resp;
string agentname = "x" + Convert.ToBase64String(agentID.GetBytes());
string password = "1234";//temp hack//new UUID(Guid.NewGuid()).ToString().Replace('-','Z').Substring(0,16);
@@ -416,6 +417,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
public string ParcelVoiceInfoRequest(Scene scene, string request, string path, string param,
UUID agentID, Caps caps)
{
+// m_log.DebugFormat(
+// "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}",
+// scene.RegionInfo.RegionName, agentID);
+
ScenePresence avatar = scene.GetScenePresence(agentID);
string avatarName = avatar.Name;
@@ -502,6 +507,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
m_log.DebugFormat("[FreeSwitchVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}",
avatarName, request, path, param);
+
return "true";
}
@@ -555,7 +561,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
return response;
}
-
public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request)
{
// m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called");
@@ -592,6 +597,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
public Hashtable FreeSwitchSLVoiceBuddyHTTPHandler(Hashtable request)
{
+ m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceBuddyHTTPHandler called");
+
Hashtable response = new Hashtable();
response["int_response_code"] = 200;
response["str_response_string"] = string.Empty;
@@ -650,18 +657,61 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
A
{3}
- ", ids[i],i,m_freeSwitchRealm,dt));
+ ", ids[i], i ,m_freeSwitchRealm, dt));
}
resp.Append("