diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 89 |
1 files changed, 21 insertions, 68 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index e87153b..57c7fc6 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -64,8 +64,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
64 | 64 | ||
65 | #endregion | 65 | #endregion |
66 | 66 | ||
67 | #region ILandObject Members | ||
68 | |||
69 | public int GetPrimsFree() | 67 | public int GetPrimsFree() |
70 | { | 68 | { |
71 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); | 69 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); |
@@ -213,6 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
213 | return simMax; | 211 | return simMax; |
214 | } | 212 | } |
215 | } | 213 | } |
214 | |||
216 | #endregion | 215 | #endregion |
217 | 216 | ||
218 | #region Packet Request Handling | 217 | #region Packet Request Handling |
@@ -944,9 +943,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
944 | 943 | ||
945 | lock (primsOverMe) | 944 | lock (primsOverMe) |
946 | { | 945 | { |
946 | // m_log.DebugFormat( | ||
947 | // "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", | ||
948 | // remote_client.Name, primsOverMe.Count); | ||
949 | |||
947 | try | 950 | try |
948 | { | 951 | { |
949 | |||
950 | foreach (SceneObjectGroup obj in primsOverMe) | 952 | foreach (SceneObjectGroup obj in primsOverMe) |
951 | { | 953 | { |
952 | try | 954 | try |
@@ -958,7 +960,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
958 | } | 960 | } |
959 | catch (NullReferenceException) | 961 | catch (NullReferenceException) |
960 | { | 962 | { |
961 | m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); | 963 | m_log.Error("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); |
962 | } | 964 | } |
963 | try | 965 | try |
964 | { | 966 | { |
@@ -985,6 +987,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
985 | public Dictionary<UUID, int> GetLandObjectOwners() | 987 | public Dictionary<UUID, int> GetLandObjectOwners() |
986 | { | 988 | { |
987 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); | 989 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); |
990 | |||
988 | lock (primsOverMe) | 991 | lock (primsOverMe) |
989 | { | 992 | { |
990 | try | 993 | try |
@@ -1021,8 +1024,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1021 | 1024 | ||
1022 | public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) | 1025 | public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) |
1023 | { | 1026 | { |
1024 | Dictionary<UUID,List<SceneObjectGroup>> returns = | 1027 | // m_log.DebugFormat( |
1025 | new Dictionary<UUID,List<SceneObjectGroup>>(); | 1028 | // "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name); |
1029 | |||
1030 | Dictionary<UUID,List<SceneObjectGroup>> returns = new Dictionary<UUID,List<SceneObjectGroup>>(); | ||
1026 | 1031 | ||
1027 | lock (primsOverMe) | 1032 | lock (primsOverMe) |
1028 | { | 1033 | { |
@@ -1095,83 +1100,29 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1095 | 1100 | ||
1096 | #region Object Adding/Removing from Parcel | 1101 | #region Object Adding/Removing from Parcel |
1097 | 1102 | ||
1098 | public void ResetLandPrimCounts() | 1103 | public void ResetOverMeRecord() |
1099 | { | 1104 | { |
1100 | LandData.GroupPrims = 0; | ||
1101 | LandData.OwnerPrims = 0; | ||
1102 | LandData.OtherPrims = 0; | ||
1103 | LandData.SelectedPrims = 0; | ||
1104 | |||
1105 | |||
1106 | lock (primsOverMe) | 1105 | lock (primsOverMe) |
1107 | primsOverMe.Clear(); | 1106 | primsOverMe.Clear(); |
1108 | } | 1107 | } |
1109 | 1108 | ||
1110 | public void AddPrimToCount(SceneObjectGroup obj) | 1109 | public void AddPrimOverMe(SceneObjectGroup obj) |
1111 | { | 1110 | { |
1112 | 1111 | // m_log.DebugFormat("[LAND OBJECT]: Adding scene object {0} {1} over {2}", obj.Name, obj.LocalId, LandData.Name); | |
1113 | UUID prim_owner = obj.OwnerID; | 1112 | |
1114 | int prim_count = obj.PrimCount; | ||
1115 | |||
1116 | if (obj.IsSelected) | ||
1117 | { | ||
1118 | LandData.SelectedPrims += prim_count; | ||
1119 | } | ||
1120 | else | ||
1121 | { | ||
1122 | if (prim_owner == LandData.OwnerID) | ||
1123 | { | ||
1124 | LandData.OwnerPrims += prim_count; | ||
1125 | } | ||
1126 | else if ((obj.GroupID == LandData.GroupID || | ||
1127 | prim_owner == LandData.GroupID) && | ||
1128 | LandData.GroupID != UUID.Zero) | ||
1129 | { | ||
1130 | LandData.GroupPrims += prim_count; | ||
1131 | } | ||
1132 | else | ||
1133 | { | ||
1134 | LandData.OtherPrims += prim_count; | ||
1135 | } | ||
1136 | } | ||
1137 | |||
1138 | lock (primsOverMe) | 1113 | lock (primsOverMe) |
1139 | primsOverMe.Add(obj); | 1114 | primsOverMe.Add(obj); |
1140 | } | 1115 | } |
1141 | 1116 | ||
1142 | public void RemovePrimFromCount(SceneObjectGroup obj) | 1117 | public void RemovePrimFromOverMe(SceneObjectGroup obj) |
1143 | { | 1118 | { |
1119 | // m_log.DebugFormat("[LAND OBJECT]: Removing scene object {0} {1} from over {2}", obj.Name, obj.LocalId, LandData.Name); | ||
1120 | |||
1144 | lock (primsOverMe) | 1121 | lock (primsOverMe) |
1145 | { | 1122 | primsOverMe.Remove(obj); |
1146 | if (primsOverMe.Contains(obj)) | ||
1147 | { | ||
1148 | UUID prim_owner = obj.OwnerID; | ||
1149 | int prim_count = obj.PrimCount; | ||
1150 | |||
1151 | if (prim_owner == LandData.OwnerID) | ||
1152 | { | ||
1153 | LandData.OwnerPrims -= prim_count; | ||
1154 | } | ||
1155 | else if (obj.GroupID == LandData.GroupID || | ||
1156 | prim_owner == LandData.GroupID) | ||
1157 | { | ||
1158 | LandData.GroupPrims -= prim_count; | ||
1159 | } | ||
1160 | else | ||
1161 | { | ||
1162 | LandData.OtherPrims -= prim_count; | ||
1163 | } | ||
1164 | |||
1165 | primsOverMe.Remove(obj); | ||
1166 | } | ||
1167 | } | ||
1168 | } | 1123 | } |
1169 | 1124 | ||
1170 | #endregion | 1125 | #endregion |
1171 | |||
1172 | #endregion | ||
1173 | |||
1174 | #endregion | ||
1175 | 1126 | ||
1176 | /// <summary> | 1127 | /// <summary> |
1177 | /// Set the media url for this land parcel | 1128 | /// Set the media url for this land parcel |
@@ -1192,5 +1143,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1192 | LandData.MusicURL = url; | 1143 | LandData.MusicURL = url; |
1193 | SendLandUpdateToAvatarsOverMe(); | 1144 | SendLandUpdateToAvatarsOverMe(); |
1194 | } | 1145 | } |
1146 | |||
1147 | #endregion | ||
1195 | } | 1148 | } |
1196 | } | 1149 | } |