diff options
author | Brian McBee | 2007-12-08 20:41:37 +0000 |
---|---|---|
committer | Brian McBee | 2007-12-08 20:41:37 +0000 |
commit | 383eccc543e402710bb48802c6951b94d185a6a8 (patch) | |
tree | 17b1730a5e6bc3783d54e3cf0166da2196f8a9a5 | |
parent | Allow moving, deleting, and restoring objects in inventory. (diff) | |
download | opensim-SC-383eccc543e402710bb48802c6951b94d185a6a8.zip opensim-SC-383eccc543e402710bb48802c6951b94d185a6a8.tar.gz opensim-SC-383eccc543e402710bb48802c6951b94d185a6a8.tar.bz2 opensim-SC-383eccc543e402710bb48802c6951b94d185a6a8.tar.xz |
hackish code to allow emptying of trash. This really should be done on the inventory server, and not from the region.
Also: it appeared to work the first try, so I have probably done something horribly wrong.
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 22 | ||||
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 1 |
5 files changed, 36 insertions, 2 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index fb4c3a6..342bb0d 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -136,7 +136,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
136 | /// <param name="fetchFolders"></param> | 136 | /// <param name="fetchFolders"></param> |
137 | /// <param name="fetchItems"></param> | 137 | /// <param name="fetchItems"></param> |
138 | /// <param name="sortOrder"></param> | 138 | /// <param name="sortOrder"></param> |
139 | public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, | 139 | public void HandleFetchInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, |
140 | bool fetchFolders, bool fetchItems, int sortOrder) | 140 | bool fetchFolders, bool fetchItems, int sortOrder) |
141 | { | 141 | { |
142 | InventoryFolderImpl fold = null; | 142 | InventoryFolderImpl fold = null; |
@@ -181,6 +181,26 @@ namespace OpenSim.Framework.Communications.Cache | |||
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||
184 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID) | ||
185 | { | ||
186 | CachedUserInfo userProfile; | ||
187 | if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) | ||
188 | { | ||
189 | if (userProfile.RootFolder != null) | ||
190 | { | ||
191 | InventoryFolderImpl subFolder = userProfile.RootFolder.HasSubFolder(folderID); | ||
192 | if (subFolder != null) | ||
193 | { | ||
194 | List<InventoryItemBase> items=subFolder.RequestListOfItems(); | ||
195 | foreach(InventoryItemBase item in items) | ||
196 | { | ||
197 | userProfile.DeleteItem(remoteClient.AgentId, item); | ||
198 | } | ||
199 | } | ||
200 | } | ||
201 | } | ||
202 | } | ||
203 | |||
184 | public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) | 204 | public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) |
185 | { | 205 | { |
186 | if (ownerID == libraryRoot.agentID) | 206 | if (ownerID == libraryRoot.agentID) |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 38309fd..773b5eb 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -306,6 +306,9 @@ namespace OpenSim.Framework | |||
306 | public delegate void FetchInventoryDescendents( | 306 | public delegate void FetchInventoryDescendents( |
307 | IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); | 307 | IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); |
308 | 308 | ||
309 | public delegate void PurgeInventoryDescendents( | ||
310 | IClientAPI remoteClient, LLUUID folderID); | ||
311 | |||
309 | public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID); | 312 | public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID); |
310 | 313 | ||
311 | public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID); | 314 | public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID); |
@@ -398,6 +401,7 @@ namespace OpenSim.Framework | |||
398 | event CreateNewInventoryItem OnCreateNewInventoryItem; | 401 | event CreateNewInventoryItem OnCreateNewInventoryItem; |
399 | event CreateInventoryFolder OnCreateNewInventoryFolder; | 402 | event CreateInventoryFolder OnCreateNewInventoryFolder; |
400 | event FetchInventoryDescendents OnFetchInventoryDescendents; | 403 | event FetchInventoryDescendents OnFetchInventoryDescendents; |
404 | event PurgeInventoryDescendents OnPurgeInventoryDescendents; | ||
401 | event FetchInventory OnFetchInventory; | 405 | event FetchInventory OnFetchInventory; |
402 | event RequestTaskInventory OnRequestTaskInventory; | 406 | event RequestTaskInventory OnRequestTaskInventory; |
403 | event UpdateInventoryItem OnUpdateInventoryItem; | 407 | event UpdateInventoryItem OnUpdateInventoryItem; |
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index e40c689..7b6ea97 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -430,6 +430,7 @@ namespace OpenSim.Region.ClientStack | |||
430 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 430 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
431 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 431 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
432 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 432 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
433 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; | ||
433 | public event FetchInventory OnFetchInventory; | 434 | public event FetchInventory OnFetchInventory; |
434 | public event RequestTaskInventory OnRequestTaskInventory; | 435 | public event RequestTaskInventory OnRequestTaskInventory; |
435 | public event UpdateInventoryItem OnUpdateInventoryItem; | 436 | public event UpdateInventoryItem OnUpdateInventoryItem; |
@@ -2827,6 +2828,13 @@ namespace OpenSim.Region.ClientStack | |||
2827 | Fetch.InventoryData.SortOrder); | 2828 | Fetch.InventoryData.SortOrder); |
2828 | } | 2829 | } |
2829 | break; | 2830 | break; |
2831 | case PacketType.PurgeInventoryDescendents: | ||
2832 | if (OnPurgeInventoryDescendents != null) | ||
2833 | { | ||
2834 | PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket)Pack; | ||
2835 | OnPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); | ||
2836 | } | ||
2837 | break; | ||
2830 | case PacketType.UpdateInventoryItem: | 2838 | case PacketType.UpdateInventoryItem: |
2831 | UpdateInventoryItemPacket update = (UpdateInventoryItemPacket) Pack; | 2839 | UpdateInventoryItemPacket update = (UpdateInventoryItemPacket) Pack; |
2832 | if (OnUpdateInventoryItem != null) | 2840 | if (OnUpdateInventoryItem != null) |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index eb8a6a2..6bdb8a3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -971,7 +971,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
971 | 971 | ||
972 | client.OnCreateNewInventoryItem += CreateNewInventoryItem; | 972 | client.OnCreateNewInventoryItem += CreateNewInventoryItem; |
973 | client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder; | 973 | client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder; |
974 | client.OnFetchInventoryDescendents += CommsManager.UserProfileCacheService.HandleFecthInventoryDescendents; | 974 | client.OnFetchInventoryDescendents += CommsManager.UserProfileCacheService.HandleFetchInventoryDescendents; |
975 | client.OnPurgeInventoryDescendents += CommsManager.UserProfileCacheService.HandlePurgeInventoryDescendents; | ||
975 | client.OnRequestTaskInventory += RequestTaskInventory; | 976 | client.OnRequestTaskInventory += RequestTaskInventory; |
976 | client.OnFetchInventory += CommsManager.UserProfileCacheService.HandleFetchInventory; | 977 | client.OnFetchInventory += CommsManager.UserProfileCacheService.HandleFetchInventory; |
977 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; | 978 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 31ce53e..87e66ab 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -107,6 +107,7 @@ namespace SimpleApp | |||
107 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 107 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
108 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 108 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
109 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 109 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
110 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; | ||
110 | public event FetchInventory OnFetchInventory; | 111 | public event FetchInventory OnFetchInventory; |
111 | public event RequestTaskInventory OnRequestTaskInventory; | 112 | public event RequestTaskInventory OnRequestTaskInventory; |
112 | public event UpdateInventoryItem OnUpdateInventoryItem; | 113 | public event UpdateInventoryItem OnUpdateInventoryItem; |