diff options
author | Brian McBee | 2007-12-08 19:13:10 +0000 |
---|---|---|
committer | Brian McBee | 2007-12-08 19:13:10 +0000 |
commit | beca2373e15c0541e83f01abedfe7d6bfa469c8b (patch) | |
tree | fbee508dbcd24ef171cdc307fcf22318cf4150d3 | |
parent | * Added back the regionup code so people in nearby sims can see a downed sim ... (diff) | |
download | opensim-SC_OLD-beca2373e15c0541e83f01abedfe7d6bfa469c8b.zip opensim-SC_OLD-beca2373e15c0541e83f01abedfe7d6bfa469c8b.tar.gz opensim-SC_OLD-beca2373e15c0541e83f01abedfe7d6bfa469c8b.tar.bz2 opensim-SC_OLD-beca2373e15c0541e83f01abedfe7d6bfa469c8b.tar.xz |
Allow moving, deleting, and restoring objects in inventory.
Note: only tested in grid mode, and emptying trash is still not implemented.
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 40 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 1 |
5 files changed, 57 insertions, 0 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 2cb166c..38309fd 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -317,6 +317,9 @@ namespace OpenSim.Framework | |||
317 | public delegate void CopyInventoryItem( | 317 | public delegate void CopyInventoryItem( |
318 | IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, LLUUID newFolderID, string newName); | 318 | IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, LLUUID newFolderID, string newName); |
319 | 319 | ||
320 | public delegate void MoveInventoryItem( | ||
321 | IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, string newName); | ||
322 | |||
320 | public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID); | 323 | public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID); |
321 | 324 | ||
322 | public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); | 325 | public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); |
@@ -399,6 +402,7 @@ namespace OpenSim.Framework | |||
399 | event RequestTaskInventory OnRequestTaskInventory; | 402 | event RequestTaskInventory OnRequestTaskInventory; |
400 | event UpdateInventoryItem OnUpdateInventoryItem; | 403 | event UpdateInventoryItem OnUpdateInventoryItem; |
401 | event CopyInventoryItem OnCopyInventoryItem; | 404 | event CopyInventoryItem OnCopyInventoryItem; |
405 | event MoveInventoryItem OnMoveInventoryItem; | ||
402 | event UDPAssetUploadRequest OnAssetUploadRequest; | 406 | event UDPAssetUploadRequest OnAssetUploadRequest; |
403 | event XferReceive OnXferReceive; | 407 | event XferReceive OnXferReceive; |
404 | event RequestXfer OnRequestXfer; | 408 | event RequestXfer OnRequestXfer; |
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index dc229f3..e40c689 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -434,6 +434,7 @@ namespace OpenSim.Region.ClientStack | |||
434 | public event RequestTaskInventory OnRequestTaskInventory; | 434 | public event RequestTaskInventory OnRequestTaskInventory; |
435 | public event UpdateInventoryItem OnUpdateInventoryItem; | 435 | public event UpdateInventoryItem OnUpdateInventoryItem; |
436 | public event CopyInventoryItem OnCopyInventoryItem; | 436 | public event CopyInventoryItem OnCopyInventoryItem; |
437 | public event MoveInventoryItem OnMoveInventoryItem; | ||
437 | public event UDPAssetUploadRequest OnAssetUploadRequest; | 438 | public event UDPAssetUploadRequest OnAssetUploadRequest; |
438 | public event XferReceive OnXferReceive; | 439 | public event XferReceive OnXferReceive; |
439 | public event RequestXfer OnRequestXfer; | 440 | public event RequestXfer OnRequestXfer; |
@@ -2880,6 +2881,16 @@ namespace OpenSim.Region.ClientStack | |||
2880 | } | 2881 | } |
2881 | } | 2882 | } |
2882 | break; | 2883 | break; |
2884 | case PacketType.MoveInventoryItem: | ||
2885 | MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket)Pack; | ||
2886 | if (OnMoveInventoryItem != null) | ||
2887 | { | ||
2888 | foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) | ||
2889 | { | ||
2890 | OnMoveInventoryItem(this, datablock.FolderID, datablock.ItemID, datablock.Length, Util.FieldToString(datablock.NewName)); | ||
2891 | } | ||
2892 | } | ||
2893 | break; | ||
2883 | case PacketType.RequestTaskInventory: | 2894 | case PacketType.RequestTaskInventory: |
2884 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket) Pack; | 2895 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket) Pack; |
2885 | if (OnRequestTaskInventory != null) | 2896 | if (OnRequestTaskInventory != null) |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index ac504e1..e373eda 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -236,6 +236,46 @@ namespace OpenSim.Region.Environment.Scenes | |||
236 | return asset; | 236 | return asset; |
237 | } | 237 | } |
238 | 238 | ||
239 | public void MoveInventoryItem(IClientAPI remoteClient,LLUUID folderID, LLUUID itemID, int length, string newName) | ||
240 | { | ||
241 | MainLog.Instance.Verbose("INVENTORY", "Moving item for " + remoteClient.AgentId.ToStringHyphenated()); | ||
242 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
243 | if (userInfo == null) | ||
244 | { | ||
245 | MainLog.Instance.Warn("INVENTORY", "Failed to find user " + remoteClient.AgentId.ToString()); | ||
246 | return; | ||
247 | } | ||
248 | |||
249 | if (userInfo.RootFolder != null) | ||
250 | { | ||
251 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | ||
252 | if (item != null) | ||
253 | { | ||
254 | if (newName != "") | ||
255 | { | ||
256 | item.inventoryName = newName; | ||
257 | } | ||
258 | item.parentFolderID = folderID; | ||
259 | userInfo.DeleteItem(remoteClient.AgentId, item); | ||
260 | |||
261 | // TODO: preserve current permissions? | ||
262 | AddInventoryItem(remoteClient, item); | ||
263 | } | ||
264 | else | ||
265 | { | ||
266 | MainLog.Instance.Warn("INVENTORY", "Failed to find item " + itemID.ToString()); | ||
267 | return; | ||
268 | } | ||
269 | } | ||
270 | else | ||
271 | { | ||
272 | MainLog.Instance.Warn("INVENTORY", "Failed to find item " + itemID.ToString() + ", no root folder"); | ||
273 | return; | ||
274 | } | ||
275 | |||
276 | |||
277 | } | ||
278 | |||
239 | private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, | 279 | private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, |
240 | AssetBase asset, uint nextOwnerMask) | 280 | AssetBase asset, uint nextOwnerMask) |
241 | { | 281 | { |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index b733522..eb8a6a2 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -976,6 +976,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
976 | client.OnFetchInventory += CommsManager.UserProfileCacheService.HandleFetchInventory; | 976 | client.OnFetchInventory += CommsManager.UserProfileCacheService.HandleFetchInventory; |
977 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; | 977 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; |
978 | client.OnCopyInventoryItem += CopyInventoryItem; | 978 | client.OnCopyInventoryItem += CopyInventoryItem; |
979 | client.OnMoveInventoryItem += MoveInventoryItem; | ||
979 | client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; | 980 | client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; |
980 | client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; | 981 | client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; |
981 | client.OnRezScript += RezScript; | 982 | client.OnRezScript += RezScript; |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index a9bba3f..31ce53e 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -111,6 +111,7 @@ namespace SimpleApp | |||
111 | public event RequestTaskInventory OnRequestTaskInventory; | 111 | public event RequestTaskInventory OnRequestTaskInventory; |
112 | public event UpdateInventoryItem OnUpdateInventoryItem; | 112 | public event UpdateInventoryItem OnUpdateInventoryItem; |
113 | public event CopyInventoryItem OnCopyInventoryItem; | 113 | public event CopyInventoryItem OnCopyInventoryItem; |
114 | public event MoveInventoryItem OnMoveInventoryItem; | ||
114 | public event UDPAssetUploadRequest OnAssetUploadRequest; | 115 | public event UDPAssetUploadRequest OnAssetUploadRequest; |
115 | public event XferReceive OnXferReceive; | 116 | public event XferReceive OnXferReceive; |
116 | public event RequestXfer OnRequestXfer; | 117 | public event RequestXfer OnRequestXfer; |