From d95d3b949bc5c8a9425ea096fb721a9cc0111e67 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 18 Aug 2009 07:05:22 -0700
Subject: Fixes mantis #4020 (http://opensimulator.org/mantis/view.php?id=4020)
---
.../Framework/Scenes/Scene.PacketHandlers.cs | 26 ++++++++++------------
1 file changed, 12 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 2bf4ea8..fde922f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -517,21 +517,19 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
- CachedUserInfo userProfile = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
-
- if (null == userProfile)
- {
- m_log.ErrorFormat(
- "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
- remoteClient.Name, remoteClient.AgentId);
- return;
- }
-
- if (!userProfile.UpdateFolder(name, folderID, type, parentID))
+ InventoryFolderBase folder = new InventoryFolderBase(folderID);
+ folder = InventoryService.GetFolder(folder);
+ if (folder != null)
{
- m_log.ErrorFormat(
- "[AGENT INVENTORY]: Failed to update folder for user {0} {1}",
- remoteClient.Name, remoteClient.AgentId);
+ folder.Name = name;
+ folder.Type = (short)type;
+ folder.ParentID = parentID;
+ if (!InventoryService.UpdateFolder(folder))
+ {
+ m_log.ErrorFormat(
+ "[AGENT INVENTORY]: Failed to update folder for user {0} {1}",
+ remoteClient.Name, remoteClient.AgentId);
+ }
}
}
--
cgit v1.1
From 124f66bfc25984a01491b8447fa97bea2633281c Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 18 Aug 2009 22:17:47 -0700
Subject: jhurliman's patch in http://opensimulator.org/mantis/view.php?id=4024
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 35 ++++++++++++++--------
.../Framework/Scenes/Scene.PacketHandlers.cs | 3 +-
2 files changed, 25 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 46777e1..48c7f4e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -140,7 +140,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data)
{
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
if (item != null)
{
@@ -315,7 +316,8 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
UUID itemID, InventoryItemBase itemUpd)
{
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
if (item != null)
{
@@ -408,7 +410,8 @@ namespace OpenSim.Region.Framework.Scenes
{
Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem");
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemId));
+ InventoryItemBase item = new InventoryItemBase(itemId, senderId);
+ item = InventoryService.GetItem(item);
if ((item != null) && (item.Owner == senderId))
{
@@ -558,7 +561,8 @@ namespace OpenSim.Region.Framework.Scenes
if (item == null)
{
- item = InventoryService.GetItem(new InventoryItemBase(oldItemID));
+ item = new InventoryItemBase(oldItemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
if (item == null)
{
@@ -636,7 +640,8 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat(
"[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId);
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
if (item != null)
{
@@ -1224,7 +1229,8 @@ namespace OpenSim.Region.Framework.Scenes
UUID copyID = UUID.Random();
if (itemID != UUID.Zero)
{
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
// Try library
if (null == item)
@@ -1287,7 +1293,8 @@ namespace OpenSim.Region.Framework.Scenes
if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory
{
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
// Try library
// XXX clumsy, possibly should be one call
@@ -1672,7 +1679,7 @@ namespace OpenSim.Region.Framework.Scenes
if (DeRezAction.SaveToExistingUserInventoryItem == action)
{
- item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID);
+ item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID, userID);
item = InventoryService.GetItem(item);
//item = userInfo.RootFolder.FindItem(
@@ -1834,7 +1841,8 @@ namespace OpenSim.Region.Framework.Scenes
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
if (item != null)
{
@@ -1984,7 +1992,8 @@ namespace OpenSim.Region.Framework.Scenes
BypassRayCast, bRayEndIsIntersection,true,scale, false);
// Rez object
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
if (item != null)
{
@@ -2309,7 +2318,8 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence presence;
if (TryGetAvatar(remoteClient.AgentId, out presence))
{
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID, remoteClient.AgentId));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
IAvatarFactory ava = RequestModuleInterface();
@@ -2360,7 +2370,8 @@ namespace OpenSim.Region.Framework.Scenes
if (TryGetAvatar(remoteClient.AgentId, out presence))
{
// XXYY!!
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
IAvatarFactory ava = RequestModuleInterface();
if (ava != null)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index fde922f..1bbca49 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -404,7 +404,8 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
if (item != null)
{
--
cgit v1.1
From c5af39239f7f2a1725d9c08bea80522de8835e0f Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 19 Aug 2009 00:13:51 -0700
Subject: A better purge of trash folder.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 31 +++++++++++++++++-----
.../Framework/Scenes/Scene.PacketHandlers.cs | 2 +-
2 files changed, 25 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 48c7f4e..5e2eb73 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -477,7 +477,11 @@ namespace OpenSim.Region.Framework.Scenes
if (!Permissions.BypassPermissions())
{
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
- InventoryService.DeleteItem(new InventoryItemBase(itemId));
+ {
+ List items = new List();
+ items.Add(itemId);
+ InventoryService.DeleteItems(senderId, items);
+ }
}
return itemCopy;
@@ -652,7 +656,9 @@ namespace OpenSim.Region.Framework.Scenes
item.Folder = folderID;
// Diva comment: can't we just update?
- InventoryService.DeleteItem(item);
+ List uuids = new List();
+ uuids.Add(item.ID);
+ InventoryService.DeleteItems(item.Owner, uuids);
AddInventoryItem(remoteClient, item);
}
@@ -799,9 +805,10 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- private void RemoveInventoryItem(IClientAPI remoteClient, UUID itemID)
+ private void RemoveInventoryItem(IClientAPI remoteClient, List itemIDs)
{
- InventoryService.DeleteItem(new InventoryItemBase(itemID));
+ //m_log.Debug("[SCENE INVENTORY]: user " + remoteClient.AgentId);
+ InventoryService.DeleteItems(remoteClient.AgentId, itemIDs);
}
///
@@ -1248,7 +1255,11 @@ namespace OpenSim.Region.Framework.Scenes
if (!Permissions.BypassPermissions())
{
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
- RemoveInventoryItem(remoteClient, itemID);
+ {
+ List uuids = new List();
+ uuids.Add(itemID);
+ RemoveInventoryItem(remoteClient, uuids);
+ }
}
}
else
@@ -2144,7 +2155,11 @@ namespace OpenSim.Region.Framework.Scenes
// copy ones will be lost, so avoid it
//
if (!attachment)
- InventoryService.DeleteItem(item);
+ {
+ List uuids = new List();
+ uuids.Add(item.ID);
+ InventoryService.DeleteItems(item.Owner, uuids);
+ }
}
}
@@ -2404,7 +2419,9 @@ namespace OpenSim.Region.Framework.Scenes
}
part.ParentGroup.DetachToGround();
- InventoryService.DeleteItem(new InventoryItemBase(inventoryID));
+ List uuids = new List();
+ uuids.Add(inventoryID);
+ InventoryService.DeleteItems(remoteClient.AgentId, uuids);
remoteClient.SendRemoveInventoryItem(inventoryID);
}
SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 1bbca49..a2414e5 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -560,7 +560,7 @@ namespace OpenSim.Region.Framework.Scenes
public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID)
{
- InventoryFolderBase folder = new InventoryFolderBase(folderID);
+ InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
if (InventoryService.PurgeFolder(folder))
m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID);
--
cgit v1.1
From 4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 19 Aug 2009 00:33:02 -0700
Subject: Async purge so that the client thread doesn't wait.
---
.../Framework/Scenes/Scene.PacketHandlers.cs | 24 ++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index a2414e5..77b980c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using System;
using System.Collections.Generic;
using System.Threading;
using OpenMetaverse;
@@ -558,15 +559,34 @@ namespace OpenSim.Region.Framework.Scenes
///
///
+ delegate void PurgeFolderDelegate(UUID userID, UUID folder);
+
public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID)
{
- InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
+ PurgeFolderDelegate d = PurgeFolderAsync;
+ try
+ {
+ d.BeginInvoke(remoteClient.AgentId, folderID, PurgeFolderCompleted, d);
+ }
+ catch (Exception e)
+ {
+ m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message);
+ }
+ }
+
+
+ private void PurgeFolderAsync(UUID userID, UUID folderID)
+ {
+ InventoryFolderBase folder = new InventoryFolderBase(folderID, userID);
if (InventoryService.PurgeFolder(folder))
m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID);
else
m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID);
- }
+ }
+ private void PurgeFolderCompleted(IAsyncResult iar)
+ {
+ }
}
}
--
cgit v1.1
From d519f1885f587409592cf92bc0f4ba8533a1866f Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 19 Aug 2009 10:56:08 -0700
Subject: Added MoveItems, which is most useful upon viewer-delete inventory
operation. Moving a batch of items is a 1-time operation. Made it async
anyway, so that the viewer doesn't wait in case the DB layer is dumb (which
is the case currently).
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 31 +++-------------------
1 file changed, 4 insertions(+), 27 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 5e2eb73..a119efc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -638,36 +638,13 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- public void MoveInventoryItem(IClientAPI remoteClient, UUID folderID, UUID itemID, int length,
- string newName)
+ public void MoveInventoryItem(IClientAPI remoteClient, List items)
{
m_log.DebugFormat(
- "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId);
+ "[AGENT INVENTORY]: Moving {0} items for user {1}", items.Count, remoteClient.AgentId);
- InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
- item = InventoryService.GetItem(item);
-
- if (item != null)
- {
- if (newName != String.Empty)
- {
- item.Name = newName;
- }
- item.Folder = folderID;
-
- // Diva comment: can't we just update?
- List uuids = new List();
- uuids.Add(item.ID);
- InventoryService.DeleteItems(item.Owner, uuids);
-
- AddInventoryItem(remoteClient, item);
- }
- else
- {
- m_log.Warn("[AGENT INVENTORY]: Failed to find item " + itemID.ToString());
-
- return;
- }
+ if (!InventoryService.MoveItems(remoteClient.AgentId, items))
+ m_log.Warn("[AGENT INVENTORY]: Failed to move items for user " + remoteClient.AgentId);
}
///
--
cgit v1.1
From 6e35ddb0e9642e6719d5043da99d45f8885d13f0 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 19 Aug 2009 16:15:04 -0700
Subject: Fixes GetItem and GetFolder for SQLite. Turns out some methods were
no-op in SQlite. Fixes most grief in
http://opensimulator.org/mantis/view.php?id=4035
http://opensimulator.org/mantis/view.php?id=4027
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a119efc..a9d361b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -179,8 +179,8 @@ namespace OpenSim.Region.Framework.Scenes
else
{
m_log.ErrorFormat(
- "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update",
- remoteClient.AgentId);
+ "[AGENT INVENTORY]: Could not find item {0} for caps inventory update",
+ itemID);
}
return UUID.Zero;
--
cgit v1.1
From 948c7ea20b1e33ee3f3aceb87fff731ddbb3bf0e Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 19 Aug 2009 18:08:20 -0700
Subject: Commented T021_TestCrossToNewRegion because (1) it can fail on panda,
and (2) it is not a meaningful representation of region crossing.
---
OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index ce6f3d6..3ee6007 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -225,7 +225,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered");
}
- [Test]
+ // I'm commenting this test because it does not represent
+ // crossings. The Thread.Sleep's in here are not meaningful mocks,
+ // and they sometimes fail in panda.
+ // We need to talk in order to develop a test
+ // that really tests region crossings. There are 3 async components,
+ // but things are synchronous among them. So there should be
+ // 3 threads in here.
+ //[Test]
public void T021_TestCrossToNewRegion()
{
TestHelper.InMethod();
--
cgit v1.1
From 1604c9d19e12602608dbb402382cde8302185efd Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 20 Aug 2009 10:14:53 -0700
Subject: One more place fixed for setting the inventory folder owner. Thanks
jhurliman.
---
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 77b980c..d722e23 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -519,7 +519,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
- InventoryFolderBase folder = new InventoryFolderBase(folderID);
+ InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
folder = InventoryService.GetFolder(folder);
if (folder != null)
{
--
cgit v1.1
From d4600eec4d4555eec8c2815503a2aa7a75d6d928 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Fri, 21 Aug 2009 13:35:13 +1000
Subject: * Attempting to diagnose a connection bug.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d1f7a4b..b50d0cb 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2044,9 +2044,11 @@ namespace OpenSim.Region.Framework.Scenes
{
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
- m_log.DebugFormat(
- "[SCENE]: Adding new {0} agent for {1} in {2}",
- ((aCircuit.child == true) ? "child" : "root"), client.Name, RegionInfo.RegionName);
+ string logMsg = string.Format("[SCENE]: Adding new {0} agent for {1} in {2}",
+ ((aCircuit.child == true) ? "child" : "root"), client.Name,
+ RegionInfo.RegionName);
+
+ m_log.Debug(logMsg);
CommsManager.UserProfileCacheService.AddNewUser(client.AgentId);
--
cgit v1.1
From 25dbf16cfb1d4c74792eae170bc766d3eb522a24 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Fri, 21 Aug 2009 13:44:20 +1000
Subject: * Once more into the breach!
---
OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b50d0cb..6118a70 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2044,11 +2044,14 @@ namespace OpenSim.Region.Framework.Scenes
{
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
+ m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
+ /*
string logMsg = string.Format("[SCENE]: Adding new {0} agent for {1} in {2}",
((aCircuit.child == true) ? "child" : "root"), client.Name,
RegionInfo.RegionName);
m_log.Debug(logMsg);
+ */
CommsManager.UserProfileCacheService.AddNewUser(client.AgentId);
@@ -2057,7 +2060,7 @@ namespace OpenSim.Region.Framework.Scenes
// HERE!!! Do the initial attachments right here
// first agent upon login is a root agent by design.
// All other AddNewClient calls find aCircuit.child to be true
- if (aCircuit.child == false)
+ if (aCircuit == null || aCircuit.child == false)
{
sp.IsChildAgent = false;
sp.RezAttachments();
--
cgit v1.1
From e4f64dd7147001e1e0ac9bd4a51efec086727b29 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 20 Aug 2009 22:36:47 -0700
Subject: Made HandleFetchInventoryDescendents async, so that the client thread
doesn't wait for the download of the entire inventory.
---
.../Region/Framework/Scenes/Scene.PacketHandlers.cs | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index d722e23..2b815a2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -441,9 +441,24 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
+ // We're going to send the reply async, because there may be
+ // an enormous quantity of packets -- basically the entire inventory!
+ // We don't want to block the client thread while all that is happening.
+ SendInventoryDelegate d = SendInventoryAsync;
+ d.BeginInvoke(remoteClient, folderID, ownerID, fetchFolders, fetchItems, sortOrder, SendInventoryComplete, d);
+ }
+
+ delegate void SendInventoryDelegate(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
+
+ void SendInventoryAsync(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
+ {
SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems);
- }
-
+ }
+
+ void SendInventoryComplete(IAsyncResult iar)
+ {
+ }
+
///
/// Handle the caps inventory descendents fetch.
///
--
cgit v1.1
From b03eeeb9f6331ed36c61f55aef847ce3b2db7ba4 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 22 Aug 2009 10:24:26 -0700
Subject: * Fixes mantis http://opensimulator.org/mantis/view.php?id=4044.
Turns out folders were never being removed from trash when they were singled
out for purging in trash. They were being removed when Trash was purged as a
whole. That behavior is now fixed for the new InventoryService set. * Removed
left-overs from AssetInventoryServer.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 18 +++++-------------
.../Region/Framework/Scenes/Scene.PacketHandlers.cs | 2 +-
2 files changed, 6 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a9d361b..3301536 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -789,23 +789,15 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Removes an inventory folder. Although there is a packet in the Linden protocol for this, it may be
- /// legacy and not currently used (purge folder is used to remove folders from trash instead).
+ /// Removes an inventory folder. This packet is sent when the user
+ /// right-clicks a folder that's already in trash and chooses "purge"
///
///
///
- private void RemoveInventoryFolder(IClientAPI remoteClient, UUID folderID)
+ private void RemoveInventoryFolder(IClientAPI remoteClient, List folderIDs)
{
- // Unclear is this handler is ever called by the Linden client, but it might
-
- InventoryFolderBase folder = new InventoryFolderBase(folderID);
- folder.Owner = remoteClient.AgentId;
- InventoryFolderBase trash = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.TrashFolder);
- if (trash != null)
- {
- folder.ParentID = trash.ID;
- InventoryService.MoveFolder(folder);
- }
+ m_log.DebugFormat("[SCENE INVENTORY]: RemoveInventoryFolders count {0}", folderIDs.Count);
+ InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs);
}
private SceneObjectGroup GetGroupByPrim(uint localID)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 2b815a2..d3e414f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -552,7 +552,7 @@ namespace OpenSim.Region.Framework.Scenes
public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
{
- InventoryFolderBase folder = new InventoryFolderBase(folderID);
+ InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
folder = InventoryService.GetFolder(folder);
if (folder != null)
{
--
cgit v1.1