aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Land/LandObject.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs86
1 files changed, 63 insertions, 23 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index 98f3a3a..1a83f60 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -683,13 +683,25 @@ namespace OpenSim.Region.Environment.Modules.World.Land
683 public Dictionary<LLUUID, int> getLandObjectOwners() 683 public Dictionary<LLUUID, int> getLandObjectOwners()
684 { 684 {
685 Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>(); 685 Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>();
686 foreach (SceneObjectGroup obj in primsOverMe) 686 lock (primsOverMe)
687 { 687 {
688 if (!ownersAndCount.ContainsKey(obj.OwnerID)) 688 try
689 {
690
691 foreach (SceneObjectGroup obj in primsOverMe)
692 {
693 if (!ownersAndCount.ContainsKey(obj.OwnerID))
694 {
695 ownersAndCount.Add(obj.OwnerID, 0);
696 }
697 ownersAndCount[obj.OwnerID] += obj.PrimCount;
698 }
699 }
700 catch (InvalidOperationException)
689 { 701 {
690 ownersAndCount.Add(obj.OwnerID, 0); 702 m_log.Error("[LAND]: Unable to enumerate land owners. arr.");
691 } 703 }
692 ownersAndCount[obj.OwnerID] += obj.PrimCount; 704
693 } 705 }
694 return ownersAndCount; 706 return ownersAndCount;
695 } 707 }
@@ -700,10 +712,33 @@ namespace OpenSim.Region.Environment.Modules.World.Land
700 712
701 public void returnObject(SceneObjectGroup obj) 713 public void returnObject(SceneObjectGroup obj)
702 { 714 {
715 SceneObjectGroup[] objs = new SceneObjectGroup[1];
716 objs[0] = obj;
717 m_scene.returnObjects(objs, obj.OwnerID);
703 } 718 }
704 719
705 public void returnLandObjects(int type, LLUUID owner) 720 public void returnLandObjects(uint type, LLUUID[] owners, IClientAPI remote_client)
706 { 721 {
722 List<SceneObjectGroup> objlist = new List<SceneObjectGroup>();
723 for (int i = 0; i < owners.Length; i++)
724 {
725 lock (primsOverMe)
726 {
727 try
728 {
729 foreach (SceneObjectGroup obj in primsOverMe)
730 {
731 if (obj.OwnerID == owners[i])
732 objlist.Add(obj);
733 }
734 }
735 catch (InvalidOperationException)
736 {
737 m_log.Info("[PARCEL]: Unable to figure out all the objects owned by " + owners[i].ToString() + " arr.");
738 }
739 }
740 }
741 m_scene.returnObjects(objlist.ToArray(), remote_client.AgentId);
707 } 742 }
708 743
709 #endregion 744 #endregion
@@ -716,7 +751,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land
716 landData.ownerPrims = 0; 751 landData.ownerPrims = 0;
717 landData.otherPrims = 0; 752 landData.otherPrims = 0;
718 landData.selectedPrims = 0; 753 landData.selectedPrims = 0;
719 primsOverMe.Clear(); 754 lock (primsOverMe)
755 primsOverMe.Clear();
720 } 756 }
721 757
722 public void addPrimToCount(SceneObjectGroup obj) 758 public void addPrimToCount(SceneObjectGroup obj)
@@ -740,30 +776,34 @@ namespace OpenSim.Region.Environment.Modules.World.Land
740 } 776 }
741 } 777 }
742 778
743 primsOverMe.Add(obj); 779 lock (primsOverMe)
780 primsOverMe.Add(obj);
744 } 781 }
745 782
746 public void removePrimFromCount(SceneObjectGroup obj) 783 public void removePrimFromCount(SceneObjectGroup obj)
747 { 784 {
748 if (primsOverMe.Contains(obj)) 785 lock (primsOverMe)
749 { 786 {
750 LLUUID prim_owner = obj.OwnerID; 787 if (primsOverMe.Contains(obj))
751 int prim_count = obj.PrimCount;
752
753 if (prim_owner == landData.ownerID)
754 {
755 landData.ownerPrims -= prim_count;
756 }
757 else if (prim_owner == landData.groupID)
758 {
759 landData.groupPrims -= prim_count;
760 }
761 else
762 { 788 {
763 landData.otherPrims -= prim_count; 789 LLUUID prim_owner = obj.OwnerID;
764 } 790 int prim_count = obj.PrimCount;
765 791
766 primsOverMe.Remove(obj); 792 if (prim_owner == landData.ownerID)
793 {
794 landData.ownerPrims -= prim_count;
795 }
796 else if (prim_owner == landData.groupID)
797 {
798 landData.groupPrims -= prim_count;
799 }
800 else
801 {
802 landData.otherPrims -= prim_count;
803 }
804
805 primsOverMe.Remove(obj);
806 }
767 } 807 }
768 } 808 }
769 809