aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs77
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs19
2 files changed, 60 insertions, 36 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index c9df488..a0e6fb9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2463,42 +2463,47 @@ namespace OpenSim.Region.Framework.Scenes
2463 2463
2464 if (fromTaskID == UUID.Zero) 2464 if (fromTaskID == UUID.Zero)
2465 { 2465 {
2466 // rez from user inventory
2466 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); 2467 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
2467 if (invAccess != null) 2468 if (invAccess != null)
2468 invAccess.RezObject( 2469 invAccess.RezObject(
2469 remoteClient, itemID, rezGroupID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, 2470 remoteClient, itemID, rezGroupID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
2470 RezSelected, RemoveItem, fromTaskID, false); 2471 RezSelected, RemoveItem, fromTaskID, false);
2472 return;
2471 } 2473 }
2472 else 2474 // rez from a prim inventory
2475 SceneObjectPart part = GetSceneObjectPart(fromTaskID);
2476 if (part == null)
2473 { 2477 {
2474 SceneObjectPart part = GetSceneObjectPart(fromTaskID); 2478 m_log.ErrorFormat(
2475 if (part == null) 2479 "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object",
2476 { 2480 remoteClient.Name, itemID, fromTaskID);
2477 m_log.ErrorFormat( 2481 return;
2478 "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object", 2482 }
2479 remoteClient.Name, itemID, fromTaskID);
2480
2481 return;
2482 }
2483
2484 TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
2485 if (item == null)
2486 {
2487 m_log.ErrorFormat(
2488 "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item",
2489 remoteClient.Name, itemID, fromTaskID);
2490
2491 return;
2492 }
2493 2483
2494 byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); 2484 TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
2495 Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f); 2485 if (item == null)
2496 Vector3 pos = GetNewRezLocation( 2486 {
2497 RayStart, RayEnd, RayTargetID, Quaternion.Identity, 2487 m_log.ErrorFormat(
2498 BypassRayCast, bRayEndIsIntersection, true, scale, false); 2488 "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item",
2489 remoteClient.Name, itemID, fromTaskID);
2490 return;
2491 }
2499 2492
2500 RezObject(part, item, pos, null, Vector3.Zero, 0, false); 2493 if(item.InvType != (int)InventoryType.Object)
2494 {
2495 m_log.ErrorFormat(
2496 "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but item is not a object",
2497 remoteClient.Name, itemID, fromTaskID);
2498 return;
2501 } 2499 }
2500
2501 byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
2502 Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f);
2503 Vector3 pos = GetNewRezLocation(
2504 RayStart, RayEnd, RayTargetID, Quaternion.Identity,
2505 BypassRayCast, bRayEndIsIntersection, true, scale, false);
2506 RezObject(part, item, remoteClient.AgentId, rezGroupID, pos, null, Vector3.Zero, 0, false, true);
2502 } 2507 }
2503 2508
2504 /// <summary> 2509 /// <summary>
@@ -2515,6 +2520,14 @@ namespace OpenSim.Region.Framework.Scenes
2515 public virtual List<SceneObjectGroup> RezObject( 2520 public virtual List<SceneObjectGroup> RezObject(
2516 SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param, bool atRoot) 2521 SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param, bool atRoot)
2517 { 2522 {
2523 return RezObject(sourcePart, item, item.OwnerID, sourcePart.GroupID,
2524 pos, rot, vel, param, atRoot, false);
2525 }
2526
2527 public virtual List<SceneObjectGroup> RezObject(SceneObjectPart sourcePart, TaskInventoryItem item,
2528 UUID newowner, UUID newgroup,
2529 Vector3 pos, Quaternion? rot, Vector3 vel, int param, bool atRoot, bool humanRez)
2530 {
2518 if (null == item) 2531 if (null == item)
2519 return null; 2532 return null;
2520 2533
@@ -2523,7 +2536,7 @@ namespace OpenSim.Region.Framework.Scenes
2523 Vector3 bbox; 2536 Vector3 bbox;
2524 float offsetHeight; 2537 float offsetHeight;
2525 2538
2526 bool success = sourcePart.Inventory.GetRezReadySceneObjects(item, out objlist, out veclist,out bbox, out offsetHeight); 2539 bool success = sourcePart.Inventory.GetRezReadySceneObjects(item, newowner, newgroup, out objlist, out veclist, out bbox, out offsetHeight);
2527 2540
2528 if (!success) 2541 if (!success)
2529 return null; 2542 return null;
@@ -2532,7 +2545,7 @@ namespace OpenSim.Region.Framework.Scenes
2532 foreach (SceneObjectGroup group in objlist) 2545 foreach (SceneObjectGroup group in objlist)
2533 totalPrims += group.PrimCount; 2546 totalPrims += group.PrimCount;
2534 2547
2535 if (!Permissions.CanRezObject(totalPrims, item.OwnerID, pos)) 2548 if (!Permissions.CanRezObject(totalPrims, newowner, pos))
2536 return null; 2549 return null;
2537 2550
2538 if (!Permissions.BypassPermissions()) 2551 if (!Permissions.BypassPermissions())
@@ -2596,6 +2609,12 @@ namespace OpenSim.Region.Framework.Scenes
2596 } 2609 }
2597 } 2610 }
2598 2611
2612 UUID rezzerID;
2613 if(humanRez)
2614 rezzerID = newowner;
2615 else
2616 rezzerID = sourcePart.UUID;
2617
2599 for (int i = 0; i < objlist.Count; i++) 2618 for (int i = 0; i < objlist.Count; i++)
2600 { 2619 {
2601 SceneObjectGroup group = objlist[i]; 2620 SceneObjectGroup group = objlist[i];
@@ -2611,7 +2630,7 @@ namespace OpenSim.Region.Framework.Scenes
2611 group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint; 2630 group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
2612 } 2631 }
2613 2632
2614 group.RezzerID = sourcePart.UUID; 2633 group.RezzerID = rezzerID;
2615 2634
2616 if( i == 0) 2635 if( i == 0)
2617 AddNewSceneObject(group, true, curpos, rot, vel); 2636 AddNewSceneObject(group, true, curpos, rot, vel);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 8c880fc..dca22ea 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -895,6 +895,11 @@ namespace OpenSim.Region.Framework.Scenes
895 895
896 public bool GetRezReadySceneObjects(TaskInventoryItem item, out List<SceneObjectGroup> objlist, out List<Vector3> veclist, out Vector3 bbox, out float offsetHeight) 896 public bool GetRezReadySceneObjects(TaskInventoryItem item, out List<SceneObjectGroup> objlist, out List<Vector3> veclist, out Vector3 bbox, out float offsetHeight)
897 { 897 {
898 return GetRezReadySceneObjects(item, item.OwnerID, m_part.GroupID, out objlist, out veclist, out bbox, out offsetHeight);
899 }
900
901 public bool GetRezReadySceneObjects(TaskInventoryItem item, UUID NewOwner, UUID NewGroup, out List<SceneObjectGroup> objlist, out List<Vector3> veclist, out Vector3 bbox, out float offsetHeight)
902 {
898 AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); 903 AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
899 904
900 if (null == rezAsset) 905 if (null == rezAsset)
@@ -909,7 +914,7 @@ namespace OpenSim.Region.Framework.Scenes
909 return false; 914 return false;
910 } 915 }
911 916
912 bool single = m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight); 917 m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight);
913 918
914 for (int i = 0; i < objlist.Count; i++) 919 for (int i = 0; i < objlist.Count; i++)
915 { 920 {
@@ -952,11 +957,11 @@ namespace OpenSim.Region.Framework.Scenes
952 } 957 }
953*/ 958*/
954// old code start 959// old code start
960 group.SetGroup(NewGroup, null);
955 SceneObjectPart[] partList = group.Parts; 961 SceneObjectPart[] partList = group.Parts;
956 962
957 group.SetGroup(m_part.GroupID, null); 963 bool slamThings = (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0;
958 964 if ((rootPart.OwnerID != NewOwner) || slamThings)
959 if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
960 { 965 {
961 if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) 966 if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions())
962 { 967 {
@@ -976,12 +981,12 @@ namespace OpenSim.Region.Framework.Scenes
976 981
977 foreach (SceneObjectPart part in partList) 982 foreach (SceneObjectPart part in partList)
978 { 983 {
979 if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) 984 if ((part.OwnerID != NewOwner))
980 { 985 {
981 if(part.GroupID != part.OwnerID) 986 if(part.GroupID != part.OwnerID)
982 part.LastOwnerID = part.OwnerID; 987 part.LastOwnerID = part.OwnerID;
983 part.OwnerID = item.OwnerID; 988 part.OwnerID = NewOwner;
984 part.Inventory.ChangeInventoryOwner(item.OwnerID); 989 part.Inventory.ChangeInventoryOwner(NewOwner);
985 } 990 }
986 991
987 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) 992 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)