aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs2
-rw-r--r--OpenSim/Framework/IClientAPI.cs3
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs24
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs81
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs22
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs11
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs1
10 files changed, 140 insertions, 14 deletions
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index 7812499..33d820d 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Communications.Cache
92 } 92 }
93 93
94 /// <summary> 94 /// <summary>
95 /// Does this folder contain the given item? 95 /// Does this folder or any of its subfolders contain the given item?
96 /// </summary> 96 /// </summary>
97 /// <param name="itemID"></param> 97 /// <param name="itemID"></param>
98 /// <returns></returns> 98 /// <returns></returns>
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 388dfd7..dd0858a 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -408,6 +408,8 @@ namespace OpenSim.Framework
408 408
409 public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); 409 public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
410 410
411 public delegate void MoveTaskInventory(IClientAPI remoteClient, LLUUID folderID, uint localID, LLUUID itemID);
412
411 public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID); 413 public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID);
412 414
413 public delegate void UDPAssetUploadRequest( 415 public delegate void UDPAssetUploadRequest(
@@ -530,6 +532,7 @@ namespace OpenSim.Framework
530 event ConfirmXfer OnConfirmXfer; 532 event ConfirmXfer OnConfirmXfer;
531 event RezScript OnRezScript; 533 event RezScript OnRezScript;
532 event UpdateTaskInventory OnUpdateTaskInventory; 534 event UpdateTaskInventory OnUpdateTaskInventory;
535 event MoveTaskInventory OnMoveTaskItem;
533 event RemoveTaskInventory OnRemoveTaskItem; 536 event RemoveTaskInventory OnRemoveTaskItem;
534 event RequestAsset OnRequestAsset; 537 event RequestAsset OnRequestAsset;
535 538
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index db0b2cd..35b248a 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -196,6 +196,7 @@ namespace OpenSim.Region.ClientStack
196 private RemoveInventoryFolder handlerRemoveInventoryFolder = null; 196 private RemoveInventoryFolder handlerRemoveInventoryFolder = null;
197 private RequestTaskInventory handlerRequestTaskInventory = null; //OnRequestTaskInventory; 197 private RequestTaskInventory handlerRequestTaskInventory = null; //OnRequestTaskInventory;
198 private UpdateTaskInventory handlerUpdateTaskInventory = null; //OnUpdateTaskInventory; 198 private UpdateTaskInventory handlerUpdateTaskInventory = null; //OnUpdateTaskInventory;
199 private MoveTaskInventory handlerMoveTaskItem = null;
199 private RemoveTaskInventory handlerRemoveTaskItem = null; //OnRemoveTaskItem; 200 private RemoveTaskInventory handlerRemoveTaskItem = null; //OnRemoveTaskItem;
200 private RezScript handlerRezScript = null; //OnRezScript; 201 private RezScript handlerRezScript = null; //OnRezScript;
201 private RequestMapBlocks handlerRequestMapBlocks = null; //OnRequestMapBlocks; 202 private RequestMapBlocks handlerRequestMapBlocks = null; //OnRequestMapBlocks;
@@ -762,6 +763,7 @@ namespace OpenSim.Region.ClientStack
762 public event ConfirmXfer OnConfirmXfer; 763 public event ConfirmXfer OnConfirmXfer;
763 public event RezScript OnRezScript; 764 public event RezScript OnRezScript;
764 public event UpdateTaskInventory OnUpdateTaskInventory; 765 public event UpdateTaskInventory OnUpdateTaskInventory;
766 public event MoveTaskInventory OnMoveTaskItem;
765 public event RemoveTaskInventory OnRemoveTaskItem; 767 public event RemoveTaskInventory OnRemoveTaskItem;
766 public event RequestAsset OnRequestAsset; 768 public event RequestAsset OnRequestAsset;
767 769
@@ -4250,8 +4252,11 @@ namespace OpenSim.Region.ClientStack
4250 } 4252 }
4251 } 4253 }
4252 } 4254 }
4255
4253 break; 4256 break;
4257
4254 case PacketType.RemoveTaskInventory: 4258 case PacketType.RemoveTaskInventory:
4259
4255 RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack; 4260 RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack;
4256 4261
4257 handlerRemoveTaskItem = OnRemoveTaskItem; 4262 handlerRemoveTaskItem = OnRemoveTaskItem;
@@ -4260,11 +4265,27 @@ namespace OpenSim.Region.ClientStack
4260 { 4265 {
4261 handlerRemoveTaskItem(this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID); 4266 handlerRemoveTaskItem(this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID);
4262 } 4267 }
4268
4263 break; 4269 break;
4270
4264 case PacketType.MoveTaskInventory: 4271 case PacketType.MoveTaskInventory:
4265 m_log.Warn("[CLIENT]: unhandled MoveTaskInventory packet"); 4272
4273 MoveTaskInventoryPacket moveTaskInventoryPacket = (MoveTaskInventoryPacket)Pack;
4274
4275 handlerMoveTaskItem = OnMoveTaskItem;
4276
4277 if (handlerMoveTaskItem != null)
4278 {
4279 handlerMoveTaskItem(
4280 this, moveTaskInventoryPacket.AgentData.FolderID,
4281 moveTaskInventoryPacket.InventoryData.LocalID,
4282 moveTaskInventoryPacket.InventoryData.ItemID);
4283 }
4284
4266 break; 4285 break;
4286
4267 case PacketType.RezScript: 4287 case PacketType.RezScript:
4288
4268 //Console.WriteLine(Pack.ToString()); 4289 //Console.WriteLine(Pack.ToString());
4269 RezScriptPacket rezScriptx = (RezScriptPacket)Pack; 4290 RezScriptPacket rezScriptx = (RezScriptPacket)Pack;
4270 4291
@@ -4275,6 +4296,7 @@ namespace OpenSim.Region.ClientStack
4275 handlerRezScript(this, rezScriptx.InventoryBlock.ItemID, rezScriptx.UpdateBlock.ObjectLocalID); 4296 handlerRezScript(this, rezScriptx.InventoryBlock.ItemID, rezScriptx.UpdateBlock.ObjectLocalID);
4276 } 4297 }
4277 break; 4298 break;
4299
4278 case PacketType.MapLayerRequest: 4300 case PacketType.MapLayerRequest:
4279 RequestMapLayer(); 4301 RequestMapLayer();
4280 break; 4302 break;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 40650f3..67d3dfb 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -83,6 +83,14 @@ namespace OpenSim.Region.Environment.Scenes
83 } 83 }
84 EventManager.TriggerOnNewInventoryItemUploadComplete(remoteClient.AgentId, item.AssetID, item.Name, userlevel); 84 EventManager.TriggerOnNewInventoryItemUploadComplete(remoteClient.AgentId, item.AssetID, item.Name, userlevel);
85 } 85 }
86 else
87 {
88 m_log.ErrorFormat(
89 "[AGENT INVENTORY]: Agent {0} {1} was not found for add of item {2} {3}",
90 remoteClient.Name, remoteClient.AgentId, item.Name, item.ID);
91
92 return;
93 }
86 } 94 }
87 95
88 /// <summary> 96 /// <summary>
@@ -696,6 +704,79 @@ namespace OpenSim.Region.Environment.Scenes
696 localID); 704 localID);
697 } 705 }
698 } 706 }
707
708 /// <summary>
709 /// Move the given item in the given prim to a folder in the client's inventory
710 /// </summary>
711 /// <param name="remoteClient"></param>
712 /// <param name="folderID"></param>
713 /// <param name="primLocalID"></param>
714 /// <param name="itemID"></param>
715 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
716 {
717 SceneObjectGroup group = GetGroupByPrim(primLocalId);
718
719 if (null == group)
720 {
721 m_log.WarnFormat(
722 "[PRIM INVENTORY]: " +
723 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found",
724 itemId, primLocalId);
725
726 return;
727 }
728
729 TaskInventoryItem taskItem = group.GetInventoryItem(primLocalId, itemId);
730
731 if (null == taskItem)
732 {
733 // Console already notified of error in GetInventoryItem
734 return;
735 }
736
737// bool permission;
738// permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId,
739// ((SceneObjectGroup) selectedEnt).UUID);
740
741 // Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner
742 // to copy
743 if (remoteClient.AgentId != taskItem.OwnerID)
744 {
745 m_log.InfoFormat(
746 "[PRIM INVENTORY]: Attempt made by {0} {1} to copy inventory item {2} {3} in prim {4} {5},"
747 + " but temporarily not allowed pending upstream bugfixes/feature implementation",
748 remoteClient.Name, remoteClient.AgentId, taskItem.Name, taskItem.ItemID, group.Name, group.UUID);
749
750 return;
751 }
752
753 InventoryItemBase agentItem = new InventoryItemBase();
754
755 agentItem.ID = LLUUID.Random();
756 agentItem.Creator = taskItem.CreatorID;
757 agentItem.Owner = remoteClient.AgentId;
758 agentItem.AssetID = taskItem.AssetID;
759 agentItem.Description = taskItem.Description;
760 agentItem.Name = taskItem.Name;
761 agentItem.AssetType = taskItem.Type;
762 agentItem.InvType = taskItem.InvType;
763 agentItem.Folder = folderId;
764 agentItem.EveryOnePermissions = taskItem.EveryoneMask;
765
766 if (remoteClient.AgentId != taskItem.OwnerID) {
767 agentItem.BasePermissions = taskItem.NextOwnerMask;
768 agentItem.CurrentPermissions = taskItem.NextOwnerMask;
769 agentItem.NextPermissions = taskItem.NextOwnerMask;
770 }
771 else
772 {
773 agentItem.BasePermissions = taskItem.BaseMask;
774 agentItem.CurrentPermissions = taskItem.OwnerMask;
775 agentItem.NextPermissions = taskItem.NextOwnerMask;
776 }
777
778 AddInventoryItem(remoteClient, agentItem);
779 }
699 780
700 /// <summary> 781 /// <summary>
701 /// Update an item in a prim (task) inventory. 782 /// Update an item in a prim (task) inventory.
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 9ca845f..b16b4aa 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1608,6 +1608,7 @@ namespace OpenSim.Region.Environment.Scenes
1608 client.OnRequestTaskInventory += RequestTaskInventory; 1608 client.OnRequestTaskInventory += RequestTaskInventory;
1609 client.OnRemoveTaskItem += RemoveTaskInventory; 1609 client.OnRemoveTaskItem += RemoveTaskInventory;
1610 client.OnUpdateTaskInventory += UpdateTaskInventory; 1610 client.OnUpdateTaskInventory += UpdateTaskInventory;
1611 client.OnMoveTaskItem += MoveTaskInventoryItem;
1611 1612
1612 client.OnGrabObject += ProcessObjectGrab; 1613 client.OnGrabObject += ProcessObjectGrab;
1613 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; 1614 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index efb40dd..2d0c636 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -198,6 +198,13 @@ namespace OpenSim.Region.Environment.Scenes
198 taskItem.CreatorID = item.Creator; 198 taskItem.CreatorID = item.Creator;
199 taskItem.Type = item.AssetType; 199 taskItem.Type = item.AssetType;
200 taskItem.InvType = item.InvType; 200 taskItem.InvType = item.InvType;
201
202 taskItem.BaseMask = item.BasePermissions;
203 taskItem.OwnerMask = item.CurrentPermissions;
204 // FIXME: ignoring group permissions for now as they aren't stored in item
205 taskItem.EveryoneMask = item.EveryOnePermissions;
206 taskItem.NextOwnerMask = item.NextPermissions;
207
201 part.AddInventoryItem(taskItem); 208 part.AddInventoryItem(taskItem);
202 209
203 return true; 210 return true;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 7020eb8..7596e24 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1904,7 +1904,7 @@ namespace OpenSim.Region.Environment.Scenes
1904 } 1904 }
1905 1905
1906 /// <summary> 1906 /// <summary>
1907 /// 1907 /// Return metadata about a prim (name, description, sale price, etc.)
1908 /// </summary> 1908 /// </summary>
1909 /// <param name="client"></param> 1909 /// <param name="client"></param>
1910 public void GetProperties(IClientAPI client) 1910 public void GetProperties(IClientAPI client)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 63cfcbd..89c93fd 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -482,8 +482,9 @@ namespace OpenSim.Region.Environment.Scenes
482 public void RequestInventoryFile(IXfer xferManager) 482 public void RequestInventoryFile(IXfer xferManager)
483 { 483 {
484 byte[] fileData = new byte[0]; 484 byte[] fileData = new byte[0];
485 InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, UUID); 485 //InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, UUID);
486 //InventoryStringBuilder invString = new InventoryStringBuilder(UUID, LLUUID.Zero); 486// InventoryStringBuilder invString = new InventoryStringBuilder(UUID, LLUUID.Zero);
487 InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, LLUUID.Zero);
487 488
488 lock (m_taskInventory) 489 lock (m_taskInventory)
489 { 490 {
@@ -492,20 +493,28 @@ namespace OpenSim.Region.Environment.Scenes
492 invString.AddItemStart(); 493 invString.AddItemStart();
493 invString.AddNameValueLine("item_id", item.ItemID.ToString()); 494 invString.AddNameValueLine("item_id", item.ItemID.ToString());
494 495
495 invString.AddNameValueLine("parent_id", item.ParentID.ToString()); 496 //invString.AddNameValueLine("parent_id", item.ParentID.ToString());
496// invString.AddNameValueLine("parent_id", UUID.ToString()); 497 invString.AddNameValueLine("parent_id", m_folderID.ToString());
497 498
498 invString.AddPermissionsStart(); 499 invString.AddPermissionsStart();
500
501 // FIXME: Temporary until permissions are properly sorted.
499 invString.AddNameValueLine("base_mask", "7fffffff"); 502 invString.AddNameValueLine("base_mask", "7fffffff");
500 invString.AddNameValueLine("owner_mask", "7fffffff"); 503 invString.AddNameValueLine("owner_mask", "7fffffff");
501
502 invString.AddNameValueLine("group_mask", "7fffffff"); 504 invString.AddNameValueLine("group_mask", "7fffffff");
503 invString.AddNameValueLine("everyone_mask", "7fffffff"); 505 invString.AddNameValueLine("everyone_mask", "7fffffff");
504 invString.AddNameValueLine("next_owner_mask", "7fffffff"); 506 invString.AddNameValueLine("next_owner_mask", "7fffffff");
507
505// invString.AddNameValueLine("group_mask", "00000000"); 508// invString.AddNameValueLine("group_mask", "00000000");
506// invString.AddNameValueLine("everyone_mask", "00000000"); 509// invString.AddNameValueLine("everyone_mask", "00000000");
507// invString.AddNameValueLine("next_owner_mask", "00086000"); 510// invString.AddNameValueLine("next_owner_mask", "00086000");
508 511
512// invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask));
513// invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask));
514// invString.AddNameValueLine("group_mask", Helpers.UIntToHexString(item.GroupMask));
515// invString.AddNameValueLine("everyone_mask", Helpers.UIntToHexString(item.EveryoneMask));
516// invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask));
517
509 invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); 518 invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
510 invString.AddNameValueLine("owner_id", item.OwnerID.ToString()); 519 invString.AddNameValueLine("owner_id", item.OwnerID.ToString());
511 520
@@ -537,8 +546,7 @@ namespace OpenSim.Region.Environment.Scenes
537 546
538 fileData = Helpers.StringToField(invString.BuildString); 547 fileData = Helpers.StringToField(invString.BuildString);
539 548
540// m_log.DebugFormat( 549 //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Helpers.FieldToUTF8String(fileData));
541// "[PRIM INVENTORY]: RequestInventoryFile fileData: {0}", Helpers.FieldToUTF8String(fileData));
542 550
543 if (fileData.Length > 2) 551 if (fileData.Length > 2)
544 { 552 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index b7e72ef..50c96e1 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -747,12 +747,15 @@ namespace OpenSim.Region.Environment.Scenes
747 Acceleration = new LLVector3(0, 0, 0); 747 Acceleration = new LLVector3(0, 0, 0);
748 m_TextureAnimation = new byte[0]; 748 m_TextureAnimation = new byte[0];
749 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; 749 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp";
750 m_folderID = LLUUID.Random(); 750
751 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
752 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
753 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
754 m_folderID = UUID;
751 755
752 Flags = 0; 756 Flags = 0;
753 Flags |= LLObject.ObjectFlags.AllowInventoryDrop | 757 Flags |= LLObject.ObjectFlags.AllowInventoryDrop |
754 LLObject.ObjectFlags.CreateSelected; 758 LLObject.ObjectFlags.CreateSelected;
755
756 759
757 TrimPermissions(); 760 TrimPermissions();
758 761
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 2586ac5..a12404a 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -134,6 +134,7 @@ namespace OpenSim.Region.Examples.SimpleModule
134 public event ConfirmXfer OnConfirmXfer; 134 public event ConfirmXfer OnConfirmXfer;
135 public event RezScript OnRezScript; 135 public event RezScript OnRezScript;
136 public event UpdateTaskInventory OnUpdateTaskInventory; 136 public event UpdateTaskInventory OnUpdateTaskInventory;
137 public event MoveTaskInventory OnMoveTaskItem;
137 public event RemoveTaskInventory OnRemoveTaskItem; 138 public event RemoveTaskInventory OnRemoveTaskItem;
138 public event RequestAsset OnRequestAsset; 139 public event RequestAsset OnRequestAsset;
139 140