diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Land')
3 files changed, 99 insertions, 24 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs index 77c70a8..0b77b23 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs | |||
@@ -142,6 +142,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
142 | m_landManagementModule.UpdateLandObject(localID, data); | 142 | m_landManagementModule.UpdateLandObject(localID, data); |
143 | } | 143 | } |
144 | } | 144 | } |
145 | public void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient) | ||
146 | { | ||
147 | if (m_landManagementModule != null) | ||
148 | { | ||
149 | m_landManagementModule.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); | ||
150 | } | ||
151 | } | ||
145 | #endregion | 152 | #endregion |
146 | 153 | ||
147 | } | 154 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 7163769..5bc28f7 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | |||
@@ -902,7 +902,17 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
902 | 902 | ||
903 | public void handleParcelObjectOwnersRequest(int local_id, IClientAPI remote_client) | 903 | public void handleParcelObjectOwnersRequest(int local_id, IClientAPI remote_client) |
904 | { | 904 | { |
905 | landList[local_id].sendLandObjectOwners(remote_client); | 905 | lock (landList) |
906 | { | ||
907 | if (landList.ContainsKey(local_id)) | ||
908 | { | ||
909 | landList[local_id].sendLandObjectOwners(remote_client); | ||
910 | } | ||
911 | else | ||
912 | { | ||
913 | System.Console.WriteLine("[PARCEL]: Invalid land object passed for parcel object owner request"); | ||
914 | } | ||
915 | } | ||
906 | } | 916 | } |
907 | 917 | ||
908 | public void handleParcelAbandonRequest(int local_id, IClientAPI remote_client) | 918 | public void handleParcelAbandonRequest(int local_id, IClientAPI remote_client) |
@@ -1004,6 +1014,24 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1004 | AddLandObject(new_land); | 1014 | AddLandObject(new_land); |
1005 | } | 1015 | } |
1006 | 1016 | ||
1017 | public void ReturnObjectsInParcel(int localID, uint returnType, LLUUID[] agentIDs, LLUUID[] taskIDs, IClientAPI remoteClient) | ||
1018 | { | ||
1019 | ILandObject selectedParcel = null; | ||
1020 | lock (landList) | ||
1021 | { | ||
1022 | if (landList.ContainsKey(localID)) | ||
1023 | selectedParcel = landList[localID]; | ||
1024 | } | ||
1025 | if (selectedParcel == null) | ||
1026 | return; | ||
1027 | |||
1028 | if (returnType == 16) // parcel return | ||
1029 | { | ||
1030 | selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); | ||
1031 | } | ||
1032 | |||
1033 | } | ||
1034 | |||
1007 | public void NoLandDataFromStorage() | 1035 | public void NoLandDataFromStorage() |
1008 | { | 1036 | { |
1009 | ResetSimLandObjects(); | 1037 | ResetSimLandObjects(); |
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 | ||