diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
8 files changed, 304 insertions, 268 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 87f137e..9387bce 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule | |||
146 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) | 146 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) |
147 | { | 147 | { |
148 | ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 148 | ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
149 | if ((obj.landData.Flags & (uint)ParcelFlags.AllowDamage) != 0) | 149 | if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) |
150 | { | 150 | { |
151 | avatar.Invulnerable = false; | 151 | avatar.Invulnerable = false; |
152 | } | 152 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 65f83fd..54acbc4 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -53,6 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
54 | 54 | ||
55 | private static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); | 55 | private static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); |
56 | private static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); | ||
56 | 57 | ||
57 | private Scene m_scene; | 58 | private Scene m_scene; |
58 | private Stream m_loadStream; | 59 | private Stream m_loadStream; |
@@ -100,6 +101,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
100 | int successfulAssetRestores = 0; | 101 | int successfulAssetRestores = 0; |
101 | int failedAssetRestores = 0; | 102 | int failedAssetRestores = 0; |
102 | List<string> serialisedSceneObjects = new List<string>(); | 103 | List<string> serialisedSceneObjects = new List<string>(); |
104 | List<string> serialisedParcels = new List<string>(); | ||
103 | string filePath = "NONE"; | 105 | string filePath = "NONE"; |
104 | 106 | ||
105 | try | 107 | try |
@@ -119,7 +121,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
119 | 121 | ||
120 | if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) | 122 | if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) |
121 | { | 123 | { |
122 | serialisedSceneObjects.Add(m_asciiEncoding.GetString(data)); | 124 | serialisedSceneObjects.Add(m_utf8Encoding.GetString(data)); |
123 | } | 125 | } |
124 | else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | 126 | else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) |
125 | { | 127 | { |
@@ -136,6 +138,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
136 | { | 138 | { |
137 | LoadRegionSettings(filePath, data); | 139 | LoadRegionSettings(filePath, data); |
138 | } | 140 | } |
141 | else if (!m_merge && filePath.StartsWith(ArchiveConstants.LANDDATA_PATH)) | ||
142 | { | ||
143 | serialisedParcels.Add(m_utf8Encoding.GetString(data)); | ||
144 | } | ||
139 | else if (filePath == ArchiveConstants.CONTROL_FILE_PATH) | 145 | else if (filePath == ArchiveConstants.CONTROL_FILE_PATH) |
140 | { | 146 | { |
141 | LoadControlFile(filePath, data); | 147 | LoadControlFile(filePath, data); |
@@ -169,6 +175,26 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
169 | m_scene.DeleteAllSceneObjects(); | 175 | m_scene.DeleteAllSceneObjects(); |
170 | } | 176 | } |
171 | 177 | ||
178 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | ||
179 | // otherwise, use the master avatar uuid instead | ||
180 | UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
181 | |||
182 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | ||
183 | masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
184 | |||
185 | // Reload serialized parcels | ||
186 | m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); | ||
187 | List<LandData> landData = new List<LandData>(); | ||
188 | foreach (string serialisedParcel in serialisedParcels) | ||
189 | { | ||
190 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); | ||
191 | if (!ResolveUserUuid(parcel.OwnerID)) | ||
192 | parcel.OwnerID = masterAvatarId; | ||
193 | landData.Add(parcel); | ||
194 | } | ||
195 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | ||
196 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); | ||
197 | |||
172 | // Reload serialized prims | 198 | // Reload serialized prims |
173 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); | 199 | m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); |
174 | 200 | ||
@@ -198,12 +224,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
198 | // to the same scene (when this is possible). | 224 | // to the same scene (when this is possible). |
199 | sceneObject.ResetIDs(); | 225 | sceneObject.ResetIDs(); |
200 | 226 | ||
201 | // Try to retain the original creator/owner/lastowner if their uuid is present on this grid | ||
202 | // otherwise, use the master avatar uuid instead | ||
203 | UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
204 | |||
205 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | ||
206 | masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
207 | 227 | ||
208 | foreach (SceneObjectPart part in sceneObject.Children.Values) | 228 | foreach (SceneObjectPart part in sceneObject.Children.Values) |
209 | { | 229 | { |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index a62c5b3..f039be8 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -102,6 +102,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
102 | 102 | ||
103 | m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); | 103 | m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); |
104 | 104 | ||
105 | // Write out land data (aka parcel) settings | ||
106 | List<ILandObject>landObjects = m_scene.LandChannel.AllParcels(); | ||
107 | foreach (ILandObject lo in landObjects) | ||
108 | { | ||
109 | LandData landData = lo.LandData; | ||
110 | string landDataPath = String.Format("{0}{1}.xml", ArchiveConstants.LANDDATA_PATH, | ||
111 | landData.GlobalID.ToString()); | ||
112 | m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData)); | ||
113 | } | ||
114 | m_log.InfoFormat("[ARCHIVER]: Added parcel settings to archive."); | ||
115 | |||
105 | // Write out terrain | 116 | // Write out terrain |
106 | string terrainPath | 117 | string terrainPath |
107 | = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_scene.RegionInfo.RegionName); | 118 | = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_scene.RegionInfo.RegionName); |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 8767332..4ed23bb 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs | |||
@@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
82 | } | 82 | } |
83 | 83 | ||
84 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | 84 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
85 | obj.landData.Name = "NO LAND"; | 85 | obj.LandData.Name = "NO LAND"; |
86 | return obj; | 86 | return obj; |
87 | } | 87 | } |
88 | 88 | ||
@@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
103 | } | 103 | } |
104 | 104 | ||
105 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | 105 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
106 | obj.landData.Name = "NO LAND"; | 106 | obj.LandData.Name = "NO LAND"; |
107 | return obj; | 107 | return obj; |
108 | } | 108 | } |
109 | 109 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index fdff61e..d2b5cb1 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -47,9 +47,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
47 | { | 47 | { |
48 | // used for caching | 48 | // used for caching |
49 | internal class ExtendedLandData { | 49 | internal class ExtendedLandData { |
50 | public LandData landData; | 50 | public LandData LandData; |
51 | public ulong regionHandle; | 51 | public ulong RegionHandle; |
52 | public uint x, y; | 52 | public uint X, Y; |
53 | } | 53 | } |
54 | 54 | ||
55 | public class LandManagementModule : INonSharedRegionModule | 55 | public class LandManagementModule : INonSharedRegionModule |
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
191 | { | 191 | { |
192 | if (m_landList.ContainsKey(local_id)) | 192 | if (m_landList.ContainsKey(local_id)) |
193 | { | 193 | { |
194 | m_landList[local_id].landData = newData; | 194 | m_landList[local_id].LandData = newData; |
195 | m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, m_landList[local_id]); | 195 | m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, m_landList[local_id]); |
196 | } | 196 | } |
197 | } | 197 | } |
@@ -218,12 +218,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
218 | 218 | ||
219 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); | 219 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); |
220 | 220 | ||
221 | fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 221 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
222 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 222 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) |
223 | fullSimParcel.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 223 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
224 | else | 224 | else |
225 | fullSimParcel.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 225 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
226 | fullSimParcel.landData.ClaimDate = Util.UnixTimeSinceEpoch(); | 226 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
227 | AddLandObject(fullSimParcel); | 227 | AddLandObject(fullSimParcel); |
228 | } | 228 | } |
229 | 229 | ||
@@ -289,11 +289,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
289 | { | 289 | { |
290 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) | 290 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) |
291 | { | 291 | { |
292 | if (parcelAvatarIsEntering.isBannedFromLand(avatar.UUID)) | 292 | if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) |
293 | { | 293 | { |
294 | SendYouAreBannedNotice(avatar); | 294 | SendYouAreBannedNotice(avatar); |
295 | } | 295 | } |
296 | else if (parcelAvatarIsEntering.isRestrictedFromLand(avatar.UUID)) | 296 | else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID)) |
297 | { | 297 | { |
298 | avatar.ControllingClient.SendAlertMessage( | 298 | avatar.ControllingClient.SendAlertMessage( |
299 | "You are not allowed on this parcel because the land owner has restricted access. For now, you can enter, but please respect the land owner's decisions (or he can ban you!)."); | 299 | "You are not allowed on this parcel because the land owner has restricted access. For now, you can enter, but please respect the land owner's decisions (or he can ban you!)."); |
@@ -321,14 +321,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
321 | List<ILandObject> checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); | 321 | List<ILandObject> checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); |
322 | foreach (ILandObject checkBan in checkLandParcels) | 322 | foreach (ILandObject checkBan in checkLandParcels) |
323 | { | 323 | { |
324 | if (checkBan.isBannedFromLand(avatar.AgentId)) | 324 | if (checkBan.IsBannedFromLand(avatar.AgentId)) |
325 | { | 325 | { |
326 | checkBan.sendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); | 326 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); |
327 | return; //Only send one | 327 | return; //Only send one |
328 | } | 328 | } |
329 | if (checkBan.isRestrictedFromLand(avatar.AgentId)) | 329 | if (checkBan.IsRestrictedFromLand(avatar.AgentId)) |
330 | { | 330 | { |
331 | checkBan.sendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar); | 331 | checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar); |
332 | return; //Only send one | 332 | return; //Only send one |
333 | } | 333 | } |
334 | } | 334 | } |
@@ -348,19 +348,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
348 | { | 348 | { |
349 | if (!avatar.IsChildAgent) | 349 | if (!avatar.IsChildAgent) |
350 | { | 350 | { |
351 | over.sendLandUpdateToClient(avatar.ControllingClient); | 351 | over.SendLandUpdateToClient(avatar.ControllingClient); |
352 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.landData.LocalID, | 352 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, |
353 | m_scene.RegionInfo.RegionID); | 353 | m_scene.RegionInfo.RegionID); |
354 | } | 354 | } |
355 | } | 355 | } |
356 | 356 | ||
357 | if (avatar.currentParcelUUID != over.landData.GlobalID) | 357 | if (avatar.currentParcelUUID != over.LandData.GlobalID) |
358 | { | 358 | { |
359 | if (!avatar.IsChildAgent) | 359 | if (!avatar.IsChildAgent) |
360 | { | 360 | { |
361 | over.sendLandUpdateToClient(avatar.ControllingClient); | 361 | over.SendLandUpdateToClient(avatar.ControllingClient); |
362 | avatar.currentParcelUUID = over.landData.GlobalID; | 362 | avatar.currentParcelUUID = over.LandData.GlobalID; |
363 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.landData.LocalID, | 363 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, |
364 | m_scene.RegionInfo.RegionID); | 364 | m_scene.RegionInfo.RegionID); |
365 | } | 365 | } |
366 | } | 366 | } |
@@ -386,16 +386,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
386 | if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && | 386 | if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && |
387 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) | 387 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) |
388 | { | 388 | { |
389 | EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.landData.LocalID, | 389 | EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, |
390 | m_scene.RegionInfo.RegionID); | 390 | m_scene.RegionInfo.RegionID); |
391 | //They are going under the safety line! | 391 | //They are going under the safety line! |
392 | if (!parcel.isBannedFromLand(clientAvatar.UUID)) | 392 | if (!parcel.IsBannedFromLand(clientAvatar.UUID)) |
393 | { | 393 | { |
394 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; | 394 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; |
395 | } | 395 | } |
396 | } | 396 | } |
397 | else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && | 397 | else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && |
398 | parcel.isBannedFromLand(clientAvatar.UUID)) | 398 | parcel.IsBannedFromLand(clientAvatar.UUID)) |
399 | { | 399 | { |
400 | SendYouAreBannedNotice(clientAvatar); | 400 | SendYouAreBannedNotice(clientAvatar); |
401 | } | 401 | } |
@@ -409,7 +409,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
409 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 409 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
410 | if (over != null) | 410 | if (over != null) |
411 | { | 411 | { |
412 | if (!over.isBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT) | 412 | if (!over.IsBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT) |
413 | { | 413 | { |
414 | avatar.lastKnownAllowedPosition = | 414 | avatar.lastKnownAllowedPosition = |
415 | new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); | 415 | new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); |
@@ -429,7 +429,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
429 | 429 | ||
430 | if (land != null) | 430 | if (land != null) |
431 | { | 431 | { |
432 | m_landList[landLocalID].sendAccessList(agentID, sessionID, flags, sequenceID, remote_client); | 432 | m_landList[landLocalID].SendAccessList(agentID, sessionID, flags, sequenceID, remote_client); |
433 | } | 433 | } |
434 | } | 434 | } |
435 | 435 | ||
@@ -445,9 +445,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
445 | 445 | ||
446 | if (land != null) | 446 | if (land != null) |
447 | { | 447 | { |
448 | if (agentID == land.landData.OwnerID) | 448 | if (agentID == land.LandData.OwnerID) |
449 | { | 449 | { |
450 | land.updateAccessList(flags, entries, remote_client); | 450 | land.UpdateAccessList(flags, entries, remote_client); |
451 | } | 451 | } |
452 | } | 452 | } |
453 | else | 453 | else |
@@ -476,9 +476,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
476 | lock (m_landList) | 476 | lock (m_landList) |
477 | { | 477 | { |
478 | int newLandLocalID = ++m_lastLandLocalID; | 478 | int newLandLocalID = ++m_lastLandLocalID; |
479 | new_land.landData.LocalID = newLandLocalID; | 479 | new_land.LandData.LocalID = newLandLocalID; |
480 | 480 | ||
481 | bool[,] landBitmap = new_land.getLandBitmap(); | 481 | bool[,] landBitmap = new_land.GetLandBitmap(); |
482 | for (int x = 0; x < landArrayMax; x++) | 482 | for (int x = 0; x < landArrayMax; x++) |
483 | { | 483 | { |
484 | for (int y = 0; y < landArrayMax; y++) | 484 | for (int y = 0; y < landArrayMax; y++) |
@@ -493,7 +493,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
493 | m_landList.Add(newLandLocalID, new_land); | 493 | m_landList.Add(newLandLocalID, new_land); |
494 | } | 494 | } |
495 | 495 | ||
496 | new_land.forceUpdateLandInfo(); | 496 | new_land.ForceUpdateLandInfo(); |
497 | m_scene.EventManager.TriggerLandObjectAdded(new_land); | 497 | m_scene.EventManager.TriggerLandObjectAdded(new_land); |
498 | return new_land; | 498 | return new_land; |
499 | } | 499 | } |
@@ -520,14 +520,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
520 | } | 520 | } |
521 | } | 521 | } |
522 | 522 | ||
523 | m_scene.EventManager.TriggerLandObjectRemoved(m_landList[local_id].landData.GlobalID); | 523 | m_scene.EventManager.TriggerLandObjectRemoved(m_landList[local_id].LandData.GlobalID); |
524 | m_landList.Remove(local_id); | 524 | m_landList.Remove(local_id); |
525 | } | 525 | } |
526 | } | 526 | } |
527 | 527 | ||
528 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 528 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
529 | { | 529 | { |
530 | bool[,] landBitmapSlave = slave.getLandBitmap(); | 530 | bool[,] landBitmapSlave = slave.GetLandBitmap(); |
531 | lock (m_landList) | 531 | lock (m_landList) |
532 | { | 532 | { |
533 | for (int x = 0; x < 64; x++) | 533 | for (int x = 0; x < 64; x++) |
@@ -536,14 +536,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
536 | { | 536 | { |
537 | if (landBitmapSlave[x, y]) | 537 | if (landBitmapSlave[x, y]) |
538 | { | 538 | { |
539 | m_landIDList[x, y] = master.landData.LocalID; | 539 | m_landIDList[x, y] = master.LandData.LocalID; |
540 | } | 540 | } |
541 | } | 541 | } |
542 | } | 542 | } |
543 | } | 543 | } |
544 | 544 | ||
545 | removeLandObject(slave.landData.LocalID); | 545 | removeLandObject(slave.LandData.LocalID); |
546 | UpdateLandObject(master.landData.LocalID, master.landData); | 546 | UpdateLandObject(master.LandData.LocalID, master.LandData); |
547 | } | 547 | } |
548 | 548 | ||
549 | public ILandObject GetLandObject(int parcelLocalID) | 549 | public ILandObject GetLandObject(int parcelLocalID) |
@@ -630,7 +630,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
630 | { | 630 | { |
631 | foreach (LandObject p in m_landList.Values) | 631 | foreach (LandObject p in m_landList.Values) |
632 | { | 632 | { |
633 | p.resetLandPrimCounts(); | 633 | p.ResetLandPrimCounts(); |
634 | } | 634 | } |
635 | } | 635 | } |
636 | } | 636 | } |
@@ -651,7 +651,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
651 | ILandObject landUnderPrim = GetLandObject(position.X, position.Y); | 651 | ILandObject landUnderPrim = GetLandObject(position.X, position.Y); |
652 | if (landUnderPrim != null) | 652 | if (landUnderPrim != null) |
653 | { | 653 | { |
654 | landUnderPrim.addPrimToCount(obj); | 654 | landUnderPrim.AddPrimToCount(obj); |
655 | } | 655 | } |
656 | } | 656 | } |
657 | 657 | ||
@@ -662,7 +662,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
662 | { | 662 | { |
663 | foreach (LandObject p in m_landList.Values) | 663 | foreach (LandObject p in m_landList.Values) |
664 | { | 664 | { |
665 | p.removePrimFromCount(obj); | 665 | p.RemovePrimFromCount(obj); |
666 | } | 666 | } |
667 | } | 667 | } |
668 | } | 668 | } |
@@ -675,15 +675,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
675 | { | 675 | { |
676 | foreach (LandObject p in m_landList.Values) | 676 | foreach (LandObject p in m_landList.Values) |
677 | { | 677 | { |
678 | if (!landOwnersAndParcels.ContainsKey(p.landData.OwnerID)) | 678 | if (!landOwnersAndParcels.ContainsKey(p.LandData.OwnerID)) |
679 | { | 679 | { |
680 | List<LandObject> tempList = new List<LandObject>(); | 680 | List<LandObject> tempList = new List<LandObject>(); |
681 | tempList.Add(p); | 681 | tempList.Add(p); |
682 | landOwnersAndParcels.Add(p.landData.OwnerID, tempList); | 682 | landOwnersAndParcels.Add(p.LandData.OwnerID, tempList); |
683 | } | 683 | } |
684 | else | 684 | else |
685 | { | 685 | { |
686 | landOwnersAndParcels[p.landData.OwnerID].Add(p); | 686 | landOwnersAndParcels[p.LandData.OwnerID].Add(p); |
687 | } | 687 | } |
688 | } | 688 | } |
689 | } | 689 | } |
@@ -694,15 +694,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
694 | int simPrims = 0; | 694 | int simPrims = 0; |
695 | foreach (LandObject p in landOwnersAndParcels[owner]) | 695 | foreach (LandObject p in landOwnersAndParcels[owner]) |
696 | { | 696 | { |
697 | simArea += p.landData.Area; | 697 | simArea += p.LandData.Area; |
698 | simPrims += p.landData.OwnerPrims + p.landData.OtherPrims + p.landData.GroupPrims + | 698 | simPrims += p.LandData.OwnerPrims + p.LandData.OtherPrims + p.LandData.GroupPrims + |
699 | p.landData.SelectedPrims; | 699 | p.LandData.SelectedPrims; |
700 | } | 700 | } |
701 | 701 | ||
702 | foreach (LandObject p in landOwnersAndParcels[owner]) | 702 | foreach (LandObject p in landOwnersAndParcels[owner]) |
703 | { | 703 | { |
704 | p.landData.SimwideArea = simArea; | 704 | p.LandData.SimwideArea = simArea; |
705 | p.landData.SimwidePrims = simPrims; | 705 | p.LandData.SimwidePrims = simPrims; |
706 | } | 706 | } |
707 | } | 707 | } |
708 | } | 708 | } |
@@ -779,26 +779,26 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
779 | 779 | ||
780 | //Lets create a new land object with bitmap activated at that point (keeping the old land objects info) | 780 | //Lets create a new land object with bitmap activated at that point (keeping the old land objects info) |
781 | ILandObject newLand = startLandObject.Copy(); | 781 | ILandObject newLand = startLandObject.Copy(); |
782 | newLand.landData.Name = newLand.landData.Name; | 782 | newLand.LandData.Name = newLand.LandData.Name; |
783 | newLand.landData.GlobalID = UUID.Random(); | 783 | newLand.LandData.GlobalID = UUID.Random(); |
784 | 784 | ||
785 | newLand.setLandBitmap(newLand.getSquareLandBitmap(start_x, start_y, end_x, end_y)); | 785 | newLand.SetLandBitmap(newLand.GetSquareLandBitmap(start_x, start_y, end_x, end_y)); |
786 | 786 | ||
787 | //Now, lets set the subdivision area of the original to false | 787 | //Now, lets set the subdivision area of the original to false |
788 | int startLandObjectIndex = startLandObject.landData.LocalID; | 788 | int startLandObjectIndex = startLandObject.LandData.LocalID; |
789 | lock (m_landList) | 789 | lock (m_landList) |
790 | { | 790 | { |
791 | m_landList[startLandObjectIndex].setLandBitmap( | 791 | m_landList[startLandObjectIndex].SetLandBitmap( |
792 | newLand.modifyLandBitmapSquare(startLandObject.getLandBitmap(), start_x, start_y, end_x, end_y, false)); | 792 | newLand.ModifyLandBitmapSquare(startLandObject.GetLandBitmap(), start_x, start_y, end_x, end_y, false)); |
793 | m_landList[startLandObjectIndex].forceUpdateLandInfo(); | 793 | m_landList[startLandObjectIndex].ForceUpdateLandInfo(); |
794 | } | 794 | } |
795 | 795 | ||
796 | EventManagerOnParcelPrimCountTainted(); | 796 | EventManagerOnParcelPrimCountTainted(); |
797 | 797 | ||
798 | //Now add the new land object | 798 | //Now add the new land object |
799 | ILandObject result = AddLandObject(newLand); | 799 | ILandObject result = AddLandObject(newLand); |
800 | UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); | 800 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); |
801 | result.sendLandUpdateToAvatarsOverMe(); | 801 | result.SendLandUpdateToAvatarsOverMe(); |
802 | } | 802 | } |
803 | 803 | ||
804 | /// <summary> | 804 | /// <summary> |
@@ -846,7 +846,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
846 | } | 846 | } |
847 | foreach (ILandObject p in selectedLandObjects) | 847 | foreach (ILandObject p in selectedLandObjects) |
848 | { | 848 | { |
849 | if (p.landData.OwnerID != masterLandObject.landData.OwnerID) | 849 | if (p.LandData.OwnerID != masterLandObject.LandData.OwnerID) |
850 | { | 850 | { |
851 | return; | 851 | return; |
852 | } | 852 | } |
@@ -856,14 +856,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
856 | { | 856 | { |
857 | foreach (ILandObject slaveLandObject in selectedLandObjects) | 857 | foreach (ILandObject slaveLandObject in selectedLandObjects) |
858 | { | 858 | { |
859 | m_landList[masterLandObject.landData.LocalID].setLandBitmap( | 859 | m_landList[masterLandObject.LandData.LocalID].SetLandBitmap( |
860 | slaveLandObject.mergeLandBitmaps(masterLandObject.getLandBitmap(), slaveLandObject.getLandBitmap())); | 860 | slaveLandObject.MergeLandBitmaps(masterLandObject.GetLandBitmap(), slaveLandObject.GetLandBitmap())); |
861 | performFinalLandJoin(masterLandObject, slaveLandObject); | 861 | performFinalLandJoin(masterLandObject, slaveLandObject); |
862 | } | 862 | } |
863 | } | 863 | } |
864 | EventManagerOnParcelPrimCountTainted(); | 864 | EventManagerOnParcelPrimCountTainted(); |
865 | 865 | ||
866 | masterLandObject.sendLandUpdateToAvatarsOverMe(); | 866 | masterLandObject.SendLandUpdateToAvatarsOverMe(); |
867 | } | 867 | } |
868 | 868 | ||
869 | #endregion | 869 | #endregion |
@@ -894,19 +894,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
894 | 894 | ||
895 | if (currentParcelBlock != null) | 895 | if (currentParcelBlock != null) |
896 | { | 896 | { |
897 | if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) | 897 | if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) |
898 | { | 898 | { |
899 | //Owner Flag | 899 | //Owner Flag |
900 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); | 900 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); |
901 | } | 901 | } |
902 | else if (currentParcelBlock.landData.SalePrice > 0 && | 902 | else if (currentParcelBlock.LandData.SalePrice > 0 && |
903 | (currentParcelBlock.landData.AuthBuyerID == UUID.Zero || | 903 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || |
904 | currentParcelBlock.landData.AuthBuyerID == remote_client.AgentId)) | 904 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) |
905 | { | 905 | { |
906 | //Sale Flag | 906 | //Sale Flag |
907 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE); | 907 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE); |
908 | } | 908 | } |
909 | else if (currentParcelBlock.landData.OwnerID == UUID.Zero) | 909 | else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) |
910 | { | 910 | { |
911 | //Public Flag | 911 | //Public Flag |
912 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC); | 912 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC); |
@@ -980,7 +980,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
980 | { | 980 | { |
981 | if (!temp.Contains(currentParcel)) | 981 | if (!temp.Contains(currentParcel)) |
982 | { | 982 | { |
983 | currentParcel.forceUpdateLandInfo(); | 983 | currentParcel.ForceUpdateLandInfo(); |
984 | temp.Add(currentParcel); | 984 | temp.Add(currentParcel); |
985 | } | 985 | } |
986 | } | 986 | } |
@@ -996,7 +996,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
996 | 996 | ||
997 | for (int i = 0; i < temp.Count; i++) | 997 | for (int i = 0; i < temp.Count; i++) |
998 | { | 998 | { |
999 | temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); | 999 | temp[i].SendLandProperties(sequence_id, snap_selection, requestResult, remote_client); |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | SendParcelOverlay(remote_client); | 1002 | SendParcelOverlay(remote_client); |
@@ -1010,7 +1010,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1010 | m_landList.TryGetValue(localID, out land); | 1010 | m_landList.TryGetValue(localID, out land); |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | if (land != null) land.updateLandProperties(args, remote_client); | 1013 | if (land != null) land.UpdateLandProperties(args, remote_client); |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) | 1016 | public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) |
@@ -1026,7 +1026,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1026 | public void ClientOnParcelSelectObjects(int local_id, int request_type, | 1026 | public void ClientOnParcelSelectObjects(int local_id, int request_type, |
1027 | List<UUID> returnIDs, IClientAPI remote_client) | 1027 | List<UUID> returnIDs, IClientAPI remote_client) |
1028 | { | 1028 | { |
1029 | m_landList[local_id].sendForceObjectSelect(local_id, request_type, returnIDs, remote_client); | 1029 | m_landList[local_id].SendForceObjectSelect(local_id, request_type, returnIDs, remote_client); |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | public void ClientOnParcelObjectOwnerRequest(int local_id, IClientAPI remote_client) | 1032 | public void ClientOnParcelObjectOwnerRequest(int local_id, IClientAPI remote_client) |
@@ -1039,7 +1039,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1039 | 1039 | ||
1040 | if (land != null) | 1040 | if (land != null) |
1041 | { | 1041 | { |
1042 | m_landList[local_id].sendLandObjectOwners(remote_client); | 1042 | m_landList[local_id].SendLandObjectOwners(remote_client); |
1043 | } | 1043 | } |
1044 | else | 1044 | else |
1045 | { | 1045 | { |
@@ -1059,10 +1059,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1059 | { | 1059 | { |
1060 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) | 1060 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) |
1061 | { | 1061 | { |
1062 | land.landData.OwnerID = ownerID; | 1062 | land.LandData.OwnerID = ownerID; |
1063 | 1063 | ||
1064 | m_scene.Broadcast(SendParcelOverlay); | 1064 | m_scene.Broadcast(SendParcelOverlay); |
1065 | land.sendLandUpdateToClient(remote_client); | 1065 | land.SendLandUpdateToClient(remote_client); |
1066 | } | 1066 | } |
1067 | } | 1067 | } |
1068 | } | 1068 | } |
@@ -1080,11 +1080,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1080 | if (m_scene.Permissions.CanAbandonParcel(remote_client.AgentId, land)) | 1080 | if (m_scene.Permissions.CanAbandonParcel(remote_client.AgentId, land)) |
1081 | { | 1081 | { |
1082 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 1082 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) |
1083 | land.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 1083 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
1084 | else | 1084 | else |
1085 | land.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 1085 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
1086 | m_scene.Broadcast(SendParcelOverlay); | 1086 | m_scene.Broadcast(SendParcelOverlay); |
1087 | land.sendLandUpdateToClient(remote_client); | 1087 | land.SendLandUpdateToClient(remote_client); |
1088 | } | 1088 | } |
1089 | } | 1089 | } |
1090 | } | 1090 | } |
@@ -1102,13 +1102,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1102 | if (m_scene.Permissions.CanReclaimParcel(remote_client.AgentId, land)) | 1102 | if (m_scene.Permissions.CanReclaimParcel(remote_client.AgentId, land)) |
1103 | { | 1103 | { |
1104 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 1104 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) |
1105 | land.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 1105 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
1106 | else | 1106 | else |
1107 | land.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 1107 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
1108 | land.landData.ClaimDate = Util.UnixTimeSinceEpoch(); | 1108 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
1109 | land.landData.IsGroupOwned = false; | 1109 | land.LandData.IsGroupOwned = false; |
1110 | m_scene.Broadcast(SendParcelOverlay); | 1110 | m_scene.Broadcast(SendParcelOverlay); |
1111 | land.sendLandUpdateToClient(remote_client); | 1111 | land.SendLandUpdateToClient(remote_client); |
1112 | } | 1112 | } |
1113 | } | 1113 | } |
1114 | } | 1114 | } |
@@ -1130,7 +1130,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1130 | 1130 | ||
1131 | if (land != null) | 1131 | if (land != null) |
1132 | { | 1132 | { |
1133 | land.updateLandSold(e.agentId, e.groupId, e.groupOwned, (uint)e.transactionID, e.parcelPrice, e.parcelArea); | 1133 | land.UpdateLandSold(e.agentId, e.groupId, e.groupOwned, (uint)e.transactionID, e.parcelPrice, e.parcelArea); |
1134 | } | 1134 | } |
1135 | } | 1135 | } |
1136 | } | 1136 | } |
@@ -1151,11 +1151,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1151 | 1151 | ||
1152 | if (lob != null) | 1152 | if (lob != null) |
1153 | { | 1153 | { |
1154 | UUID AuthorizedID = lob.landData.AuthBuyerID; | 1154 | UUID AuthorizedID = lob.LandData.AuthBuyerID; |
1155 | int saleprice = lob.landData.SalePrice; | 1155 | int saleprice = lob.LandData.SalePrice; |
1156 | UUID pOwnerID = lob.landData.OwnerID; | 1156 | UUID pOwnerID = lob.LandData.OwnerID; |
1157 | 1157 | ||
1158 | bool landforsale = ((lob.landData.Flags & | 1158 | bool landforsale = ((lob.LandData.Flags & |
1159 | (uint)(ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects)) != 0); | 1159 | (uint)(ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects)) != 0); |
1160 | if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) | 1160 | if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) |
1161 | { | 1161 | { |
@@ -1184,7 +1184,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1184 | 1184 | ||
1185 | if (land != null) | 1185 | if (land != null) |
1186 | { | 1186 | { |
1187 | land.deedToGroup(groupID); | 1187 | land.DeedToGroup(groupID); |
1188 | } | 1188 | } |
1189 | 1189 | ||
1190 | } | 1190 | } |
@@ -1203,8 +1203,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1203 | public void IncomingLandObjectFromStorage(LandData data) | 1203 | public void IncomingLandObjectFromStorage(LandData data) |
1204 | { | 1204 | { |
1205 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); | 1205 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); |
1206 | new_land.landData = data.Copy(); | 1206 | new_land.LandData = data.Copy(); |
1207 | new_land.setLandBitmapFromByteArray(); | 1207 | new_land.SetLandBitmapFromByteArray(); |
1208 | AddLandObject(new_land); | 1208 | AddLandObject(new_land); |
1209 | } | 1209 | } |
1210 | 1210 | ||
@@ -1218,7 +1218,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1218 | 1218 | ||
1219 | if (selectedParcel == null) return; | 1219 | if (selectedParcel == null) return; |
1220 | 1220 | ||
1221 | selectedParcel.returnLandObjects(returnType, agentIDs, taskIDs, remoteClient); | 1221 | selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); |
1222 | } | 1222 | } |
1223 | 1223 | ||
1224 | public void EventManagerOnNoLandDataFromStorage() | 1224 | public void EventManagerOnNoLandDataFromStorage() |
@@ -1234,7 +1234,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1234 | { | 1234 | { |
1235 | foreach (LandObject obj in m_landList.Values) | 1235 | foreach (LandObject obj in m_landList.Values) |
1236 | { | 1236 | { |
1237 | obj.setParcelObjectMaxOverride(overrideDel); | 1237 | obj.SetParcelObjectMaxOverride(overrideDel); |
1238 | } | 1238 | } |
1239 | } | 1239 | } |
1240 | } | 1240 | } |
@@ -1337,7 +1337,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1337 | return; | 1337 | return; |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | remoteClient.SendParcelDwellReply(localID, selectedParcel.landData.GlobalID, selectedParcel.landData.Dwell); | 1340 | remoteClient.SendParcelDwellReply(localID, selectedParcel.LandData.GlobalID, selectedParcel.LandData.Dwell); |
1341 | } | 1341 | } |
1342 | 1342 | ||
1343 | private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID) | 1343 | private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID) |
@@ -1345,39 +1345,43 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1345 | if (parcelID == UUID.Zero) | 1345 | if (parcelID == UUID.Zero) |
1346 | return; | 1346 | return; |
1347 | 1347 | ||
1348 | ExtendedLandData data = (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), delegate(string id) { | 1348 | ExtendedLandData data = |
1349 | UUID parcel = UUID.Zero; | 1349 | (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), |
1350 | UUID.TryParse(id, out parcel); | 1350 | delegate(string id) |
1351 | // assume we've got the parcelID we just computed in RemoteParcelRequest | 1351 | { |
1352 | ExtendedLandData extLandData = new ExtendedLandData(); | 1352 | UUID parcel = UUID.Zero; |
1353 | Util.ParseFakeParcelID(parcel, out extLandData.regionHandle, out extLandData.x, out extLandData.y); | 1353 | UUID.TryParse(id, out parcel); |
1354 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", | 1354 | // assume we've got the parcelID we just computed in RemoteParcelRequest |
1355 | extLandData.regionHandle, extLandData.x, extLandData.y); | 1355 | ExtendedLandData extLandData = new ExtendedLandData(); |
1356 | 1356 | Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, | |
1357 | // for this region or for somewhere else? | 1357 | out extLandData.X, out extLandData.Y); |
1358 | if (extLandData.regionHandle == m_scene.RegionInfo.RegionHandle) | 1358 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", |
1359 | { | 1359 | extLandData.RegionHandle, extLandData.X, extLandData.Y); |
1360 | extLandData.landData = this.GetLandObject(extLandData.x, extLandData.y).landData; | 1360 | |
1361 | } | 1361 | // for this region or for somewhere else? |
1362 | else | 1362 | if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) |
1363 | { | 1363 | { |
1364 | ILandService landService = m_scene.RequestModuleInterface<ILandService>(); | 1364 | extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; |
1365 | extLandData.landData = landService.GetLandData(extLandData.regionHandle, | 1365 | } |
1366 | extLandData.x, | 1366 | else |
1367 | extLandData.y); | 1367 | { |
1368 | if (extLandData.landData == null) | 1368 | ILandService landService = m_scene.RequestModuleInterface<ILandService>(); |
1369 | { | 1369 | extLandData.LandData = landService.GetLandData(extLandData.RegionHandle, |
1370 | // we didn't find the region/land => don't cache | 1370 | extLandData.X, |
1371 | return null; | 1371 | extLandData.Y); |
1372 | } | 1372 | if (extLandData.LandData == null) |
1373 | } | 1373 | { |
1374 | return extLandData; | 1374 | // we didn't find the region/land => don't cache |
1375 | }); | 1375 | return null; |
1376 | } | ||
1377 | } | ||
1378 | return extLandData; | ||
1379 | }); | ||
1376 | 1380 | ||
1377 | if (data != null) // if we found some data, send it | 1381 | if (data != null) // if we found some data, send it |
1378 | { | 1382 | { |
1379 | GridRegion info; | 1383 | GridRegion info; |
1380 | if (data.regionHandle == m_scene.RegionInfo.RegionHandle) | 1384 | if (data.RegionHandle == m_scene.RegionInfo.RegionHandle) |
1381 | { | 1385 | { |
1382 | info = new GridRegion(m_scene.RegionInfo); | 1386 | info = new GridRegion(m_scene.RegionInfo); |
1383 | } | 1387 | } |
@@ -1385,18 +1389,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1385 | { | 1389 | { |
1386 | // most likely still cached from building the extLandData entry | 1390 | // most likely still cached from building the extLandData entry |
1387 | uint x = 0, y = 0; | 1391 | uint x = 0, y = 0; |
1388 | Utils.LongToUInts(data.regionHandle, out x, out y); | 1392 | Utils.LongToUInts(data.RegionHandle, out x, out y); |
1389 | info = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | 1393 | info = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); |
1390 | } | 1394 | } |
1391 | // we need to transfer the fake parcelID, not the one in landData, so the viewer can match it to the landmark. | 1395 | // we need to transfer the fake parcelID, not the one in landData, so the viewer can match it to the landmark. |
1392 | m_log.DebugFormat("[LAND] got parcelinfo for parcel {0} in region {1}; sending...", | 1396 | m_log.DebugFormat("[LAND] got parcelinfo for parcel {0} in region {1}; sending...", |
1393 | data.landData.Name, data.regionHandle); | 1397 | data.LandData.Name, data.RegionHandle); |
1394 | // HACK for now | 1398 | // HACK for now |
1395 | RegionInfo r = new RegionInfo(); | 1399 | RegionInfo r = new RegionInfo(); |
1396 | r.RegionName = info.RegionName; | 1400 | r.RegionName = info.RegionName; |
1397 | r.RegionLocX = (uint)info.RegionLocX; | 1401 | r.RegionLocX = (uint)info.RegionLocX; |
1398 | r.RegionLocY = (uint)info.RegionLocY; | 1402 | r.RegionLocY = (uint)info.RegionLocY; |
1399 | remoteClient.SendParcelInfo(r, data.landData, parcelID, data.x, data.y); | 1403 | remoteClient.SendParcelInfo(r, data.LandData, parcelID, data.X, data.Y); |
1400 | } | 1404 | } |
1401 | else | 1405 | else |
1402 | m_log.Debug("[LAND] got no parcelinfo; not sending"); | 1406 | m_log.Debug("[LAND] got no parcelinfo; not sending"); |
@@ -1415,9 +1419,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1415 | if (!m_scene.Permissions.CanEditParcel(remoteClient.AgentId, land)) | 1419 | if (!m_scene.Permissions.CanEditParcel(remoteClient.AgentId, land)) |
1416 | return; | 1420 | return; |
1417 | 1421 | ||
1418 | land.landData.OtherCleanTime = otherCleanTime; | 1422 | land.LandData.OtherCleanTime = otherCleanTime; |
1419 | 1423 | ||
1420 | UpdateLandObject(localID, land.landData); | 1424 | UpdateLandObject(localID, land.LandData); |
1421 | } | 1425 | } |
1422 | } | 1426 | } |
1423 | } | 1427 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 3be5f45..b9b7da5 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
53 | protected Scene m_scene; | 53 | protected Scene m_scene; |
54 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); | 54 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); |
55 | 55 | ||
56 | public bool[,] landBitmap | 56 | public bool[,] LandBitmap |
57 | { | 57 | { |
58 | get { return m_landBitmap; } | 58 | get { return m_landBitmap; } |
59 | set { m_landBitmap = value; } | 59 | set { m_landBitmap = value; } |
@@ -63,14 +63,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
63 | 63 | ||
64 | #region ILandObject Members | 64 | #region ILandObject Members |
65 | 65 | ||
66 | public LandData landData | 66 | public LandData LandData |
67 | { | 67 | { |
68 | get { return m_landData; } | 68 | get { return m_landData; } |
69 | 69 | ||
70 | set { m_landData = value; } | 70 | set { m_landData = value; } |
71 | } | 71 | } |
72 | 72 | ||
73 | public UUID regionUUID | 73 | public UUID RegionUUID |
74 | { | 74 | { |
75 | get { return m_scene.RegionInfo.RegionID; } | 75 | get { return m_scene.RegionInfo.RegionID; } |
76 | } | 76 | } |
@@ -80,8 +80,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
80 | public LandObject(UUID owner_id, bool is_group_owned, Scene scene) | 80 | public LandObject(UUID owner_id, bool is_group_owned, Scene scene) |
81 | { | 81 | { |
82 | m_scene = scene; | 82 | m_scene = scene; |
83 | landData.OwnerID = owner_id; | 83 | LandData.OwnerID = owner_id; |
84 | landData.IsGroupOwned = is_group_owned; | 84 | LandData.IsGroupOwned = is_group_owned; |
85 | } | 85 | } |
86 | 86 | ||
87 | #endregion | 87 | #endregion |
@@ -96,11 +96,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
96 | /// <param name="x"></param> | 96 | /// <param name="x"></param> |
97 | /// <param name="y"></param> | 97 | /// <param name="y"></param> |
98 | /// <returns>Returns true if the piece of land contains the specified point</returns> | 98 | /// <returns>Returns true if the piece of land contains the specified point</returns> |
99 | public bool containsPoint(int x, int y) | 99 | public bool ContainsPoint(int x, int y) |
100 | { | 100 | { |
101 | if (x >= 0 && y >= 0 && x <= Constants.RegionSize && x <= Constants.RegionSize) | 101 | if (x >= 0 && y >= 0 && x <= Constants.RegionSize && x <= Constants.RegionSize) |
102 | { | 102 | { |
103 | return (landBitmap[x / 4, y / 4] == true); | 103 | return (LandBitmap[x / 4, y / 4] == true); |
104 | } | 104 | } |
105 | else | 105 | else |
106 | { | 106 | { |
@@ -110,11 +110,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
110 | 110 | ||
111 | public ILandObject Copy() | 111 | public ILandObject Copy() |
112 | { | 112 | { |
113 | ILandObject newLand = new LandObject(landData.OwnerID, landData.IsGroupOwned, m_scene); | 113 | ILandObject newLand = new LandObject(LandData.OwnerID, LandData.IsGroupOwned, m_scene); |
114 | 114 | ||
115 | //Place all new variables here! | 115 | //Place all new variables here! |
116 | newLand.landBitmap = (bool[,]) (landBitmap.Clone()); | 116 | newLand.LandBitmap = (bool[,]) (LandBitmap.Clone()); |
117 | newLand.landData = landData.Copy(); | 117 | newLand.LandData = LandData.Copy(); |
118 | 118 | ||
119 | return newLand; | 119 | return newLand; |
120 | } | 120 | } |
@@ -122,16 +122,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
122 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; | 122 | static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; |
123 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; | 123 | static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; |
124 | 124 | ||
125 | public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) | 125 | public void SetParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) |
126 | { | 126 | { |
127 | overrideParcelMaxPrimCount = overrideDel; | 127 | overrideParcelMaxPrimCount = overrideDel; |
128 | } | 128 | } |
129 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) | 129 | public void SetSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) |
130 | { | 130 | { |
131 | overrideSimulatorMaxPrimCount = overrideDel; | 131 | overrideSimulatorMaxPrimCount = overrideDel; |
132 | } | 132 | } |
133 | 133 | ||
134 | public int getParcelMaxPrimCount(ILandObject thisObject) | 134 | public int GetParcelMaxPrimCount(ILandObject thisObject) |
135 | { | 135 | { |
136 | if (overrideParcelMaxPrimCount != null) | 136 | if (overrideParcelMaxPrimCount != null) |
137 | { | 137 | { |
@@ -141,11 +141,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
141 | { | 141 | { |
142 | //Normal Calculations | 142 | //Normal Calculations |
143 | return Convert.ToInt32( | 143 | return Convert.ToInt32( |
144 | Math.Round((Convert.ToDecimal(landData.Area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity * | 144 | Math.Round((Convert.ToDecimal(LandData.Area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity * |
145 | Convert.ToDecimal(m_scene.RegionInfo.RegionSettings.ObjectBonus))); ; | 145 | Convert.ToDecimal(m_scene.RegionInfo.RegionSettings.ObjectBonus))); ; |
146 | } | 146 | } |
147 | } | 147 | } |
148 | public int getSimulatorMaxPrimCount(ILandObject thisObject) | 148 | public int GetSimulatorMaxPrimCount(ILandObject thisObject) |
149 | { | 149 | { |
150 | if (overrideSimulatorMaxPrimCount != null) | 150 | if (overrideSimulatorMaxPrimCount != null) |
151 | { | 151 | { |
@@ -161,7 +161,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
161 | 161 | ||
162 | #region Packet Request Handling | 162 | #region Packet Request Handling |
163 | 163 | ||
164 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) | 164 | public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) |
165 | { | 165 | { |
166 | IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); | 166 | IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); |
167 | uint regionFlags = 336723974 & ~((uint)(RegionFlags.AllowLandmark | RegionFlags.AllowSetHome)); | 167 | uint regionFlags = 336723974 & ~((uint)(RegionFlags.AllowLandmark | RegionFlags.AllowSetHome)); |
@@ -175,18 +175,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
175 | // if (landData.OwnerID == remote_client.AgentId) | 175 | // if (landData.OwnerID == remote_client.AgentId) |
176 | // regionFlags |= (uint)RegionFlags.AllowSetHome; | 176 | // regionFlags |= (uint)RegionFlags.AllowSetHome; |
177 | remote_client.SendLandProperties(sequence_id, | 177 | remote_client.SendLandProperties(sequence_id, |
178 | snap_selection, request_result, landData, | 178 | snap_selection, request_result, LandData, |
179 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, | 179 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, |
180 | getParcelMaxPrimCount(this), | 180 | GetParcelMaxPrimCount(this), |
181 | getSimulatorMaxPrimCount(this), regionFlags); | 181 | GetSimulatorMaxPrimCount(this), regionFlags); |
182 | } | 182 | } |
183 | 183 | ||
184 | public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) | 184 | public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) |
185 | { | 185 | { |
186 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) | 186 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) |
187 | { | 187 | { |
188 | //Needs later group support | 188 | //Needs later group support |
189 | LandData newData = landData.Copy(); | 189 | LandData newData = LandData.Copy(); |
190 | 190 | ||
191 | if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) | 191 | if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) |
192 | { | 192 | { |
@@ -212,15 +212,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
212 | newData.UserLocation = args.UserLocation; | 212 | newData.UserLocation = args.UserLocation; |
213 | newData.UserLookAt = args.UserLookAt; | 213 | newData.UserLookAt = args.UserLookAt; |
214 | 214 | ||
215 | m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); | 215 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
216 | 216 | ||
217 | sendLandUpdateToAvatarsOverMe(); | 217 | SendLandUpdateToAvatarsOverMe(); |
218 | } | 218 | } |
219 | } | 219 | } |
220 | 220 | ||
221 | public void updateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) | 221 | public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) |
222 | { | 222 | { |
223 | LandData newData = landData.Copy(); | 223 | LandData newData = LandData.Copy(); |
224 | newData.OwnerID = avatarID; | 224 | newData.OwnerID = avatarID; |
225 | newData.GroupID = groupID; | 225 | newData.GroupID = groupID; |
226 | newData.IsGroupOwned = groupOwned; | 226 | newData.IsGroupOwned = groupOwned; |
@@ -230,45 +230,45 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
230 | newData.SalePrice = 0; | 230 | newData.SalePrice = 0; |
231 | newData.AuthBuyerID = UUID.Zero; | 231 | newData.AuthBuyerID = UUID.Zero; |
232 | newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); | 232 | newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); |
233 | m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); | 233 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
234 | 234 | ||
235 | sendLandUpdateToAvatarsOverMe(); | 235 | SendLandUpdateToAvatarsOverMe(); |
236 | } | 236 | } |
237 | 237 | ||
238 | public void deedToGroup(UUID groupID) | 238 | public void DeedToGroup(UUID groupID) |
239 | { | 239 | { |
240 | LandData newData = landData.Copy(); | 240 | LandData newData = LandData.Copy(); |
241 | newData.OwnerID = groupID; | 241 | newData.OwnerID = groupID; |
242 | newData.GroupID = groupID; | 242 | newData.GroupID = groupID; |
243 | newData.IsGroupOwned = true; | 243 | newData.IsGroupOwned = true; |
244 | 244 | ||
245 | m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); | 245 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
246 | 246 | ||
247 | sendLandUpdateToAvatarsOverMe(); | 247 | SendLandUpdateToAvatarsOverMe(); |
248 | } | 248 | } |
249 | 249 | ||
250 | public bool isEitherBannedOrRestricted(UUID avatar) | 250 | public bool IsEitherBannedOrRestricted(UUID avatar) |
251 | { | 251 | { |
252 | if (isBannedFromLand(avatar)) | 252 | if (IsBannedFromLand(avatar)) |
253 | { | 253 | { |
254 | return true; | 254 | return true; |
255 | } | 255 | } |
256 | else if (isRestrictedFromLand(avatar)) | 256 | else if (IsRestrictedFromLand(avatar)) |
257 | { | 257 | { |
258 | return true; | 258 | return true; |
259 | } | 259 | } |
260 | return false; | 260 | return false; |
261 | } | 261 | } |
262 | 262 | ||
263 | public bool isBannedFromLand(UUID avatar) | 263 | public bool IsBannedFromLand(UUID avatar) |
264 | { | 264 | { |
265 | if ((landData.Flags & (uint) ParcelFlags.UseBanList) > 0) | 265 | if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) |
266 | { | 266 | { |
267 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 267 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
268 | entry.AgentID = avatar; | 268 | entry.AgentID = avatar; |
269 | entry.Flags = AccessList.Ban; | 269 | entry.Flags = AccessList.Ban; |
270 | entry.Time = new DateTime(); | 270 | entry.Time = new DateTime(); |
271 | if (landData.ParcelAccessList.Contains(entry)) | 271 | if (LandData.ParcelAccessList.Contains(entry)) |
272 | { | 272 | { |
273 | //They are banned, so lets send them a notice about this parcel | 273 | //They are banned, so lets send them a notice about this parcel |
274 | return true; | 274 | return true; |
@@ -277,15 +277,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
277 | return false; | 277 | return false; |
278 | } | 278 | } |
279 | 279 | ||
280 | public bool isRestrictedFromLand(UUID avatar) | 280 | public bool IsRestrictedFromLand(UUID avatar) |
281 | { | 281 | { |
282 | if ((landData.Flags & (uint) ParcelFlags.UseAccessList) > 0) | 282 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) |
283 | { | 283 | { |
284 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 284 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
285 | entry.AgentID = avatar; | 285 | entry.AgentID = avatar; |
286 | entry.Flags = AccessList.Access; | 286 | entry.Flags = AccessList.Access; |
287 | entry.Time = new DateTime(); | 287 | entry.Time = new DateTime(); |
288 | if (!landData.ParcelAccessList.Contains(entry)) | 288 | if (!LandData.ParcelAccessList.Contains(entry)) |
289 | { | 289 | { |
290 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel | 290 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel |
291 | return true; | 291 | return true; |
@@ -294,12 +294,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
294 | return false; | 294 | return false; |
295 | } | 295 | } |
296 | 296 | ||
297 | public void sendLandUpdateToClient(IClientAPI remote_client) | 297 | public void SendLandUpdateToClient(IClientAPI remote_client) |
298 | { | 298 | { |
299 | sendLandProperties(0, false, 0, remote_client); | 299 | SendLandProperties(0, false, 0, remote_client); |
300 | } | 300 | } |
301 | 301 | ||
302 | public void sendLandUpdateToAvatarsOverMe() | 302 | public void SendLandUpdateToAvatarsOverMe() |
303 | { | 303 | { |
304 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 304 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
305 | ILandObject over = null; | 305 | ILandObject over = null; |
@@ -319,14 +319,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
319 | 319 | ||
320 | if (over != null) | 320 | if (over != null) |
321 | { | 321 | { |
322 | if (over.landData.LocalID == landData.LocalID) | 322 | if (over.LandData.LocalID == LandData.LocalID) |
323 | { | 323 | { |
324 | if (((over.landData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && m_scene.RegionInfo.RegionSettings.AllowDamage) | 324 | if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && |
325 | m_scene.RegionInfo.RegionSettings.AllowDamage) | ||
325 | avatars[i].Invulnerable = false; | 326 | avatars[i].Invulnerable = false; |
326 | else | 327 | else |
327 | avatars[i].Invulnerable = true; | 328 | avatars[i].Invulnerable = true; |
328 | 329 | ||
329 | sendLandUpdateToClient(avatars[i].ControllingClient); | 330 | SendLandUpdateToClient(avatars[i].ControllingClient); |
330 | } | 331 | } |
331 | } | 332 | } |
332 | } | 333 | } |
@@ -336,10 +337,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
336 | 337 | ||
337 | #region AccessList Functions | 338 | #region AccessList Functions |
338 | 339 | ||
339 | public List<UUID> createAccessListArrayByFlag(AccessList flag) | 340 | public List<UUID> CreateAccessListArrayByFlag(AccessList flag) |
340 | { | 341 | { |
341 | List<UUID> list = new List<UUID>(); | 342 | List<UUID> list = new List<UUID>(); |
342 | foreach (ParcelManager.ParcelAccessEntry entry in landData.ParcelAccessList) | 343 | foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList) |
343 | { | 344 | { |
344 | if (entry.Flags == flag) | 345 | if (entry.Flags == flag) |
345 | { | 346 | { |
@@ -354,26 +355,26 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
354 | return list; | 355 | return list; |
355 | } | 356 | } |
356 | 357 | ||
357 | public void sendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, | 358 | public void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, |
358 | IClientAPI remote_client) | 359 | IClientAPI remote_client) |
359 | { | 360 | { |
360 | 361 | ||
361 | if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both) | 362 | if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both) |
362 | { | 363 | { |
363 | List<UUID> avatars = createAccessListArrayByFlag(AccessList.Access); | 364 | List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Access); |
364 | remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,landData.LocalID); | 365 | remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,LandData.LocalID); |
365 | } | 366 | } |
366 | 367 | ||
367 | if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both) | 368 | if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both) |
368 | { | 369 | { |
369 | List<UUID> avatars = createAccessListArrayByFlag(AccessList.Ban); | 370 | List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Ban); |
370 | remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, landData.LocalID); | 371 | remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, LandData.LocalID); |
371 | } | 372 | } |
372 | } | 373 | } |
373 | 374 | ||
374 | public void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) | 375 | public void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) |
375 | { | 376 | { |
376 | LandData newData = landData.Copy(); | 377 | LandData newData = LandData.Copy(); |
377 | 378 | ||
378 | if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) | 379 | if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) |
379 | { | 380 | { |
@@ -406,36 +407,36 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
406 | } | 407 | } |
407 | } | 408 | } |
408 | 409 | ||
409 | m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); | 410 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
410 | } | 411 | } |
411 | 412 | ||
412 | #endregion | 413 | #endregion |
413 | 414 | ||
414 | #region Update Functions | 415 | #region Update Functions |
415 | 416 | ||
416 | public void updateLandBitmapByteArray() | 417 | public void UpdateLandBitmapByteArray() |
417 | { | 418 | { |
418 | landData.Bitmap = convertLandBitmapToBytes(); | 419 | LandData.Bitmap = ConvertLandBitmapToBytes(); |
419 | } | 420 | } |
420 | 421 | ||
421 | /// <summary> | 422 | /// <summary> |
422 | /// Update all settings in land such as area, bitmap byte array, etc | 423 | /// Update all settings in land such as area, bitmap byte array, etc |
423 | /// </summary> | 424 | /// </summary> |
424 | public void forceUpdateLandInfo() | 425 | public void ForceUpdateLandInfo() |
425 | { | 426 | { |
426 | updateAABBAndAreaValues(); | 427 | UpdateAABBAndAreaValues(); |
427 | updateLandBitmapByteArray(); | 428 | UpdateLandBitmapByteArray(); |
428 | } | 429 | } |
429 | 430 | ||
430 | public void setLandBitmapFromByteArray() | 431 | public void SetLandBitmapFromByteArray() |
431 | { | 432 | { |
432 | landBitmap = convertBytesToLandBitmap(); | 433 | LandBitmap = ConvertBytesToLandBitmap(); |
433 | } | 434 | } |
434 | 435 | ||
435 | /// <summary> | 436 | /// <summary> |
436 | /// Updates the AABBMin and AABBMax values after area/shape modification of the land object | 437 | /// Updates the AABBMin and AABBMax values after area/shape modification of the land object |
437 | /// </summary> | 438 | /// </summary> |
438 | private void updateAABBAndAreaValues() | 439 | private void UpdateAABBAndAreaValues() |
439 | { | 440 | { |
440 | int min_x = 64; | 441 | int min_x = 64; |
441 | int min_y = 64; | 442 | int min_y = 64; |
@@ -447,7 +448,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
447 | { | 448 | { |
448 | for (y = 0; y < 64; y++) | 449 | for (y = 0; y < 64; y++) |
449 | { | 450 | { |
450 | if (landBitmap[x, y] == true) | 451 | if (LandBitmap[x, y] == true) |
451 | { | 452 | { |
452 | if (min_x > x) min_x = x; | 453 | if (min_x > x) min_x = x; |
453 | if (min_y > y) min_y = y; | 454 | if (min_y > y) min_y = y; |
@@ -463,7 +464,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
463 | int ty = min_y * 4; | 464 | int ty = min_y * 4; |
464 | if (ty > ((int)Constants.RegionSize - 1)) | 465 | if (ty > ((int)Constants.RegionSize - 1)) |
465 | ty = ((int)Constants.RegionSize - 1); | 466 | ty = ((int)Constants.RegionSize - 1); |
466 | landData.AABBMin = | 467 | LandData.AABBMin = |
467 | new Vector3((float) (min_x * 4), (float) (min_y * 4), | 468 | new Vector3((float) (min_x * 4), (float) (min_y * 4), |
468 | (float) m_scene.Heightmap[tx, ty]); | 469 | (float) m_scene.Heightmap[tx, ty]); |
469 | 470 | ||
@@ -473,10 +474,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
473 | ty = max_y * 4; | 474 | ty = max_y * 4; |
474 | if (ty > ((int)Constants.RegionSize - 1)) | 475 | if (ty > ((int)Constants.RegionSize - 1)) |
475 | ty = ((int)Constants.RegionSize - 1); | 476 | ty = ((int)Constants.RegionSize - 1); |
476 | landData.AABBMax = | 477 | LandData.AABBMax = |
477 | new Vector3((float) (max_x * 4), (float) (max_y * 4), | 478 | new Vector3((float) (max_x * 4), (float) (max_y * 4), |
478 | (float) m_scene.Heightmap[tx, ty]); | 479 | (float) m_scene.Heightmap[tx, ty]); |
479 | landData.Area = tempArea; | 480 | LandData.Area = tempArea; |
480 | } | 481 | } |
481 | 482 | ||
482 | #endregion | 483 | #endregion |
@@ -487,7 +488,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
487 | /// Sets the land's bitmap manually | 488 | /// Sets the land's bitmap manually |
488 | /// </summary> | 489 | /// </summary> |
489 | /// <param name="bitmap">64x64 block representing where this land is on a map</param> | 490 | /// <param name="bitmap">64x64 block representing where this land is on a map</param> |
490 | public void setLandBitmap(bool[,] bitmap) | 491 | public void SetLandBitmap(bool[,] bitmap) |
491 | { | 492 | { |
492 | if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2) | 493 | if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2) |
493 | { | 494 | { |
@@ -497,8 +498,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
497 | else | 498 | else |
498 | { | 499 | { |
499 | //Valid: Lets set it | 500 | //Valid: Lets set it |
500 | landBitmap = bitmap; | 501 | LandBitmap = bitmap; |
501 | forceUpdateLandInfo(); | 502 | ForceUpdateLandInfo(); |
502 | } | 503 | } |
503 | } | 504 | } |
504 | 505 | ||
@@ -506,18 +507,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
506 | /// Gets the land's bitmap manually | 507 | /// Gets the land's bitmap manually |
507 | /// </summary> | 508 | /// </summary> |
508 | /// <returns></returns> | 509 | /// <returns></returns> |
509 | public bool[,] getLandBitmap() | 510 | public bool[,] GetLandBitmap() |
510 | { | 511 | { |
511 | return landBitmap; | 512 | return LandBitmap; |
512 | } | 513 | } |
513 | 514 | ||
514 | /// <summary> | 515 | /// <summary> |
515 | /// Full sim land object creation | 516 | /// Full sim land object creation |
516 | /// </summary> | 517 | /// </summary> |
517 | /// <returns></returns> | 518 | /// <returns></returns> |
518 | public bool[,] basicFullRegionLandBitmap() | 519 | public bool[,] BasicFullRegionLandBitmap() |
519 | { | 520 | { |
520 | return getSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize); | 521 | return GetSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize); |
521 | } | 522 | } |
522 | 523 | ||
523 | /// <summary> | 524 | /// <summary> |
@@ -528,12 +529,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
528 | /// <param name="end_x"></param> | 529 | /// <param name="end_x"></param> |
529 | /// <param name="end_y"></param> | 530 | /// <param name="end_y"></param> |
530 | /// <returns></returns> | 531 | /// <returns></returns> |
531 | public bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y) | 532 | public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y) |
532 | { | 533 | { |
533 | bool[,] tempBitmap = new bool[64,64]; | 534 | bool[,] tempBitmap = new bool[64,64]; |
534 | tempBitmap.Initialize(); | 535 | tempBitmap.Initialize(); |
535 | 536 | ||
536 | tempBitmap = modifyLandBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true); | 537 | tempBitmap = ModifyLandBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true); |
537 | return tempBitmap; | 538 | return tempBitmap; |
538 | } | 539 | } |
539 | 540 | ||
@@ -547,7 +548,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
547 | /// <param name="end_y"></param> | 548 | /// <param name="end_y"></param> |
548 | /// <param name="set_value"></param> | 549 | /// <param name="set_value"></param> |
549 | /// <returns></returns> | 550 | /// <returns></returns> |
550 | public bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, | 551 | public bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, |
551 | bool set_value) | 552 | bool set_value) |
552 | { | 553 | { |
553 | if (land_bitmap.GetLength(0) != 64 || land_bitmap.GetLength(1) != 64 || land_bitmap.Rank != 2) | 554 | if (land_bitmap.GetLength(0) != 64 || land_bitmap.GetLength(1) != 64 || land_bitmap.Rank != 2) |
@@ -577,7 +578,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
577 | /// <param name="bitmap_base"></param> | 578 | /// <param name="bitmap_base"></param> |
578 | /// <param name="bitmap_add"></param> | 579 | /// <param name="bitmap_add"></param> |
579 | /// <returns></returns> | 580 | /// <returns></returns> |
580 | public bool[,] mergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add) | 581 | public bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add) |
581 | { | 582 | { |
582 | if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2) | 583 | if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2) |
583 | { | 584 | { |
@@ -608,7 +609,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
608 | /// Converts the land bitmap to a packet friendly byte array | 609 | /// Converts the land bitmap to a packet friendly byte array |
609 | /// </summary> | 610 | /// </summary> |
610 | /// <returns></returns> | 611 | /// <returns></returns> |
611 | private byte[] convertLandBitmapToBytes() | 612 | private byte[] ConvertLandBitmapToBytes() |
612 | { | 613 | { |
613 | byte[] tempConvertArr = new byte[512]; | 614 | byte[] tempConvertArr = new byte[512]; |
614 | byte tempByte = 0; | 615 | byte tempByte = 0; |
@@ -618,7 +619,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
618 | { | 619 | { |
619 | for (x = 0; x < 64; x++) | 620 | for (x = 0; x < 64; x++) |
620 | { | 621 | { |
621 | tempByte = Convert.ToByte(tempByte | Convert.ToByte(landBitmap[x, y]) << (i++ % 8)); | 622 | tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8)); |
622 | if (i % 8 == 0) | 623 | if (i % 8 == 0) |
623 | { | 624 | { |
624 | tempConvertArr[byteNum] = tempByte; | 625 | tempConvertArr[byteNum] = tempByte; |
@@ -631,7 +632,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
631 | return tempConvertArr; | 632 | return tempConvertArr; |
632 | } | 633 | } |
633 | 634 | ||
634 | private bool[,] convertBytesToLandBitmap() | 635 | private bool[,] ConvertBytesToLandBitmap() |
635 | { | 636 | { |
636 | bool[,] tempConvertMap = new bool[landArrayMax, landArrayMax]; | 637 | bool[,] tempConvertMap = new bool[landArrayMax, landArrayMax]; |
637 | tempConvertMap.Initialize(); | 638 | tempConvertMap.Initialize(); |
@@ -639,7 +640,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
639 | int x = 0, y = 0, i = 0, bitNum = 0; | 640 | int x = 0, y = 0, i = 0, bitNum = 0; |
640 | for (i = 0; i < 512; i++) | 641 | for (i = 0; i < 512; i++) |
641 | { | 642 | { |
642 | tempByte = landData.Bitmap[i]; | 643 | tempByte = LandData.Bitmap[i]; |
643 | for (bitNum = 0; bitNum < 8; bitNum++) | 644 | for (bitNum = 0; bitNum < 8; bitNum++) |
644 | { | 645 | { |
645 | bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte) 1); | 646 | bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte) 1); |
@@ -659,7 +660,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
659 | 660 | ||
660 | #region Object Select and Object Owner Listing | 661 | #region Object Select and Object Owner Listing |
661 | 662 | ||
662 | public void sendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client) | 663 | public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client) |
663 | { | 664 | { |
664 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) | 665 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) |
665 | { | 666 | { |
@@ -672,11 +673,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
672 | { | 673 | { |
673 | if (obj.LocalId > 0) | 674 | if (obj.LocalId > 0) |
674 | { | 675 | { |
675 | if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == landData.OwnerID) | 676 | if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == LandData.OwnerID) |
676 | { | 677 | { |
677 | resultLocalIDs.Add(obj.LocalId); | 678 | resultLocalIDs.Add(obj.LocalId); |
678 | } | 679 | } |
679 | else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID == landData.GroupID && landData.GroupID != UUID.Zero) | 680 | else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID == LandData.GroupID && LandData.GroupID != UUID.Zero) |
680 | { | 681 | { |
681 | resultLocalIDs.Add(obj.LocalId); | 682 | resultLocalIDs.Add(obj.LocalId); |
682 | } | 683 | } |
@@ -709,7 +710,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
709 | /// <param name="remote_client"> | 710 | /// <param name="remote_client"> |
710 | /// A <see cref="IClientAPI"/> | 711 | /// A <see cref="IClientAPI"/> |
711 | /// </param> | 712 | /// </param> |
712 | public void sendLandObjectOwners(IClientAPI remote_client) | 713 | public void SendLandObjectOwners(IClientAPI remote_client) |
713 | { | 714 | { |
714 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) | 715 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) |
715 | { | 716 | { |
@@ -752,11 +753,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
752 | } | 753 | } |
753 | } | 754 | } |
754 | 755 | ||
755 | remote_client.SendLandObjectOwners(landData, groups, primCount); | 756 | remote_client.SendLandObjectOwners(LandData, groups, primCount); |
756 | } | 757 | } |
757 | } | 758 | } |
758 | 759 | ||
759 | public Dictionary<UUID, int> getLandObjectOwners() | 760 | public Dictionary<UUID, int> GetLandObjectOwners() |
760 | { | 761 | { |
761 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); | 762 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); |
762 | lock (primsOverMe) | 763 | lock (primsOverMe) |
@@ -786,14 +787,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
786 | 787 | ||
787 | #region Object Returning | 788 | #region Object Returning |
788 | 789 | ||
789 | public void returnObject(SceneObjectGroup obj) | 790 | public void ReturnObject(SceneObjectGroup obj) |
790 | { | 791 | { |
791 | SceneObjectGroup[] objs = new SceneObjectGroup[1]; | 792 | SceneObjectGroup[] objs = new SceneObjectGroup[1]; |
792 | objs[0] = obj; | 793 | objs[0] = obj; |
793 | m_scene.returnObjects(objs, obj.OwnerID); | 794 | m_scene.returnObjects(objs, obj.OwnerID); |
794 | } | 795 | } |
795 | 796 | ||
796 | public void returnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) | 797 | public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) |
797 | { | 798 | { |
798 | Dictionary<UUID,List<SceneObjectGroup>> returns = | 799 | Dictionary<UUID,List<SceneObjectGroup>> returns = |
799 | new Dictionary<UUID,List<SceneObjectGroup>>(); | 800 | new Dictionary<UUID,List<SceneObjectGroup>>(); |
@@ -869,19 +870,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
869 | 870 | ||
870 | #region Object Adding/Removing from Parcel | 871 | #region Object Adding/Removing from Parcel |
871 | 872 | ||
872 | public void resetLandPrimCounts() | 873 | public void ResetLandPrimCounts() |
873 | { | 874 | { |
874 | landData.GroupPrims = 0; | 875 | LandData.GroupPrims = 0; |
875 | landData.OwnerPrims = 0; | 876 | LandData.OwnerPrims = 0; |
876 | landData.OtherPrims = 0; | 877 | LandData.OtherPrims = 0; |
877 | landData.SelectedPrims = 0; | 878 | LandData.SelectedPrims = 0; |
878 | 879 | ||
879 | 880 | ||
880 | lock (primsOverMe) | 881 | lock (primsOverMe) |
881 | primsOverMe.Clear(); | 882 | primsOverMe.Clear(); |
882 | } | 883 | } |
883 | 884 | ||
884 | public void addPrimToCount(SceneObjectGroup obj) | 885 | public void AddPrimToCount(SceneObjectGroup obj) |
885 | { | 886 | { |
886 | 887 | ||
887 | UUID prim_owner = obj.OwnerID; | 888 | UUID prim_owner = obj.OwnerID; |
@@ -889,23 +890,23 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
889 | 890 | ||
890 | if (obj.IsSelected) | 891 | if (obj.IsSelected) |
891 | { | 892 | { |
892 | landData.SelectedPrims += prim_count; | 893 | LandData.SelectedPrims += prim_count; |
893 | } | 894 | } |
894 | else | 895 | else |
895 | { | 896 | { |
896 | if (prim_owner == landData.OwnerID) | 897 | if (prim_owner == LandData.OwnerID) |
897 | { | 898 | { |
898 | landData.OwnerPrims += prim_count; | 899 | LandData.OwnerPrims += prim_count; |
899 | } | 900 | } |
900 | else if ((obj.GroupID == landData.GroupID || | 901 | else if ((obj.GroupID == LandData.GroupID || |
901 | prim_owner == landData.GroupID) && | 902 | prim_owner == LandData.GroupID) && |
902 | landData.GroupID != UUID.Zero) | 903 | LandData.GroupID != UUID.Zero) |
903 | { | 904 | { |
904 | landData.GroupPrims += prim_count; | 905 | LandData.GroupPrims += prim_count; |
905 | } | 906 | } |
906 | else | 907 | else |
907 | { | 908 | { |
908 | landData.OtherPrims += prim_count; | 909 | LandData.OtherPrims += prim_count; |
909 | } | 910 | } |
910 | } | 911 | } |
911 | 912 | ||
@@ -913,7 +914,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
913 | primsOverMe.Add(obj); | 914 | primsOverMe.Add(obj); |
914 | } | 915 | } |
915 | 916 | ||
916 | public void removePrimFromCount(SceneObjectGroup obj) | 917 | public void RemovePrimFromCount(SceneObjectGroup obj) |
917 | { | 918 | { |
918 | lock (primsOverMe) | 919 | lock (primsOverMe) |
919 | { | 920 | { |
@@ -922,18 +923,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
922 | UUID prim_owner = obj.OwnerID; | 923 | UUID prim_owner = obj.OwnerID; |
923 | int prim_count = obj.PrimCount; | 924 | int prim_count = obj.PrimCount; |
924 | 925 | ||
925 | if (prim_owner == landData.OwnerID) | 926 | if (prim_owner == LandData.OwnerID) |
926 | { | 927 | { |
927 | landData.OwnerPrims -= prim_count; | 928 | LandData.OwnerPrims -= prim_count; |
928 | } | 929 | } |
929 | else if (obj.GroupID == landData.GroupID || | 930 | else if (obj.GroupID == LandData.GroupID || |
930 | prim_owner == landData.GroupID) | 931 | prim_owner == LandData.GroupID) |
931 | { | 932 | { |
932 | landData.GroupPrims -= prim_count; | 933 | LandData.GroupPrims -= prim_count; |
933 | } | 934 | } |
934 | else | 935 | else |
935 | { | 936 | { |
936 | landData.OtherPrims -= prim_count; | 937 | LandData.OtherPrims -= prim_count; |
937 | } | 938 | } |
938 | 939 | ||
939 | primsOverMe.Remove(obj); | 940 | primsOverMe.Remove(obj); |
@@ -953,8 +954,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
953 | /// <param name="url"></param> | 954 | /// <param name="url"></param> |
954 | public void SetMediaUrl(string url) | 955 | public void SetMediaUrl(string url) |
955 | { | 956 | { |
956 | landData.MediaURL = url; | 957 | LandData.MediaURL = url; |
957 | sendLandUpdateToAvatarsOverMe(); | 958 | SendLandUpdateToAvatarsOverMe(); |
958 | } | 959 | } |
959 | 960 | ||
960 | /// <summary> | 961 | /// <summary> |
@@ -963,8 +964,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
963 | /// <param name="url"></param> | 964 | /// <param name="url"></param> |
964 | public void SetMusicUrl(string url) | 965 | public void SetMusicUrl(string url) |
965 | { | 966 | { |
966 | landData.MusicURL = url; | 967 | LandData.MusicURL = url; |
967 | sendLandUpdateToAvatarsOverMe(); | 968 | SendLandUpdateToAvatarsOverMe(); |
968 | } | 969 | } |
969 | } | 970 | } |
970 | } | 971 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs index 9e46b94..7df836c 100644 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs | |||
@@ -85,7 +85,7 @@ public class RegionCombinerLargeLandChannel : ILandChannel | |||
85 | } | 85 | } |
86 | } | 86 | } |
87 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | 87 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); |
88 | obj.landData.Name = "NO LAND"; | 88 | obj.LandData.Name = "NO LAND"; |
89 | return obj; | 89 | return obj; |
90 | } | 90 | } |
91 | } | 91 | } |
@@ -118,7 +118,7 @@ public class RegionCombinerLargeLandChannel : ILandChannel | |||
118 | } | 118 | } |
119 | } | 119 | } |
120 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | 120 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); |
121 | obj.landData.Name = "NO LAND"; | 121 | obj.LandData.Name = "NO LAND"; |
122 | return obj; | 122 | return obj; |
123 | } | 123 | } |
124 | } | 124 | } |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index a9e0b7f..040d0a3 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -569,7 +569,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
569 | 569 | ||
570 | // Users should be able to edit what is over their land. | 570 | // Users should be able to edit what is over their land. |
571 | ILandObject parcel = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); | 571 | ILandObject parcel = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); |
572 | if (parcel != null && parcel.landData.OwnerID == user && m_ParcelOwnerIsGod) | 572 | if (parcel != null && parcel.LandData.OwnerID == user && m_ParcelOwnerIsGod) |
573 | { | 573 | { |
574 | // Admin objects should not be editable by the above | 574 | // Admin objects should not be editable by the above |
575 | if (!IsAdministrator(objectOwner)) | 575 | if (!IsAdministrator(objectOwner)) |
@@ -672,7 +672,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
672 | 672 | ||
673 | // Users should be able to edit what is over their land. | 673 | // Users should be able to edit what is over their land. |
674 | ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); | 674 | ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); |
675 | if ((parcel != null) && (parcel.landData.OwnerID == currentUser)) | 675 | if ((parcel != null) && (parcel.LandData.OwnerID == currentUser)) |
676 | { | 676 | { |
677 | permission = true; | 677 | permission = true; |
678 | } | 678 | } |
@@ -740,12 +740,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
740 | { | 740 | { |
741 | bool permission = false; | 741 | bool permission = false; |
742 | 742 | ||
743 | if (parcel.landData.OwnerID == user) | 743 | if (parcel.LandData.OwnerID == user) |
744 | { | 744 | { |
745 | permission = true; | 745 | permission = true; |
746 | } | 746 | } |
747 | 747 | ||
748 | if ((parcel.landData.GroupID != UUID.Zero) && IsGroupMember(parcel.landData.GroupID, user, groupPowers)) | 748 | if ((parcel.LandData.GroupID != UUID.Zero) && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) |
749 | { | 749 | { |
750 | permission = true; | 750 | permission = true; |
751 | } | 751 | } |
@@ -767,12 +767,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
767 | { | 767 | { |
768 | bool permission = false; | 768 | bool permission = false; |
769 | 769 | ||
770 | if (parcel.landData.OwnerID == user) | 770 | if (parcel.LandData.OwnerID == user) |
771 | { | 771 | { |
772 | permission = true; | 772 | permission = true; |
773 | } | 773 | } |
774 | 774 | ||
775 | if (parcel.landData.IsGroupOwned && IsGroupMember(parcel.landData.GroupID, user, groupPowers)) | 775 | if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) |
776 | { | 776 | { |
777 | permission = true; | 777 | permission = true; |
778 | } | 778 | } |
@@ -820,13 +820,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
820 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 820 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
821 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 821 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
822 | 822 | ||
823 | if (parcel.landData.OwnerID != user) // Only the owner can deed! | 823 | if (parcel.LandData.OwnerID != user) // Only the owner can deed! |
824 | return false; | 824 | return false; |
825 | 825 | ||
826 | ScenePresence sp = scene.GetScenePresence(user); | 826 | ScenePresence sp = scene.GetScenePresence(user); |
827 | IClientAPI client = sp.ControllingClient; | 827 | IClientAPI client = sp.ControllingClient; |
828 | 828 | ||
829 | if ((client.GetGroupPowers(parcel.landData.GroupID) & (ulong)GroupPowers.LandDeed) == 0) | 829 | if ((client.GetGroupPowers(parcel.LandData.GroupID) & (ulong)GroupPowers.LandDeed) == 0) |
830 | return false; | 830 | return false; |
831 | 831 | ||
832 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDeed); | 832 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDeed); |
@@ -1189,7 +1189,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1189 | return false; | 1189 | return false; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | if ((land.landData.Flags & ((int)ParcelFlags.AllowAPrimitiveEntry)) != 0) | 1192 | if ((land.LandData.Flags & ((int)ParcelFlags.AllowAPrimitiveEntry)) != 0) |
1193 | { | 1193 | { |
1194 | return true; | 1194 | return true; |
1195 | } | 1195 | } |
@@ -1233,7 +1233,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1233 | ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); | 1233 | ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); |
1234 | if (land == null) return false; | 1234 | if (land == null) return false; |
1235 | 1235 | ||
1236 | if ((land.landData.Flags & ((int)ParcelFlags.CreateObjects)) == | 1236 | if ((land.LandData.Flags & ((int)ParcelFlags.CreateObjects)) == |
1237 | (int)ParcelFlags.CreateObjects) | 1237 | (int)ParcelFlags.CreateObjects) |
1238 | permission = true; | 1238 | permission = true; |
1239 | 1239 | ||
@@ -1360,7 +1360,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1360 | return false; | 1360 | return false; |
1361 | 1361 | ||
1362 | // Others allowed to terraform? | 1362 | // Others allowed to terraform? |
1363 | if ((parcel.landData.Flags & ((int)ParcelFlags.AllowTerraform)) != 0) | 1363 | if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowTerraform)) != 0) |
1364 | return true; | 1364 | return true; |
1365 | 1365 | ||
1366 | // Land owner can terraform too | 1366 | // Land owner can terraform too |
@@ -1693,27 +1693,27 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1693 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1693 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1694 | 1694 | ||
1695 | long powers = 0; | 1695 | long powers = 0; |
1696 | if (parcel.landData.GroupID != UUID.Zero) | 1696 | if (parcel.LandData.GroupID != UUID.Zero) |
1697 | client.GetGroupPowers(parcel.landData.GroupID); | 1697 | client.GetGroupPowers(parcel.LandData.GroupID); |
1698 | 1698 | ||
1699 | switch (type) | 1699 | switch (type) |
1700 | { | 1700 | { |
1701 | case (uint)ObjectReturnType.Owner: | 1701 | case (uint)ObjectReturnType.Owner: |
1702 | // Don't let group members return owner's objects, ever | 1702 | // Don't let group members return owner's objects, ever |
1703 | // | 1703 | // |
1704 | if (parcel.landData.IsGroupOwned) | 1704 | if (parcel.LandData.IsGroupOwned) |
1705 | { | 1705 | { |
1706 | if ((powers & (long)GroupPowers.ReturnGroupOwned) != 0) | 1706 | if ((powers & (long)GroupPowers.ReturnGroupOwned) != 0) |
1707 | return true; | 1707 | return true; |
1708 | } | 1708 | } |
1709 | else | 1709 | else |
1710 | { | 1710 | { |
1711 | if (parcel.landData.OwnerID != client.AgentId) | 1711 | if (parcel.LandData.OwnerID != client.AgentId) |
1712 | return false; | 1712 | return false; |
1713 | } | 1713 | } |
1714 | return GenericParcelOwnerPermission(client.AgentId, parcel, (ulong)GroupPowers.ReturnGroupOwned); | 1714 | return GenericParcelOwnerPermission(client.AgentId, parcel, (ulong)GroupPowers.ReturnGroupOwned); |
1715 | case (uint)ObjectReturnType.Group: | 1715 | case (uint)ObjectReturnType.Group: |
1716 | if (parcel.landData.OwnerID != client.AgentId) | 1716 | if (parcel.LandData.OwnerID != client.AgentId) |
1717 | { | 1717 | { |
1718 | // If permissionis granted through a group... | 1718 | // If permissionis granted through a group... |
1719 | // | 1719 | // |