aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-14 11:56:57 +0000
committerTeravus Ovares2007-11-14 11:56:57 +0000
commit3cb2b5eb6686d4e183eed5152570b7e052381f8d (patch)
treee98100bce6ff171318c18d38f51ae9670c38135b /OpenSim
parent* moved outer tool dir into inner tool dir (diff)
downloadopensim-SC_OLD-3cb2b5eb6686d4e183eed5152570b7e052381f8d.zip
opensim-SC_OLD-3cb2b5eb6686d4e183eed5152570b7e052381f8d.tar.gz
opensim-SC_OLD-3cb2b5eb6686d4e183eed5152570b7e052381f8d.tar.bz2
opensim-SC_OLD-3cb2b5eb6686d4e183eed5152570b7e052381f8d.tar.xz
* Copied objects are now owned by the object copier (Next Owner) (however next owner permissions are not applied yet)
* In Serverside permissions mode; If you've copied an object, then you can delete it and clean up after yourself. The rest of the permissions functionality is still unchanged. Admin can delete any object.. etc.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs3
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs5
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs45
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs4
6 files changed, 49 insertions, 14 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index d577a20..451984c 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -217,7 +217,7 @@ namespace OpenSim.Framework
217 217
218 public delegate void UpdatePrimGroupRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); 218 public delegate void UpdatePrimGroupRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient);
219 219
220 public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags); 220 public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags, LLUUID AgentID, LLUUID GroupID);
221 221
222 public delegate void StatusChange(bool status); 222 public delegate void StatusChange(bool status);
223 223
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 1383ad9..da4f830 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -298,12 +298,13 @@ namespace OpenSim.Region.ClientStack
298 break; 298 break;
299 case PacketType.ObjectDuplicate: 299 case PacketType.ObjectDuplicate:
300 ObjectDuplicatePacket dupe = (ObjectDuplicatePacket) Pack; 300 ObjectDuplicatePacket dupe = (ObjectDuplicatePacket) Pack;
301 ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData;
301 for (int i = 0; i < dupe.ObjectData.Length; i++) 302 for (int i = 0; i < dupe.ObjectData.Length; i++)
302 { 303 {
303 if (OnObjectDuplicate != null) 304 if (OnObjectDuplicate != null)
304 { 305 {
305 OnObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset, 306 OnObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset,
306 dupe.SharedData.DuplicateFlags); 307 dupe.SharedData.DuplicateFlags, AgentandGroupData.AgentID, AgentandGroupData.GroupID);
307 } 308 }
308 } 309 }
309 310
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index fd55833..560ecf3 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -139,9 +139,12 @@ namespace OpenSim.Region.Environment
139 139
140 SceneObjectGroup task = (SceneObjectGroup) m_scene.Entities[objId]; 140 SceneObjectGroup task = (SceneObjectGroup) m_scene.Entities[objId];
141 LLUUID taskOwner = null; 141 LLUUID taskOwner = null;
142 // Added this because at this point in time it wouldn't be wise for
143 // the administrator object permissions to take effect.
144 LLUUID objectOwner = task.OwnerID;
142 145
143 // Object owners should be able to edit their own content 146 // Object owners should be able to edit their own content
144 if (user == taskOwner) 147 if (user == objectOwner)
145 permission = true; 148 permission = true;
146 149
147 // Users should be able to edit what is over their land. 150 // Users should be able to edit what is over their land.
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index c8e9b73..c436b89 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -593,7 +593,7 @@ namespace OpenSim.Region.Environment.Scenes
593 /// <param name="originalPrim"></param> 593 /// <param name="originalPrim"></param>
594 /// <param name="offset"></param> 594 /// <param name="offset"></param>
595 /// <param name="flags"></param> 595 /// <param name="flags"></param>
596 public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags) 596 public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID)
597 { 597 {
598 SceneObjectGroup originPrim = null; 598 SceneObjectGroup originPrim = null;
599 foreach (EntityBase ent in Entities.Values) 599 foreach (EntityBase ent in Entities.Values)
@@ -610,7 +610,7 @@ namespace OpenSim.Region.Environment.Scenes
610 610
611 if (originPrim != null) 611 if (originPrim != null)
612 { 612 {
613 SceneObjectGroup copy = originPrim.Copy(); 613 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
614 copy.AbsolutePosition = copy.AbsolutePosition + offset; 614 copy.AbsolutePosition = copy.AbsolutePosition + offset;
615 Entities.Add(copy.UUID, copy); 615 Entities.Add(copy.UUID, copy);
616 616
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index a9f0bb3..c9b6e9f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -73,7 +73,11 @@ namespace OpenSim.Region.Environment.Scenes
73 { 73 {
74 get { return m_rootPart.RotationOffset; } 74 get { return m_rootPart.RotationOffset; }
75 } 75 }
76 76 public LLUUID GroupID
77 {
78 get { return m_rootPart.GroupID; }
79 set { m_rootPart.GroupID = value; }
80 }
77 /// <summary> 81 /// <summary>
78 /// 82 ///
79 /// </summary> 83 /// </summary>
@@ -165,6 +169,7 @@ namespace OpenSim.Region.Environment.Scenes
165 public LLUUID OwnerID 169 public LLUUID OwnerID
166 { 170 {
167 get { return m_rootPart.OwnerID; } 171 get { return m_rootPart.OwnerID; }
172 set { m_rootPart.OwnerID = value; }
168 } 173 }
169 174
170 public Color Color 175 public Color Color
@@ -447,15 +452,18 @@ namespace OpenSim.Region.Environment.Scenes
447 /// 452 ///
448 /// </summary> 453 /// </summary>
449 /// <returns></returns> 454 /// <returns></returns>
450 public new SceneObjectGroup Copy() 455 public new SceneObjectGroup Copy(LLUUID cAgentID, LLUUID cGroupID)
451 { 456 {
452 SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone(); 457 SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone();
453 dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>(); 458 dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>();
454 dupe.m_parts.Clear(); 459 dupe.m_parts.Clear();
460 //dupe.OwnerID = AgentID;
461 //dupe.GroupID = GroupID;
455 dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); 462 dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
456 dupe.m_scene = m_scene; 463 dupe.m_scene = m_scene;
457 dupe.m_regionHandle = m_regionHandle; 464 dupe.m_regionHandle = m_regionHandle;
458 dupe.CopyRootPart(m_rootPart); 465 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID);
466
459 467
460 /// may need to create a new Physics actor. 468 /// may need to create a new Physics actor.
461 if (dupe.RootPart.PhysActor != null) 469 if (dupe.RootPart.PhysActor != null)
@@ -472,18 +480,29 @@ namespace OpenSim.Region.Environment.Scenes
472 dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z), 480 dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z),
473 dupe.RootPart.PhysActor.IsPhysical); 481 dupe.RootPart.PhysActor.IsPhysical);
474 } 482 }
483 // Now we've made a copy that replaces this one, we need to
484 // switch the owner to the person who did the copying
485 // Second Life copies an object and duplicates the first one in it's place
486 // So, we have to make a copy of this one, set it in it's place then set the owner on this one
487
488 SetRootPartOwner(m_rootPart, cAgentID, cGroupID);
489 m_rootPart.ScheduleFullUpdate();
475 490
476 List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values); 491 List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
477 foreach (SceneObjectPart part in partList) 492 foreach (SceneObjectPart part in partList)
478 { 493 {
479 if (part.UUID != m_rootPart.UUID) 494 if (part.UUID != m_rootPart.UUID)
480 { 495 {
481 dupe.CopyPart(part); 496 dupe.CopyPart(part,OwnerID, GroupID);
497 SetPartOwner(part, cAgentID, cGroupID);
498 part.ScheduleFullUpdate();
499
482 } 500 }
483 } 501 }
484 dupe.UpdateParentIDs(); 502 dupe.UpdateParentIDs();
485 503
486 dupe.AttachToBackup(); 504 dupe.AttachToBackup();
505 ScheduleGroupForFullUpdate();
487 506
488 return dupe; 507 return dupe;
489 } 508 }
@@ -492,25 +511,35 @@ namespace OpenSim.Region.Environment.Scenes
492 /// 511 ///
493 /// </summary> 512 /// </summary>
494 /// <param name="part"></param> 513 /// <param name="part"></param>
495 public void CopyRootPart(SceneObjectPart part) 514 public void CopyRootPart(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID)
496 { 515 {
497 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate()); 516 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID);
498 newPart.SetParent(this); 517 newPart.SetParent(this);
499 m_parts.Add(newPart.UUID, newPart); 518 m_parts.Add(newPart.UUID, newPart);
500 SetPartAsRoot(newPart); 519 SetPartAsRoot(newPart);
501 } 520 }
521 public void SetRootPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) {
522 part.OwnerID = cAgentID;
523 part.GroupID = cGroupID;
524 part.ScheduleFullUpdate();
525 }
502 526
503 /// <summary> 527 /// <summary>
504 /// 528 ///
505 /// </summary> 529 /// </summary>
506 /// <param name="part"></param> 530 /// <param name="part"></param>
507 public void CopyPart(SceneObjectPart part) 531 public void CopyPart(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID)
508 { 532 {
509 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate()); 533 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID);
510 newPart.SetParent(this); 534 newPart.SetParent(this);
511 m_parts.Add(newPart.UUID, newPart); 535 m_parts.Add(newPart.UUID, newPart);
512 SetPartAsNonRoot(newPart); 536 SetPartAsNonRoot(newPart);
513 } 537 }
538 public void SetPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID)
539 {
540 part.OwnerID = cAgentID;
541 part.GroupID = cGroupID;
542 }
514 543
515 #endregion 544 #endregion
516 545
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 52bea40..70b8829 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -520,13 +520,15 @@ namespace OpenSim.Region.Environment.Scenes
520 /// 520 ///
521 /// </summary> 521 /// </summary>
522 /// <returns></returns> 522 /// <returns></returns>
523 public SceneObjectPart Copy(uint localID) 523 public SceneObjectPart Copy(uint localID, LLUUID AgentID, LLUUID GroupID)
524 { 524 {
525 SceneObjectPart dupe = (SceneObjectPart) MemberwiseClone(); 525 SceneObjectPart dupe = (SceneObjectPart) MemberwiseClone();
526 dupe.m_shape = m_shape.Copy(); 526 dupe.m_shape = m_shape.Copy();
527 dupe.m_regionHandle = m_regionHandle; 527 dupe.m_regionHandle = m_regionHandle;
528 dupe.UUID = LLUUID.Random(); 528 dupe.UUID = LLUUID.Random();
529 dupe.LocalID = localID; 529 dupe.LocalID = localID;
530 dupe.OwnerID = AgentID;
531 dupe.GroupID = GroupID;
530 dupe.GroupPosition = new LLVector3(GroupPosition.X, GroupPosition.Y, GroupPosition.Z); 532 dupe.GroupPosition = new LLVector3(GroupPosition.X, GroupPosition.Y, GroupPosition.Z);
531 dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z); 533 dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z);
532 dupe.RotationOffset = 534 dupe.RotationOffset =