diff options
author | Melanie | 2009-11-08 20:36:00 +0000 |
---|---|---|
committer | Melanie | 2009-11-08 20:36:00 +0000 |
commit | 81c439bcaadee10a89e74cb65217c7910d943741 (patch) | |
tree | 49fd24169551b3207f2ab567e968672db470ea55 | |
parent | Reintroduce AssetBase's old behavior. A Parameterless constructor is required (diff) | |
download | opensim-SC-81c439bcaadee10a89e74cb65217c7910d943741.zip opensim-SC-81c439bcaadee10a89e74cb65217c7910d943741.tar.gz opensim-SC-81c439bcaadee10a89e74cb65217c7910d943741.tar.bz2 opensim-SC-81c439bcaadee10a89e74cb65217c7910d943741.tar.xz |
Patch from Snoopy2. Fixes Mantis #4342
fixes problems when group owned land was abandoned by the land owner or reclaimed by the estate manager or by god.
Beside that this new patch makes it possible, that users can buy land directly for a group, if the buyer has the required permissions.
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 40 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/ILandObject.cs | 1 |
3 files changed, 44 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 93a949a..968f46a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1059,9 +1059,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1059 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) | 1059 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) |
1060 | { | 1060 | { |
1061 | land.LandData.OwnerID = ownerID; | 1061 | land.LandData.OwnerID = ownerID; |
1062 | land.LandData.GroupID = UUID.Zero; | ||
1063 | land.LandData.IsGroupOwned = false; | ||
1062 | 1064 | ||
1063 | m_scene.ForEachClient(SendParcelOverlay); | 1065 | m_scene.ForEachClient(SendParcelOverlay); |
1064 | land.SendLandUpdateToClient(remote_client); | 1066 | land.SendLandUpdateToClient(true, remote_client); |
1065 | } | 1067 | } |
1066 | } | 1068 | } |
1067 | } | 1069 | } |
@@ -1082,8 +1084,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1082 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 1084 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
1083 | else | 1085 | else |
1084 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 1086 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
1087 | land.LandData.GroupID = UUID.Zero; | ||
1088 | land.LandData.IsGroupOwned = false; | ||
1085 | m_scene.ForEachClient(SendParcelOverlay); | 1089 | m_scene.ForEachClient(SendParcelOverlay); |
1086 | land.SendLandUpdateToClient(remote_client); | 1090 | land.SendLandUpdateToClient(true, remote_client); |
1087 | } | 1091 | } |
1088 | } | 1092 | } |
1089 | } | 1093 | } |
@@ -1105,9 +1109,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1105 | else | 1109 | else |
1106 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 1110 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
1107 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | 1111 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
1112 | land.LandData.GroupID = UUID.Zero; | ||
1108 | land.LandData.IsGroupOwned = false; | 1113 | land.LandData.IsGroupOwned = false; |
1109 | m_scene.ForEachClient(SendParcelOverlay); | 1114 | m_scene.ForEachClient(SendParcelOverlay); |
1110 | land.SendLandUpdateToClient(remote_client); | 1115 | land.SendLandUpdateToClient(true, remote_client); |
1111 | } | 1116 | } |
1112 | } | 1117 | } |
1113 | } | 1118 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index bfe85f1..0bd225e 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -49,6 +49,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
49 | #pragma warning restore 0429 | 49 | #pragma warning restore 0429 |
50 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; | 50 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; |
51 | 51 | ||
52 | private int m_lastSeqId = 0; | ||
53 | |||
52 | protected LandData m_landData = new LandData(); | 54 | protected LandData m_landData = new LandData(); |
53 | protected Scene m_scene; | 55 | protected Scene m_scene; |
54 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); | 56 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); |
@@ -81,6 +83,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
81 | { | 83 | { |
82 | m_scene = scene; | 84 | m_scene = scene; |
83 | LandData.OwnerID = owner_id; | 85 | LandData.OwnerID = owner_id; |
86 | if (is_group_owned) | ||
87 | LandData.GroupID = owner_id; | ||
88 | else | ||
89 | LandData.GroupID = UUID.Zero; | ||
84 | LandData.IsGroupOwned = is_group_owned; | 90 | LandData.IsGroupOwned = is_group_owned; |
85 | } | 91 | } |
86 | 92 | ||
@@ -172,7 +178,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
172 | // regionFlags |= (uint)RegionFlags.AllowLandmark; | 178 | // regionFlags |= (uint)RegionFlags.AllowLandmark; |
173 | // if (landData.OwnerID == remote_client.AgentId) | 179 | // if (landData.OwnerID == remote_client.AgentId) |
174 | // regionFlags |= (uint)RegionFlags.AllowSetHome; | 180 | // regionFlags |= (uint)RegionFlags.AllowSetHome; |
175 | remote_client.SendLandProperties(sequence_id, | 181 | |
182 | int seq_id; | ||
183 | if (snap_selection && (sequence_id == 0)) | ||
184 | { | ||
185 | seq_id = m_lastSeqId; | ||
186 | } | ||
187 | else | ||
188 | { | ||
189 | seq_id = sequence_id; | ||
190 | m_lastSeqId = seq_id; | ||
191 | } | ||
192 | |||
193 | remote_client.SendLandProperties(seq_id, | ||
176 | snap_selection, request_result, LandData, | 194 | snap_selection, request_result, LandData, |
177 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, | 195 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, |
178 | GetParcelMaxPrimCount(this), | 196 | GetParcelMaxPrimCount(this), |
@@ -184,6 +202,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
184 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) | 202 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) |
185 | { | 203 | { |
186 | //Needs later group support | 204 | //Needs later group support |
205 | bool snap_selection = false; | ||
187 | LandData newData = LandData.Copy(); | 206 | LandData newData = LandData.Copy(); |
188 | 207 | ||
189 | if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) | 208 | if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) |
@@ -192,6 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
192 | { | 211 | { |
193 | newData.AuthBuyerID = args.AuthBuyerID; | 212 | newData.AuthBuyerID = args.AuthBuyerID; |
194 | newData.SalePrice = args.SalePrice; | 213 | newData.SalePrice = args.SalePrice; |
214 | snap_selection = true; | ||
195 | } | 215 | } |
196 | } | 216 | } |
197 | newData.Category = args.Category; | 217 | newData.Category = args.Category; |
@@ -212,7 +232,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
212 | 232 | ||
213 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 233 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
214 | 234 | ||
215 | SendLandUpdateToAvatarsOverMe(); | 235 | SendLandUpdateToAvatarsOverMe(snap_selection); |
216 | } | 236 | } |
217 | } | 237 | } |
218 | 238 | ||
@@ -230,7 +250,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
230 | newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); | 250 | newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); |
231 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 251 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
232 | 252 | ||
233 | SendLandUpdateToAvatarsOverMe(); | 253 | SendLandUpdateToAvatarsOverMe(true); |
234 | } | 254 | } |
235 | 255 | ||
236 | public void DeedToGroup(UUID groupID) | 256 | public void DeedToGroup(UUID groupID) |
@@ -242,7 +262,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
242 | 262 | ||
243 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 263 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
244 | 264 | ||
245 | SendLandUpdateToAvatarsOverMe(); | 265 | SendLandUpdateToAvatarsOverMe(true); |
246 | } | 266 | } |
247 | 267 | ||
248 | public bool IsEitherBannedOrRestricted(UUID avatar) | 268 | public bool IsEitherBannedOrRestricted(UUID avatar) |
@@ -297,8 +317,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
297 | SendLandProperties(0, false, 0, remote_client); | 317 | SendLandProperties(0, false, 0, remote_client); |
298 | } | 318 | } |
299 | 319 | ||
320 | public void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client) | ||
321 | { | ||
322 | SendLandProperties(0, snap_selection, 0, remote_client); | ||
323 | } | ||
324 | |||
300 | public void SendLandUpdateToAvatarsOverMe() | 325 | public void SendLandUpdateToAvatarsOverMe() |
301 | { | 326 | { |
327 | SendLandUpdateToAvatarsOverMe(false); | ||
328 | } | ||
329 | |||
330 | public void SendLandUpdateToAvatarsOverMe(bool snap_selection) | ||
331 | { | ||
302 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 332 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
303 | ILandObject over = null; | 333 | ILandObject over = null; |
304 | for (int i = 0; i < avatars.Count; i++) | 334 | for (int i = 0; i < avatars.Count; i++) |
@@ -325,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
325 | else | 355 | else |
326 | avatars[i].Invulnerable = true; | 356 | avatars[i].Invulnerable = true; |
327 | 357 | ||
328 | SendLandUpdateToClient(avatars[i].ControllingClient); | 358 | SendLandUpdateToClient(snap_selection, avatars[i].ControllingClient); |
329 | } | 359 | } |
330 | } | 360 | } |
331 | } | 361 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs index c2b1292..084184f 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs | |||
@@ -54,6 +54,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
54 | bool IsBannedFromLand(UUID avatar); | 54 | bool IsBannedFromLand(UUID avatar); |
55 | bool IsRestrictedFromLand(UUID avatar); | 55 | bool IsRestrictedFromLand(UUID avatar); |
56 | void SendLandUpdateToClient(IClientAPI remote_client); | 56 | void SendLandUpdateToClient(IClientAPI remote_client); |
57 | void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); | ||
57 | List<UUID> CreateAccessListArrayByFlag(AccessList flag); | 58 | List<UUID> CreateAccessListArrayByFlag(AccessList flag); |
58 | void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); | 59 | void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); |
59 | void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client); | 60 | void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client); |