From 8a8c89a0f32b528bd588715bdbfc875c852e7187 Mon Sep 17 00:00:00 2001 From: Brian McBee Date: Sat, 15 Dec 2007 04:57:14 +0000 Subject: [PATCH] Grid Inventory feature upgrade: renaming folders should now be correct, subfolders work, moving folders works. Tested only in MYSQL, but may work in MSSQL and sqlite. Probably not working in standalone mode. --- .../Cache/InventoryFolderImpl.cs | 10 +++ .../Cache/UserProfileCacheService.cs | 32 +++++++--- .../Communications/IInventoryServices.cs | 1 + .../Communications/InventoryServiceBase.cs | 20 ++++++ .../Data.MSSQL/MSSQLInventoryData.cs | 28 +++++++++ .../Data.MySQL/MySQLInventoryData.cs | 22 +++++++ .../Data.SQLite/SQLiteInventoryStore.cs | 32 ++++++++++ OpenSim/Framework/IClientAPI.cs | 6 +- OpenSim/Framework/InventoryItemBase.cs | 6 ++ .../InventoryServer/GridInventoryService.cs | 59 ++++++++++++++--- OpenSim/Grid/InventoryServer/Main.cs | 4 ++ OpenSim/Region/ClientStack/ClientView.cs | 63 ++++++++++++++++++- .../Local/LocalInventoryService.cs | 5 ++ .../OGS1/OGS1InventoryService.cs | 10 +++ OpenSim/Region/Environment/Scenes/Scene.cs | 1 + .../Examples/SimpleApp/MyNpcCharacter.cs | 3 +- 16 files changed, 281 insertions(+), 21 deletions(-) diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index c07a15bb8a..1d2c920a81 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -142,5 +142,15 @@ namespace OpenSim.Framework.Communications.Cache } return itemList; } + + public List RequestListOfFolders() + { + List folderList = new List(); + foreach (InventoryFolderBase folder in SubFolders.Values) + { + folderList.Add(folder); + } + return folderList; + } } } diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 32d941c1e1..bf7f5c1133 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -147,6 +147,23 @@ namespace OpenSim.Framework.Communications.Cache } } + public void HandleMoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID, LLUUID parentID) + { + CachedUserInfo userProfile; + + if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) + { + if (userProfile.RootFolder != null) + { + InventoryFolderBase baseFolder = new InventoryFolderBase(); + baseFolder.agentID = remoteClient.AgentId; + baseFolder.folderID = folderID; + baseFolder.parentID = parentID; + m_parent.InventoryService.MoveInventoryFolder(remoteClient.AgentId, baseFolder); + } + } + } + /// /// Tell the client about the various child items and folders contained in the requested folder. /// @@ -163,14 +180,15 @@ namespace OpenSim.Framework.Communications.Cache if (folderID == libraryRoot.folderID) { remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, - libraryRoot.RequestListOfItems(), libraryRoot.SubFoldersCount); + libraryRoot.RequestListOfItems(), libraryRoot.RequestListOfFolders(), libraryRoot.SubFoldersCount); return; } if ((fold = libraryRoot.HasSubFolder(folderID)) != null) { - remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.SubFoldersCount); + System.Console.WriteLine("fetching librarysubfolder"); + remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fold.SubFoldersCount); return; } @@ -182,19 +200,19 @@ namespace OpenSim.Framework.Communications.Cache { if (userProfile.RootFolder.folderID == folderID) { + System.Console.Write("fetching root folder"); if (fetchItems) { remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, - userProfile.RootFolder.RequestListOfItems(), userProfile.RootFolder.SubFoldersCount); + userProfile.RootFolder.RequestListOfItems(), userProfile.RootFolder.RequestListOfFolders(), userProfile.RootFolder.SubFoldersCount); } } else { - InventoryFolderImpl folder = userProfile.RootFolder.HasSubFolder(folderID); - - if (fetchItems && folder != null) + if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) { - remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems(), folder.SubFoldersCount); + remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fold.SubFoldersCount); + return; } } } diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index 191cdf2e5f..9c493d48bc 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs @@ -40,6 +40,7 @@ namespace OpenSim.Framework.Communications { void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder); + void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder); void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); void CreateNewUserInventory(LLUUID user); diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 28b81d4d86..1e13031780 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -127,6 +127,17 @@ namespace OpenSim.Framework.Communications return null; } + /// + /// + /// + public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) + { + foreach (KeyValuePair plugin in m_plugins) + { + plugin.Value.moveInventoryFolder(folder); + } + } + /// /// /// @@ -161,6 +172,14 @@ namespace OpenSim.Framework.Communications } } + public void MoveFolder(InventoryFolderBase folder) + { + foreach (KeyValuePair plugin in m_plugins) + { + plugin.Value.moveInventoryFolder(folder); + } + } + public void AddItem(InventoryItemBase item) { foreach (KeyValuePair plugin in m_plugins) @@ -251,6 +270,7 @@ namespace OpenSim.Framework.Communications InventoryItemInfo itemCallBack); public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder); + public abstract void MoveExistingInventoryFolder(InventoryFolderBase folder); public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); } diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs index ef2a0f3d29..69b53a389f 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs @@ -604,6 +604,34 @@ namespace OpenSim.Framework.Data.MSSQL } + /// + /// Updates an inventory folder + /// + /// Folder to update + + public void moveInventoryFolder(InventoryFolderBase folder) + { + SqlCommand command = new SqlCommand("UPDATE inventoryfolders set folderID = @folderID, " + + "parentFolderID = @parentFolderID," + + "folderID = @keyFolderID;", database.getConnection()); + SqlParameter param1 = new SqlParameter("@folderID", folder.folderID.ToStringHyphenated()); + SqlParameter param2 = new SqlParameter("@parentFolderID", folder.parentID.ToStringHyphenated()); + SqlParameter param3 = new SqlParameter("@keyFolderID", folder.folderID.ToStringHyphenated()); + command.Parameters.Add(param1); + command.Parameters.Add(param2); + command.Parameters.Add(param3); + + try + { + command.ExecuteNonQuery(); + } + catch (Exception e) + { + MainLog.Instance.Error(e.ToString()); + } + + + } /// /// Append a list of all the child folders of a parent folder diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs index edf7c43422..6828f66867 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs @@ -529,6 +529,28 @@ namespace OpenSim.Framework.Data.MySQL addInventoryFolder(folder); } + /// Creates a new inventory folder + /// + /// Folder to create + public void moveInventoryFolder(InventoryFolderBase folder) + { + string sql = + "UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID"; + + MySqlCommand cmd = new MySqlCommand(sql, database.Connection); + cmd.Parameters.AddWithValue("?folderID", folder.folderID.ToStringHyphenated()); + cmd.Parameters.AddWithValue("?parentFolderID", folder.parentID.ToStringHyphenated()); + + + try + { + cmd.ExecuteNonQuery(); + } + catch (Exception e) + { + MainLog.Instance.Error(e.ToString()); + } + } /// /// Append a list of all the child folders of a parent folder diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs index b9a1daada4..fe27e3247b 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs @@ -141,6 +141,24 @@ namespace OpenSim.Framework.Data.SQLite invFoldersDa.Update(ds, "inventoryfolders"); } + private void moveFolder(InventoryFolderBase folder) + { + DataTable inventoryFolderTable = ds.Tables["inventoryfolders"]; + + DataRow inventoryRow = inventoryFolderTable.Rows.Find(folder.folderID); + if (inventoryRow == null) + { + inventoryRow = inventoryFolderTable.NewRow(); + fillFolderRow(inventoryRow, folder); + inventoryFolderTable.Rows.Add(inventoryRow); + } + else + { + moveFolderRow(inventoryRow, folder); + } + + invFoldersDa.Update(ds, "inventoryfolders"); + } private void addItem(InventoryItemBase item) { DataTable inventoryItemTable = ds.Tables["inventoryitems"]; @@ -403,6 +421,15 @@ namespace OpenSim.Framework.Data.SQLite addFolder(folder); } + /// + /// Moves a folder based on its ID with folder + /// + /// The inventory folder + public void moveInventoryFolder(InventoryFolderBase folder) + { + moveFolder(folder); + } + /// /// Delete a folder /// @@ -534,6 +561,11 @@ namespace OpenSim.Framework.Data.SQLite row["version"] = folder.version; } + private void moveFolderRow(DataRow row, InventoryFolderBase folder) + { + row["UUID"] = folder.folderID; + row["parentID"] = folder.parentID; + } /*********************************************************************** * diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 8075d0d7d1..738df13938 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -330,6 +330,9 @@ namespace OpenSim.Framework public delegate void UpdateInventoryFolder( IClientAPI remoteClient, LLUUID folderID, ushort type, string name, LLUUID parentID); + public delegate void MoveInventoryFolder( + IClientAPI remoteClient, LLUUID folderID, LLUUID parentID); + public delegate void CreateNewInventoryItem( IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask); @@ -432,6 +435,7 @@ namespace OpenSim.Framework event CreateNewInventoryItem OnCreateNewInventoryItem; event CreateInventoryFolder OnCreateNewInventoryFolder; event UpdateInventoryFolder OnUpdateInventoryFolder; + event MoveInventoryFolder OnMoveInventoryFolder; event FetchInventoryDescendents OnFetchInventoryDescendents; event PurgeInventoryDescendents OnPurgeInventoryDescendents; event FetchInventory OnFetchInventory; @@ -522,7 +526,7 @@ namespace OpenSim.Framework void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity); - void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items, int subFoldersCount); + void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items, List folders, int subFoldersCount); void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item); /// diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index adcc2893f6..8cb3e731d8 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -238,6 +238,12 @@ namespace OpenSim.Framework /// The inventory folder void updateInventoryFolder(InventoryFolderBase folder); + /// + /// Updates a folder based on its ID with folder + /// + /// The inventory folder + void moveInventoryFolder(InventoryFolderBase folder); + /// /// Deletes a folder based on its ID with folder /// diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index 8756ecb7e9..6ae1d82330 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs @@ -45,22 +45,33 @@ namespace OpenSim.Grid.InventoryServer private bool TryGetUsersInventory(LLUUID userID, out List folderList, out List itemsList) { - List folders = RequestFirstLevelFolders(userID); + List rootFolders = RequestFirstLevelFolders(userID); List allItems = new List(); + List allFolders = new List(); - if (folders != null) + if (rootFolders != null) { - foreach (InventoryFolderBase folder in folders) + allFolders.InsertRange(0, rootFolders); + foreach (InventoryFolderBase subfolder in rootFolders) { - List items = RequestFolderItems(folder.folderID); - if (items != null) + List subFolders = GetAllFolders(subfolder.folderID); + if (subFolders != null) { - allItems.InsertRange(0, items); + allFolders.InsertRange(0, subFolders); } } } - - folderList = folders; + + foreach (InventoryFolderBase folder in allFolders) + { + List items = RequestFolderItems(folder.folderID); + if (items != null) + { + allItems.InsertRange(0, items); + } + } + + folderList = allFolders; itemsList = allItems; if (folderList != null) { @@ -72,6 +83,26 @@ namespace OpenSim.Grid.InventoryServer } } + private List GetAllFolders(LLUUID folder) + { + List allFolders = new List(); + List folders = RequestSubFolders(folder); + if (folders != null) + { + allFolders.InsertRange(0, folders); + foreach (InventoryFolderBase subfolder in folders) + { + List subFolders = GetAllFolders(subfolder.folderID); + if (subFolders != null) + { + allFolders.InsertRange(0, subFolders); + } + } + } + return allFolders; + } + + public InventoryCollection GetUserInventory(Guid rawUserID) { Console.WriteLine("Request for Inventory for " + rawUserID.ToString()); @@ -104,6 +135,11 @@ namespace OpenSim.Grid.InventoryServer AddFolder(folder); } + public override void MoveExistingInventoryFolder(InventoryFolderBase folder) + { + MoveFolder(folder); + } + public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) { AddItem(item); @@ -111,11 +147,16 @@ namespace OpenSim.Grid.InventoryServer public bool AddInventoryFolder( InventoryFolderBase folder) { - Console.WriteLine("creating new folder for " + folder.agentID.ToString()); AddNewInventoryFolder(folder.agentID, folder); return true; } + public bool MoveInventoryFolder(InventoryFolderBase folder) + { + MoveExistingInventoryFolder(folder); + return true; + } + public bool AddInventoryItem( InventoryItemBase item) { Console.WriteLine("creating new item for " + item.avatarID.ToString()); diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 58b63f4262..df854f93e5 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs @@ -87,6 +87,10 @@ namespace OpenSim.Grid.InventoryServer new RestDeserialisehandler("POST", "/NewFolder/", m_inventoryService.AddInventoryFolder)); + httpServer.AddStreamHandler( + new RestDeserialisehandler("POST", "/MoveFolder/", + m_inventoryService.MoveInventoryFolder)); + httpServer.AddStreamHandler( new RestDeserialisehandler("POST", "/NewItem/", m_inventoryService.AddInventoryItem)); diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 0514df54b7..1746db8595 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -502,6 +502,7 @@ namespace OpenSim.Region.ClientStack public event CreateNewInventoryItem OnCreateNewInventoryItem; public event CreateInventoryFolder OnCreateNewInventoryFolder; public event UpdateInventoryFolder OnUpdateInventoryFolder; + public event MoveInventoryFolder OnMoveInventoryFolder; public event FetchInventoryDescendents OnFetchInventoryDescendents; public event PurgeInventoryDescendents OnPurgeInventoryDescendents; public event FetchInventory OnFetchInventory; @@ -892,7 +893,7 @@ namespace OpenSim.Region.ClientStack /// The number of subfolders contained in the given folder. This is necessary since /// the client is expecting inventory packets which incorporate this number into the descendents field, even though /// we send back no details of the folders themselves (only the items). - public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items, int subFoldersCount) + public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items, List folders, int subFoldersCount) { Encoding enc = Encoding.ASCII; uint FULL_MASK_PERMISSIONS = 2147483647; @@ -931,14 +932,14 @@ namespace OpenSim.Region.ClientStack descend.ItemData[i].FolderID = item.parentFolderID; descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); descend.ItemData[i].GroupMask = 0; - descend.ItemData[i].InvType = (sbyte) item.invType; + descend.ItemData[i].InvType = (sbyte)item.invType; descend.ItemData[i].Name = Helpers.StringToField(item.inventoryName); descend.ItemData[i].NextOwnerMask = item.inventoryNextPermissions; descend.ItemData[i].OwnerID = item.avatarID; descend.ItemData[i].OwnerMask = item.inventoryCurrentPermissions; descend.ItemData[i].SalePrice = 0; descend.ItemData[i].SaleType = 0; - descend.ItemData[i].Type = (sbyte) item.assetType; + descend.ItemData[i].Type = (sbyte)item.assetType; descend.ItemData[i].CRC = Helpers.InventoryCRC(descend.ItemData[i].CreationDate, descend.ItemData[i].SaleType, @@ -976,6 +977,47 @@ namespace OpenSim.Region.ClientStack { OutPacket(descend, ThrottleOutPacketType.Asset); } + + //send subfolders + descend = CreateInventoryDescendentsPacket(ownerID, folderID); + descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count]; + i = 0; + count = 0; + foreach (InventoryFolderBase folder in folders) + { + descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock(); + descend.FolderData[i].FolderID = folder.folderID; + descend.FolderData[i].Name = Helpers.StringToField(folder.name); + descend.FolderData[i].ParentID = folder.parentID; + descend.FolderData[i].Type = (sbyte)folder.type; + i++; + count++; + if (i == 40) + { + OutPacket(descend, ThrottleOutPacketType.Asset); + + if ((folders.Count - count) > 0) + { + descend = CreateInventoryDescendentsPacket(ownerID, folderID); + if ((folders.Count - count) < 40) + { + descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[items.Count - count]; + descend.AgentData.Descendents = folders.Count - count; + } + else + { + descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[40]; + descend.AgentData.Descendents = 40; + } + i = 0; + } + } + } + + if (i < 40) + { + OutPacket(descend, ThrottleOutPacketType.Asset); + } } private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID) @@ -2821,6 +2863,17 @@ namespace OpenSim.Region.ClientStack } } break; + case PacketType.MoveInventoryFolder: + if (OnMoveInventoryFolder != null) + { + MoveInventoryFolderPacket invFolder = (MoveInventoryFolderPacket)Pack; + for (int i = 0; i < invFolder.InventoryData.Length; i++) + { + OnMoveInventoryFolder(this, invFolder.InventoryData[i].FolderID, + invFolder.InventoryData[i].ParentID); + } + } + break; case PacketType.CreateInventoryItem: CreateInventoryItemPacket createItem = (CreateInventoryItemPacket) Pack; if (OnCreateNewInventoryItem != null) @@ -3267,6 +3320,10 @@ namespace OpenSim.Region.ClientStack // TODO: handle this packet MainLog.Instance.Warn("CLIENT", "unhandled RequestRegionInfo packet"); break; + case PacketType.InventoryDescendents: + // TODO: handle this packet + MainLog.Instance.Warn("CLIENT", "unhandled InventoryDescent packet"); + break; default: MainLog.Instance.Warn("CLIENT", "unhandled packet " + Pack.ToString()); break; diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index e82d267126..08bd8500aa 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -68,6 +68,11 @@ namespace OpenSim.Region.Communications.Local AddFolder(folder); } + public override void MoveExistingInventoryFolder(InventoryFolderBase folder) + { + MoveFolder(folder); + } + public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) { AddItem(item); diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index d45e150497..4f5d9ab0ae 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -126,6 +126,16 @@ namespace OpenSim.Region.Communications.OGS1 } } + public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) + { + try + { + RestObjectPoster.BeginPostObject(_inventoryServerUrl + "/MoveFolder/", folder); + } + catch (Exception) + { + } + } public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) { try diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 59548a2497..aad977a532 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1102,6 +1102,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnCreateNewInventoryItem += CreateNewInventoryItem; client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder; client.OnUpdateInventoryFolder += CommsManager.UserProfileCacheService.HandleUpdateInventoryFolder; + client.OnMoveInventoryFolder += CommsManager.UserProfileCacheService.HandleMoveInventoryFolder; client.OnFetchInventoryDescendents += CommsManager.UserProfileCacheService.HandleFetchInventoryDescendents; client.OnPurgeInventoryDescendents += CommsManager.UserProfileCacheService.HandlePurgeInventoryDescendents; client.OnRequestTaskInventory += RequestTaskInventory; diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 98640743ae..9b2cddaced 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs @@ -108,6 +108,7 @@ namespace SimpleApp public event CreateNewInventoryItem OnCreateNewInventoryItem; public event CreateInventoryFolder OnCreateNewInventoryFolder; public event UpdateInventoryFolder OnUpdateInventoryFolder; + public event MoveInventoryFolder OnMoveInventoryFolder; public event FetchInventoryDescendents OnFetchInventoryDescendents; public event PurgeInventoryDescendents OnPurgeInventoryDescendents; public event FetchInventory OnFetchInventory; @@ -317,7 +318,7 @@ namespace SimpleApp { } - public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items, int subFoldersCount) + public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items, List folders, int subFoldersCount) { }