aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-07 07:42:03 +0000
committerTeravus Ovares2007-12-07 07:42:03 +0000
commit57f666497bef6a68df9cc6e37ccf288c462a37b5 (patch)
tree4a1f4c3061ddca46fbe789191b45a6967a7a6889 /OpenSim/Region/Environment/Scenes
parentadded timer_Script to OpenSim.ini.example (diff)
downloadopensim-SC_OLD-57f666497bef6a68df9cc6e37ccf288c462a37b5.zip
opensim-SC_OLD-57f666497bef6a68df9cc6e37ccf288c462a37b5.tar.gz
opensim-SC_OLD-57f666497bef6a68df9cc6e37ccf288c462a37b5.tar.bz2
opensim-SC_OLD-57f666497bef6a68df9cc6e37ccf288c462a37b5.tar.xz
* Added hacked support for 'anyone can move' and 'anyone can copy'.
* BACKUP YOUR PRIM BEFORE UPDATING TO THIS and then double check the prim permissions after applying it with a different avatar (then the master avatar or the prim owner avatar). * Also, beware that any objects created under the old permission scheme may react oddly. They may automatically allow anyone to modify them, (which you'll then have to un-set). * It's hacked support because when 'anyone can move is set', any avatar can modify the prim (texture, shape, scale, etc)
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs101
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs7
3 files changed, 87 insertions, 24 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 04bdf5a..501f519 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -443,7 +443,12 @@ namespace OpenSim.Region.Environment.Scenes
443 { 443 {
444 SceneObjectGroup group = GetGroupByPrim(localID); 444 SceneObjectGroup group = GetGroupByPrim(localID);
445 if (group != null) 445 if (group != null)
446 group.Resize(scale, localID); 446 {
447 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
448 {
449 group.Resize(scale, localID);
450 }
451 }
447 } 452 }
448 453
449 /// <summary> 454 /// <summary>
@@ -473,7 +478,12 @@ namespace OpenSim.Region.Environment.Scenes
473 { 478 {
474 SceneObjectGroup group = GetGroupByPrim(localID); 479 SceneObjectGroup group = GetGroupByPrim(localID);
475 if (group != null) 480 if (group != null)
476 group.UpdateSingleRotation(rot, localID); 481 {
482 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
483 {
484 group.UpdateSingleRotation(rot, localID);
485 }
486 }
477 } 487 }
478 488
479 /// <summary> 489 /// <summary>
@@ -486,7 +496,12 @@ namespace OpenSim.Region.Environment.Scenes
486 { 496 {
487 SceneObjectGroup group = GetGroupByPrim(localID); 497 SceneObjectGroup group = GetGroupByPrim(localID);
488 if (group != null) 498 if (group != null)
489 group.UpdateGroupRotation(rot); 499 {
500 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
501 {
502 group.UpdateGroupRotation(rot);
503 }
504 }
490 } 505 }
491 506
492 /// <summary> 507 /// <summary>
@@ -500,14 +515,24 @@ namespace OpenSim.Region.Environment.Scenes
500 { 515 {
501 SceneObjectGroup group = GetGroupByPrim(localID); 516 SceneObjectGroup group = GetGroupByPrim(localID);
502 if (group != null) 517 if (group != null)
503 group.UpdateGroupRotation(pos, rot); 518 {
519 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
520 {
521 group.UpdateGroupRotation(pos, rot);
522 }
523 }
504 } 524 }
505 525
506 public void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient) 526 public void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
507 { 527 {
508 SceneObjectGroup group = GetGroupByPrim(localID); 528 SceneObjectGroup group = GetGroupByPrim(localID);
509 if (group != null) 529 if (group != null)
510 group.UpdateSinglePosition(pos, localID); 530 {
531 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
532 {
533 group.UpdateSinglePosition(pos, localID);
534 }
535 }
511 } 536 }
512 537
513 /// <summary> 538 /// <summary>
@@ -520,7 +545,12 @@ namespace OpenSim.Region.Environment.Scenes
520 { 545 {
521 SceneObjectGroup group = GetGroupByPrim(localID); 546 SceneObjectGroup group = GetGroupByPrim(localID);
522 if (group != null) 547 if (group != null)
523 group.UpdateGroupPosition(pos); 548 {
549 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
550 {
551 group.UpdateGroupPosition(pos);
552 }
553 }
524 } 554 }
525 555
526 /// <summary> 556 /// <summary>
@@ -533,7 +563,12 @@ namespace OpenSim.Region.Environment.Scenes
533 { 563 {
534 SceneObjectGroup group = GetGroupByPrim(localID); 564 SceneObjectGroup group = GetGroupByPrim(localID);
535 if (group != null) 565 if (group != null)
536 group.UpdateTextureEntry(localID, texture); 566 {
567 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
568 {
569 group.UpdateTextureEntry(localID, texture);
570 }
571 }
537 } 572 }
538 573
539 /// <summary> 574 /// <summary>
@@ -546,17 +581,24 @@ namespace OpenSim.Region.Environment.Scenes
546 { 581 {
547 SceneObjectGroup group = GetGroupByPrim(localID); 582 SceneObjectGroup group = GetGroupByPrim(localID);
548 if (group != null) 583 if (group != null)
549 group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes()); 584 {
550 //System.Console.WriteLine("Got primupdate packet: " + packet.UsePhysics.ToString()); 585 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
586 {
587 group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
588 }
589 }
590
551 } 591 }
552 592
553 public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 593 public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
554 { 594 {
555 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, objectID) || PermissionsMngr.AnyoneCanMovePermission(remoteClient.AgentId, objectID)) 595 SceneObjectGroup group = GetGroupByPrim(objectID);
596 if (group != null)
556 { 597 {
557 SceneObjectGroup group = GetGroupByPrim(objectID); 598 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
558 if (group != null) 599 {
559 group.GrabMovement(offset, pos, remoteClient); 600 group.GrabMovement(offset, pos, remoteClient);
601 }
560 } 602 }
561 } 603 }
562 604
@@ -565,11 +607,16 @@ namespace OpenSim.Region.Environment.Scenes
565 /// </summary> 607 /// </summary>
566 /// <param name="primLocalID"></param> 608 /// <param name="primLocalID"></param>
567 /// <param name="description"></param> 609 /// <param name="description"></param>
568 public void PrimName(uint primLocalID, string name) 610 public void PrimName(IClientAPI remoteClient, uint primLocalID, string name)
569 { 611 {
570 SceneObjectGroup group = GetGroupByPrim(primLocalID); 612 SceneObjectGroup group = GetGroupByPrim(primLocalID);
571 if (group != null) 613 if (group != null)
572 group.SetPartName(name, primLocalID); 614 {
615 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
616 {
617 group.SetPartName(name, primLocalID);
618 }
619 }
573 } 620 }
574 621
575 /// <summary> 622 /// <summary>
@@ -577,21 +624,30 @@ namespace OpenSim.Region.Environment.Scenes
577 /// </summary> 624 /// </summary>
578 /// <param name="primLocalID"></param> 625 /// <param name="primLocalID"></param>
579 /// <param name="description"></param> 626 /// <param name="description"></param>
580 public void PrimDescription(uint primLocalID, string description) 627 public void PrimDescription(IClientAPI remoteClient, uint primLocalID, string description)
581 { 628 {
582 SceneObjectGroup group = GetGroupByPrim(primLocalID); 629 SceneObjectGroup group = GetGroupByPrim(primLocalID);
583 if (group != null) 630 if (group != null)
584 group.SetPartDescription(description, primLocalID); 631 {
632 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
633 {
634 group.SetPartDescription(description, primLocalID);
635 }
636 }
585 } 637 }
586 638
587 public void UpdateExtraParam(LLUUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) 639 public void UpdateExtraParam(LLUUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data)
588 { 640 {
589 SceneObjectGroup group = GetGroupByPrim(primLocalID); 641 SceneObjectGroup group = GetGroupByPrim(primLocalID);
590 if (this.m_parentScene.PermissionsMngr.CanEditObject(agentID, group.GetPartsFullID(primLocalID))) 642
643 if (group != null)
591 { 644 {
592 if (group != null) 645 if (PermissionsMngr.CanEditObject(agentID, group.UUID))
646 {
593 group.UpdateExtraParam(primLocalID, type, inUse, data); 647 group.UpdateExtraParam(primLocalID, type, inUse, data);
648 }
594 } 649 }
650
595 } 651 }
596 652
597 /// <summary> 653 /// <summary>
@@ -602,10 +658,13 @@ namespace OpenSim.Region.Environment.Scenes
602 public void UpdatePrimShape(LLUUID agentID, uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) 658 public void UpdatePrimShape(LLUUID agentID, uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
603 { 659 {
604 SceneObjectGroup group = GetGroupByPrim(primLocalID); 660 SceneObjectGroup group = GetGroupByPrim(primLocalID);
605 if (this.m_parentScene.PermissionsMngr.CanEditObject(agentID, group.GetPartsFullID(primLocalID))) 661 if (group != null)
606 { 662 {
607 if (group != null) 663 if (PermissionsMngr.CanEditObjectPosition(agentID, group.GetPartsFullID(primLocalID)))
664 {
665
608 group.UpdateShape(shapeBlock, primLocalID); 666 group.UpdateShape(shapeBlock, primLocalID);
667 }
609 } 668 }
610 } 669 }
611 670
@@ -724,7 +783,7 @@ namespace OpenSim.Region.Environment.Scenes
724 783
725 if (originPrim != null) 784 if (originPrim != null)
726 { 785 {
727 if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID) || PermissionsMngr.AnyoneCanCopyPermission(AgentID, originPrim.UUID)) 786 if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID))
728 { 787 {
729 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID); 788 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
730 copy.AbsolutePosition = copy.AbsolutePosition + offset; 789 copy.AbsolutePosition = copy.AbsolutePosition + offset;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index dbcd332..6c8b3bf 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -448,6 +448,9 @@ namespace OpenSim.Region.Environment.Scenes
448 item.parentFolderID = DeRezPacket.AgentBlock.DestinationID; 448 item.parentFolderID = DeRezPacket.AgentBlock.DestinationID;
449 item.inventoryCurrentPermissions = 2147483647; 449 item.inventoryCurrentPermissions = 2147483647;
450 item.inventoryNextPermissions = 2147483647; 450 item.inventoryNextPermissions = 2147483647;
451 item.inventoryEveryOnePermissions = ((SceneObjectGroup)selectedEnt).RootPart.EveryoneMask;
452 item.inventoryBasePermissions = ((SceneObjectGroup)selectedEnt).RootPart.BaseMask;
453 item.inventoryCurrentPermissions = ((SceneObjectGroup)selectedEnt).RootPart.OwnerMask;
451 454
452 userInfo.AddItem(remoteClient.AgentId, item); 455 userInfo.AddItem(remoteClient.AgentId, item);
453 remoteClient.SendInventoryItemCreateUpdate(item); 456 remoteClient.SendInventoryItemCreateUpdate(item);
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 238e78a..bf02e8d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -851,7 +851,7 @@ namespace OpenSim.Region.Environment.Scenes
851 m_flags |= flag; 851 m_flags |= flag;
852 852
853 } 853 }
854 uint currflag = (uint)m_flags; 854 //uint currflag = (uint)m_flags;
855 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString()); 855 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
856 //ScheduleFullUpdate(); 856 //ScheduleFullUpdate();
857 } 857 }
@@ -1295,7 +1295,8 @@ namespace OpenSim.Region.Environment.Scenes
1295 //EveryoneMask |= (uint)57344; 1295 //EveryoneMask |= (uint)57344;
1296 1296
1297 } 1297 }
1298 ScheduleFullUpdate(); 1298 //ScheduleFullUpdate();
1299 SendFullUpdateToAllClients();
1299 } 1300 }
1300 //Field 16 = NextownerMask 1301 //Field 16 = NextownerMask
1301 if (field == (byte)16) 1302 if (field == (byte)16)
@@ -1308,7 +1309,7 @@ namespace OpenSim.Region.Environment.Scenes
1308 { 1309 {
1309 NextOwnerMask |= mask; 1310 NextOwnerMask |= mask;
1310 } 1311 }
1311 ScheduleFullUpdate(); 1312 SendFullUpdateToAllClients();
1312 } 1313 }
1313 1314
1314 } 1315 }