aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs11
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs40
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs1
4 files changed, 53 insertions, 0 deletions
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;