From d6301db382111bf57a7893215ea84b7e6b09187e Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 2 Oct 2009 00:45:31 +0100 Subject: Revert "* Adding Scale to EntityBase * Fixing the incorrect initialization of EntityBase.Rotation * Removed SceneObjectGroup.GroupRotation and added overrides for Scale/Rotation/Velocity" This reverts commit 39842eb4af3b5a8c52d56c0f7f05ad54f0651bb0. --- .../Region/Examples/SimpleModule/ComplexObject.cs | 2 +- OpenSim/Region/Framework/Scenes/EntityBase.cs | 18 +++++-------- OpenSim/Region/Framework/Scenes/Scene.cs | 4 +-- .../Region/Framework/Scenes/SceneObjectGroup.cs | 30 +++++----------------- .../Shared/Api/Implementation/LSL_Api.cs | 8 +++--- OpenSim/Region/ScriptEngine/Shared/Helpers.cs | 12 +++++---- 6 files changed, 28 insertions(+), 46 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index 66f4da0..3809749 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.Examples.SimpleModule public override void UpdateMovement() { - UpdateGroupRotation(Rotation * m_rotationDirection); + UpdateGroupRotation(GroupRotation * m_rotationDirection); base.UpdateMovement(); } diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs index 27a0785..c2ec6a5 100644 --- a/OpenSim/Region/Framework/Scenes/EntityBase.cs +++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Framework.Scenes set { m_velocity = value; } } - protected Quaternion m_rotation; + protected Quaternion m_rotation = new Quaternion(0f, 0f, 1f, 0f); public virtual Quaternion Rotation { @@ -102,14 +102,6 @@ namespace OpenSim.Region.Framework.Scenes set { m_rotation = value; } } - protected Vector3 m_scale; - - public virtual Vector3 Scale - { - get { return m_scale; } - set { m_scale = value; } - } - protected uint m_localId; public virtual uint LocalId @@ -123,9 +115,13 @@ namespace OpenSim.Region.Framework.Scenes /// public EntityBase() { - m_rotation = Quaternion.Identity; - m_scale = Vector3.One; + m_uuid = UUID.Zero; + + m_pos = Vector3.Zero; + m_velocity = Vector3.Zero; + Rotation = Quaternion.Identity; m_name = "(basic entity)"; + m_rotationalvelocity = Vector3.Zero; } /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0aa587e..05a6f13 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2305,8 +2305,8 @@ namespace OpenSim.Region.Framework.Scenes "to avatar {0} at position {1}", sp.UUID.ToString(), grp.AbsolutePosition); AttachObject(sp.ControllingClient, - grp.LocalId, 0, - grp.Rotation, + grp.LocalId, (uint)0, + grp.GroupRotation, grp.AbsolutePosition, false); RootPrim.RemFlag(PrimFlags.TemporaryOnRez); grp.SendGroupFullUpdate(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6807e1b..25489d8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -204,22 +204,9 @@ namespace OpenSim.Region.Framework.Scenes get { return m_parts.Count; } } - public override Quaternion Rotation + public Quaternion GroupRotation { get { return m_rootPart.RotationOffset; } - set { m_rootPart.RotationOffset = value; } - } - - public override Vector3 Scale - { - get { return m_rootPart.Scale; } - set { m_rootPart.Scale = value; } - } - - public override Vector3 Velocity - { - get { return m_rootPart.Velocity; } - set { m_rootPart.Velocity = value; } } public UUID GroupID @@ -541,7 +528,7 @@ namespace OpenSim.Region.Framework.Scenes // Temporary commented to stop compiler warning //Vector3 partPosition = // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); - Quaternion parentrotation = Rotation; + Quaternion parentrotation = GroupRotation; // Telling the prim to raytrace. //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); @@ -1884,17 +1871,14 @@ namespace OpenSim.Region.Framework.Scenes checkAtTargets(); - Quaternion rot = Rotation; - - if (UsePhysics && - ((Math.Abs(lastPhysGroupRot.W - rot.W) > 0.1f) - || (Math.Abs(lastPhysGroupRot.X - rot.X) > 0.1f) - || (Math.Abs(lastPhysGroupRot.Y - rot.Y) > 0.1f) - || (Math.Abs(lastPhysGroupRot.Z - rot.Z) > 0.1f))) + if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) + || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) + || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) + || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))) { m_rootPart.UpdateFlag = 1; - lastPhysGroupRot = rot; + lastPhysGroupRot = GroupRotation; } foreach (SceneObjectPart part in m_parts.Values) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bf83a49..0bd6546 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2007,10 +2007,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api q = avatar.Rotation; // Currently infrequently updated so may be inaccurate } else - q = part.ParentGroup.Rotation; // Likely never get here but just in case + q = part.ParentGroup.GroupRotation; // Likely never get here but just in case } else - q = part.ParentGroup.Rotation; // just the group rotation + q = part.ParentGroup.GroupRotation; // just the group rotation return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } q = part.GetWorldRotation(); @@ -7181,10 +7181,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else q = avatar.Rotation; // Currently infrequently updated so may be inaccurate else - q = m_host.ParentGroup.Rotation; // Likely never get here but just in case + q = m_host.ParentGroup.GroupRotation; // Likely never get here but just in case } else - q = m_host.ParentGroup.Rotation; // just the group rotation + q = m_host.ParentGroup.GroupRotation; // just the group rotation return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs index 84ccafe..4855d64 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs @@ -218,14 +218,16 @@ namespace OpenSim.Region.ScriptEngine.Shared } } - Vector3 absPos = part.AbsolutePosition; - Position = new LSL_Types.Vector3(absPos.X, absPos.Y, absPos.Z); + Position = new LSL_Types.Vector3(part.AbsolutePosition.X, + part.AbsolutePosition.Y, + part.AbsolutePosition.Z); - Quaternion wr = part.ParentGroup.Rotation; + Quaternion wr = part.ParentGroup.GroupRotation; Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W); - Vector3 vel = part.Velocity; - Velocity = new LSL_Types.Vector3(vel.X, vel.Y, vel.Z); + Velocity = new LSL_Types.Vector3(part.Velocity.X, + part.Velocity.Y, + part.Velocity.Z); } } -- cgit v1.1 From 24d5b5750369cbc90aa60e0ae34387e3ba6e1416 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 1 Oct 2009 17:28:42 -0700 Subject: Added messages to assertions in the failing tests, so that we know which ones are failing. --- .../Scenes/Tests/SceneObjectLinkingTests.cs | 31 +++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index e15dc84..aa2f53f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -94,10 +94,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests } // root part should have no offset position or rotation - Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); + Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, + "root part should have no offset position or rotation"); // offset position should be root part position - part2.absolute position. - Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); + Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10), + "offset position should be root part position - part2.absolute position."); float roll = 0; float pitch = 0; @@ -116,7 +118,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests if (debugtest) m_log.Debug(rotEuler2); - Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); + Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f), + "Not exactly sure what this is asserting..."); // Delink part 2 grp1.DelinkFromGroup(part2.LocalId); @@ -125,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); - Assert.That(part2.AbsolutePosition == Vector3.Zero); + Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero"); } [Test] @@ -175,10 +178,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests grp3.LinkToGroup(grp4); // At this point we should have 4 parts total in two groups. - Assert.That(grp1.Children.Count == 2); + Assert.That(grp1.Children.Count == 2, "Group1 children count should be 2"); Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); - Assert.That(grp3.Children.Count == 2); + Assert.That(grp3.Children.Count == 2, "Group3 children count should be 2"); Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); @@ -201,10 +204,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests grp3.RootPart.UpdateFlag = 0; // root part should have no offset position or rotation - Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); + Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, + "root part should have no offset position or rotation (again)"); // offset position should be root part position - part2.absolute position. - Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); + Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10), + "offset position should be root part position - part2.absolute position (again)"); float roll = 0; float pitch = 0; @@ -223,7 +228,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests if (debugtest) m_log.Debug(rotEuler2); - Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); + Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f), + "Not sure what this assertion is all about..."); // Now we're linking the first group to the third group. This will make the first group child parts of the third one. grp3.LinkToGroup(grp1); @@ -246,13 +252,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); } - Assert.That(part2.AbsolutePosition == Vector3.Zero); - Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20)); + Assert.That(part2.AbsolutePosition == Vector3.Zero, "Badness 1"); + Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20), "Badness 2"); Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) - && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); + && (part4.RotationOffset.W - compareQuaternion.W < 0.00003), + "Badness 3"); } } } -- cgit v1.1 From a030e3d61bc0edf1b51abf245cda3d33a5fb091f Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 2 Oct 2009 10:53:21 +1000 Subject: * Attempting to fix a issue with console commands & the estate module. Again. --- .../World/Estate/EstateManagementModule.cs | 56 ++++++++++++++++++++-- 1 file changed, 52 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 0d51cf4..4896edf 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -858,8 +858,30 @@ namespace OpenSim.Region.CoreModules.World.Estate { if (y == -1 || m_scene.RegionInfo.RegionLocY == y) { - m_log.Debug("[ESTATEMODULE] Setting terrain textures for " + m_scene.RegionInfo.RegionName); - setEstateTerrainBaseTexture(null, int.Parse(num), UUID.Parse(uuid)); + int corner = int.Parse(num); + UUID texture = UUID.Parse(uuid); + + m_log.Debug("[ESTATEMODULE] Setting terrain textures for " + m_scene.RegionInfo.RegionName + + string.Format(" (C#{0} = {1})", corner, texture)); + + switch (corner) + { + case 0: + m_scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; + break; + case 1: + m_scene.RegionInfo.RegionSettings.TerrainTexture2 = texture; + break; + case 2: + m_scene.RegionInfo.RegionSettings.TerrainTexture3 = texture; + break; + case 3: + m_scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; + break; + } + m_scene.RegionInfo.RegionSettings.Save(); + sendRegionInfoPacketToAll(); + } } } @@ -876,8 +898,34 @@ namespace OpenSim.Region.CoreModules.World.Estate { if (y == -1 || m_scene.RegionInfo.RegionLocY == y) { - m_log.Debug("[ESTATEMODULE] Setting terrain heights " + m_scene.RegionInfo.RegionName); - setEstateTerrainTextureHeights(null, int.Parse(num), float.Parse(min), float.Parse(max)); + int corner = int.Parse(num); + float lowValue = float.Parse(min); + float highValue = float.Parse(max); + + m_log.Debug("[ESTATEMODULE] Setting terrain heights " + m_scene.RegionInfo.RegionName + + string.Format(" (C{0}, {1}-{2}", corner, lowValue, highValue)); + + switch (corner) + { + case 0: + m_scene.RegionInfo.RegionSettings.Elevation1SW = lowValue; + m_scene.RegionInfo.RegionSettings.Elevation2SW = highValue; + break; + case 1: + m_scene.RegionInfo.RegionSettings.Elevation1NW = lowValue; + m_scene.RegionInfo.RegionSettings.Elevation2NW = highValue; + break; + case 2: + m_scene.RegionInfo.RegionSettings.Elevation1SE = lowValue; + m_scene.RegionInfo.RegionSettings.Elevation2SE = highValue; + break; + case 3: + m_scene.RegionInfo.RegionSettings.Elevation1NE = lowValue; + m_scene.RegionInfo.RegionSettings.Elevation2NE = highValue; + break; + } + m_scene.RegionInfo.RegionSettings.Save(); + sendRegionHandshakeToAll(); } } } -- cgit v1.1 From 2107b67f1b145f7718fdb1450be1a7b8dd1a0bf7 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Fri, 2 Oct 2009 11:10:52 +0200 Subject: - cleaning up LandData/ILandObject capitalization issues - adding LandDataSerializer to OAR mechanics --- .../CoreModules/Avatar/Combat/CombatModule.cs | 2 +- .../World/Archiver/ArchiveReadRequest.cs | 34 ++- .../World/Archiver/ArchiveWriteRequestExecution.cs | 11 + .../Region/CoreModules/World/Land/LandChannel.cs | 4 +- .../CoreModules/World/Land/LandManagementModule.cs | 252 +++++++++++---------- .../Region/CoreModules/World/Land/LandObject.cs | 233 +++++++++---------- .../World/Land/RegionCombinerLargeLandChannel.cs | 4 +- .../World/Permissions/PermissionsModule.cs | 32 +-- OpenSim/Region/DataSnapshot/LandSnapshot.cs | 18 +- OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | 2 +- OpenSim/Region/Framework/Interfaces/ILandObject.cs | 72 +++--- OpenSim/Region/Framework/Scenes/Scene.cs | 18 +- .../Region/Framework/Scenes/SceneObjectGroup.cs | 12 +- .../Scripting/Minimodule/LOParcel.cs | 10 +- .../OptionalModules/Scripting/Minimodule/World.cs | 2 +- .../Shared/Api/Implementation/LSL_Api.cs | 45 ++-- .../Shared/Api/Implementation/OSSL_Api.cs | 10 +- 17 files changed, 400 insertions(+), 361 deletions(-) (limited to 'OpenSim/Region') 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 private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) { ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); - if ((obj.landData.Flags & (uint)ParcelFlags.AllowDamage) != 0) + if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) { avatar.Invulnerable = false; } 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 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); + private static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); private Scene m_scene; private Stream m_loadStream; @@ -100,6 +101,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver int successfulAssetRestores = 0; int failedAssetRestores = 0; List serialisedSceneObjects = new List(); + List serialisedParcels = new List(); string filePath = "NONE"; try @@ -119,7 +121,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) { - serialisedSceneObjects.Add(m_asciiEncoding.GetString(data)); + serialisedSceneObjects.Add(m_utf8Encoding.GetString(data)); } else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) { @@ -136,6 +138,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver { LoadRegionSettings(filePath, data); } + else if (!m_merge && filePath.StartsWith(ArchiveConstants.LANDDATA_PATH)) + { + serialisedParcels.Add(m_utf8Encoding.GetString(data)); + } else if (filePath == ArchiveConstants.CONTROL_FILE_PATH) { LoadControlFile(filePath, data); @@ -169,6 +175,26 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_scene.DeleteAllSceneObjects(); } + // Try to retain the original creator/owner/lastowner if their uuid is present on this grid + // otherwise, use the master avatar uuid instead + UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; + + if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) + masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; + + // Reload serialized parcels + m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count); + List landData = new List(); + foreach (string serialisedParcel in serialisedParcels) + { + LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); + if (!ResolveUserUuid(parcel.OwnerID)) + parcel.OwnerID = masterAvatarId; + landData.Add(parcel); + } + m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); + m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); + // Reload serialized prims m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); @@ -198,12 +224,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver // to the same scene (when this is possible). sceneObject.ResetIDs(); - // Try to retain the original creator/owner/lastowner if their uuid is present on this grid - // otherwise, use the master avatar uuid instead - UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; - - if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) - masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; foreach (SceneObjectPart part in sceneObject.Children.Values) { 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 m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); + // Write out land data (aka parcel) settings + ListlandObjects = m_scene.LandChannel.AllParcels(); + foreach (ILandObject lo in landObjects) + { + LandData landData = lo.LandData; + string landDataPath = String.Format("{0}{1}.xml", ArchiveConstants.LANDDATA_PATH, + landData.GlobalID.ToString()); + m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData)); + } + m_log.InfoFormat("[ARCHIVER]: Added parcel settings to archive."); + // Write out terrain string terrainPath = 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 } ILandObject obj = new LandObject(UUID.Zero, false, m_scene); - obj.landData.Name = "NO LAND"; + obj.LandData.Name = "NO LAND"; return obj; } @@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.World.Land } ILandObject obj = new LandObject(UUID.Zero, false, m_scene); - obj.landData.Name = "NO LAND"; + obj.LandData.Name = "NO LAND"; return obj; } 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 { // used for caching internal class ExtendedLandData { - public LandData landData; - public ulong regionHandle; - public uint x, y; + public LandData LandData; + public ulong RegionHandle; + public uint X, Y; } public class LandManagementModule : INonSharedRegionModule @@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.World.Land { if (m_landList.ContainsKey(local_id)) { - m_landList[local_id].landData = newData; + m_landList[local_id].LandData = newData; m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, m_landList[local_id]); } } @@ -218,12 +218,12 @@ namespace OpenSim.Region.CoreModules.World.Land ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); - fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); + fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) - fullSimParcel.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; + fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; else - fullSimParcel.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; - fullSimParcel.landData.ClaimDate = Util.UnixTimeSinceEpoch(); + fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; + fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); AddLandObject(fullSimParcel); } @@ -289,11 +289,11 @@ namespace OpenSim.Region.CoreModules.World.Land { if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) { - if (parcelAvatarIsEntering.isBannedFromLand(avatar.UUID)) + if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) { SendYouAreBannedNotice(avatar); } - else if (parcelAvatarIsEntering.isRestrictedFromLand(avatar.UUID)) + else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID)) { avatar.ControllingClient.SendAlertMessage( "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 List checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); foreach (ILandObject checkBan in checkLandParcels) { - if (checkBan.isBannedFromLand(avatar.AgentId)) + if (checkBan.IsBannedFromLand(avatar.AgentId)) { - checkBan.sendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); + checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); return; //Only send one } - if (checkBan.isRestrictedFromLand(avatar.AgentId)) + if (checkBan.IsRestrictedFromLand(avatar.AgentId)) { - checkBan.sendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar); + checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar); return; //Only send one } } @@ -348,19 +348,19 @@ namespace OpenSim.Region.CoreModules.World.Land { if (!avatar.IsChildAgent) { - over.sendLandUpdateToClient(avatar.ControllingClient); - m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.landData.LocalID, + over.SendLandUpdateToClient(avatar.ControllingClient); + m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, m_scene.RegionInfo.RegionID); } } - if (avatar.currentParcelUUID != over.landData.GlobalID) + if (avatar.currentParcelUUID != over.LandData.GlobalID) { if (!avatar.IsChildAgent) { - over.sendLandUpdateToClient(avatar.ControllingClient); - avatar.currentParcelUUID = over.landData.GlobalID; - m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.landData.LocalID, + over.SendLandUpdateToClient(avatar.ControllingClient); + avatar.currentParcelUUID = over.LandData.GlobalID; + m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, m_scene.RegionInfo.RegionID); } } @@ -386,16 +386,16 @@ namespace OpenSim.Region.CoreModules.World.Land if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) { - EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.landData.LocalID, + EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, m_scene.RegionInfo.RegionID); //They are going under the safety line! - if (!parcel.isBannedFromLand(clientAvatar.UUID)) + if (!parcel.IsBannedFromLand(clientAvatar.UUID)) { clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; } } else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && - parcel.isBannedFromLand(clientAvatar.UUID)) + parcel.IsBannedFromLand(clientAvatar.UUID)) { SendYouAreBannedNotice(clientAvatar); } @@ -409,7 +409,7 @@ namespace OpenSim.Region.CoreModules.World.Land ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); if (over != null) { - if (!over.isBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT) + if (!over.IsBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT) { avatar.lastKnownAllowedPosition = new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); @@ -429,7 +429,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - m_landList[landLocalID].sendAccessList(agentID, sessionID, flags, sequenceID, remote_client); + m_landList[landLocalID].SendAccessList(agentID, sessionID, flags, sequenceID, remote_client); } } @@ -445,9 +445,9 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - if (agentID == land.landData.OwnerID) + if (agentID == land.LandData.OwnerID) { - land.updateAccessList(flags, entries, remote_client); + land.UpdateAccessList(flags, entries, remote_client); } } else @@ -476,9 +476,9 @@ namespace OpenSim.Region.CoreModules.World.Land lock (m_landList) { int newLandLocalID = ++m_lastLandLocalID; - new_land.landData.LocalID = newLandLocalID; + new_land.LandData.LocalID = newLandLocalID; - bool[,] landBitmap = new_land.getLandBitmap(); + bool[,] landBitmap = new_land.GetLandBitmap(); for (int x = 0; x < landArrayMax; x++) { for (int y = 0; y < landArrayMax; y++) @@ -493,7 +493,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_landList.Add(newLandLocalID, new_land); } - new_land.forceUpdateLandInfo(); + new_land.ForceUpdateLandInfo(); m_scene.EventManager.TriggerLandObjectAdded(new_land); return new_land; } @@ -520,14 +520,14 @@ namespace OpenSim.Region.CoreModules.World.Land } } - m_scene.EventManager.TriggerLandObjectRemoved(m_landList[local_id].landData.GlobalID); + m_scene.EventManager.TriggerLandObjectRemoved(m_landList[local_id].LandData.GlobalID); m_landList.Remove(local_id); } } private void performFinalLandJoin(ILandObject master, ILandObject slave) { - bool[,] landBitmapSlave = slave.getLandBitmap(); + bool[,] landBitmapSlave = slave.GetLandBitmap(); lock (m_landList) { for (int x = 0; x < 64; x++) @@ -536,14 +536,14 @@ namespace OpenSim.Region.CoreModules.World.Land { if (landBitmapSlave[x, y]) { - m_landIDList[x, y] = master.landData.LocalID; + m_landIDList[x, y] = master.LandData.LocalID; } } } } - removeLandObject(slave.landData.LocalID); - UpdateLandObject(master.landData.LocalID, master.landData); + removeLandObject(slave.LandData.LocalID); + UpdateLandObject(master.LandData.LocalID, master.LandData); } public ILandObject GetLandObject(int parcelLocalID) @@ -630,7 +630,7 @@ namespace OpenSim.Region.CoreModules.World.Land { foreach (LandObject p in m_landList.Values) { - p.resetLandPrimCounts(); + p.ResetLandPrimCounts(); } } } @@ -651,7 +651,7 @@ namespace OpenSim.Region.CoreModules.World.Land ILandObject landUnderPrim = GetLandObject(position.X, position.Y); if (landUnderPrim != null) { - landUnderPrim.addPrimToCount(obj); + landUnderPrim.AddPrimToCount(obj); } } @@ -662,7 +662,7 @@ namespace OpenSim.Region.CoreModules.World.Land { foreach (LandObject p in m_landList.Values) { - p.removePrimFromCount(obj); + p.RemovePrimFromCount(obj); } } } @@ -675,15 +675,15 @@ namespace OpenSim.Region.CoreModules.World.Land { foreach (LandObject p in m_landList.Values) { - if (!landOwnersAndParcels.ContainsKey(p.landData.OwnerID)) + if (!landOwnersAndParcels.ContainsKey(p.LandData.OwnerID)) { List tempList = new List(); tempList.Add(p); - landOwnersAndParcels.Add(p.landData.OwnerID, tempList); + landOwnersAndParcels.Add(p.LandData.OwnerID, tempList); } else { - landOwnersAndParcels[p.landData.OwnerID].Add(p); + landOwnersAndParcels[p.LandData.OwnerID].Add(p); } } } @@ -694,15 +694,15 @@ namespace OpenSim.Region.CoreModules.World.Land int simPrims = 0; foreach (LandObject p in landOwnersAndParcels[owner]) { - simArea += p.landData.Area; - simPrims += p.landData.OwnerPrims + p.landData.OtherPrims + p.landData.GroupPrims + - p.landData.SelectedPrims; + simArea += p.LandData.Area; + simPrims += p.LandData.OwnerPrims + p.LandData.OtherPrims + p.LandData.GroupPrims + + p.LandData.SelectedPrims; } foreach (LandObject p in landOwnersAndParcels[owner]) { - p.landData.SimwideArea = simArea; - p.landData.SimwidePrims = simPrims; + p.LandData.SimwideArea = simArea; + p.LandData.SimwidePrims = simPrims; } } } @@ -779,26 +779,26 @@ namespace OpenSim.Region.CoreModules.World.Land //Lets create a new land object with bitmap activated at that point (keeping the old land objects info) ILandObject newLand = startLandObject.Copy(); - newLand.landData.Name = newLand.landData.Name; - newLand.landData.GlobalID = UUID.Random(); + newLand.LandData.Name = newLand.LandData.Name; + newLand.LandData.GlobalID = UUID.Random(); - newLand.setLandBitmap(newLand.getSquareLandBitmap(start_x, start_y, end_x, end_y)); + newLand.SetLandBitmap(newLand.GetSquareLandBitmap(start_x, start_y, end_x, end_y)); //Now, lets set the subdivision area of the original to false - int startLandObjectIndex = startLandObject.landData.LocalID; + int startLandObjectIndex = startLandObject.LandData.LocalID; lock (m_landList) { - m_landList[startLandObjectIndex].setLandBitmap( - newLand.modifyLandBitmapSquare(startLandObject.getLandBitmap(), start_x, start_y, end_x, end_y, false)); - m_landList[startLandObjectIndex].forceUpdateLandInfo(); + m_landList[startLandObjectIndex].SetLandBitmap( + newLand.ModifyLandBitmapSquare(startLandObject.GetLandBitmap(), start_x, start_y, end_x, end_y, false)); + m_landList[startLandObjectIndex].ForceUpdateLandInfo(); } EventManagerOnParcelPrimCountTainted(); //Now add the new land object ILandObject result = AddLandObject(newLand); - UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); - result.sendLandUpdateToAvatarsOverMe(); + UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); + result.SendLandUpdateToAvatarsOverMe(); } /// @@ -846,7 +846,7 @@ namespace OpenSim.Region.CoreModules.World.Land } foreach (ILandObject p in selectedLandObjects) { - if (p.landData.OwnerID != masterLandObject.landData.OwnerID) + if (p.LandData.OwnerID != masterLandObject.LandData.OwnerID) { return; } @@ -856,14 +856,14 @@ namespace OpenSim.Region.CoreModules.World.Land { foreach (ILandObject slaveLandObject in selectedLandObjects) { - m_landList[masterLandObject.landData.LocalID].setLandBitmap( - slaveLandObject.mergeLandBitmaps(masterLandObject.getLandBitmap(), slaveLandObject.getLandBitmap())); + m_landList[masterLandObject.LandData.LocalID].SetLandBitmap( + slaveLandObject.MergeLandBitmaps(masterLandObject.GetLandBitmap(), slaveLandObject.GetLandBitmap())); performFinalLandJoin(masterLandObject, slaveLandObject); } } EventManagerOnParcelPrimCountTainted(); - masterLandObject.sendLandUpdateToAvatarsOverMe(); + masterLandObject.SendLandUpdateToAvatarsOverMe(); } #endregion @@ -894,19 +894,19 @@ namespace OpenSim.Region.CoreModules.World.Land if (currentParcelBlock != null) { - if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) + if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) { //Owner Flag tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); } - else if (currentParcelBlock.landData.SalePrice > 0 && - (currentParcelBlock.landData.AuthBuyerID == UUID.Zero || - currentParcelBlock.landData.AuthBuyerID == remote_client.AgentId)) + else if (currentParcelBlock.LandData.SalePrice > 0 && + (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || + currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) { //Sale Flag tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_IS_FOR_SALE); } - else if (currentParcelBlock.landData.OwnerID == UUID.Zero) + else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) { //Public Flag tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_PUBLIC); @@ -980,7 +980,7 @@ namespace OpenSim.Region.CoreModules.World.Land { if (!temp.Contains(currentParcel)) { - currentParcel.forceUpdateLandInfo(); + currentParcel.ForceUpdateLandInfo(); temp.Add(currentParcel); } } @@ -996,7 +996,7 @@ namespace OpenSim.Region.CoreModules.World.Land for (int i = 0; i < temp.Count; i++) { - temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); + temp[i].SendLandProperties(sequence_id, snap_selection, requestResult, remote_client); } SendParcelOverlay(remote_client); @@ -1010,7 +1010,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_landList.TryGetValue(localID, out land); } - if (land != null) land.updateLandProperties(args, remote_client); + if (land != null) land.UpdateLandProperties(args, remote_client); } public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) @@ -1026,7 +1026,7 @@ namespace OpenSim.Region.CoreModules.World.Land public void ClientOnParcelSelectObjects(int local_id, int request_type, List returnIDs, IClientAPI remote_client) { - m_landList[local_id].sendForceObjectSelect(local_id, request_type, returnIDs, remote_client); + m_landList[local_id].SendForceObjectSelect(local_id, request_type, returnIDs, remote_client); } public void ClientOnParcelObjectOwnerRequest(int local_id, IClientAPI remote_client) @@ -1039,7 +1039,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - m_landList[local_id].sendLandObjectOwners(remote_client); + m_landList[local_id].SendLandObjectOwners(remote_client); } else { @@ -1059,10 +1059,10 @@ namespace OpenSim.Region.CoreModules.World.Land { if (m_scene.Permissions.IsGod(remote_client.AgentId)) { - land.landData.OwnerID = ownerID; + land.LandData.OwnerID = ownerID; m_scene.Broadcast(SendParcelOverlay); - land.sendLandUpdateToClient(remote_client); + land.SendLandUpdateToClient(remote_client); } } } @@ -1080,11 +1080,11 @@ namespace OpenSim.Region.CoreModules.World.Land if (m_scene.Permissions.CanAbandonParcel(remote_client.AgentId, land)) { if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) - land.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; + land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; else - land.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; + land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; m_scene.Broadcast(SendParcelOverlay); - land.sendLandUpdateToClient(remote_client); + land.SendLandUpdateToClient(remote_client); } } } @@ -1102,13 +1102,13 @@ namespace OpenSim.Region.CoreModules.World.Land if (m_scene.Permissions.CanReclaimParcel(remote_client.AgentId, land)) { if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) - land.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; + land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; else - land.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; - land.landData.ClaimDate = Util.UnixTimeSinceEpoch(); - land.landData.IsGroupOwned = false; + land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; + land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); + land.LandData.IsGroupOwned = false; m_scene.Broadcast(SendParcelOverlay); - land.sendLandUpdateToClient(remote_client); + land.SendLandUpdateToClient(remote_client); } } } @@ -1130,7 +1130,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - land.updateLandSold(e.agentId, e.groupId, e.groupOwned, (uint)e.transactionID, e.parcelPrice, e.parcelArea); + land.UpdateLandSold(e.agentId, e.groupId, e.groupOwned, (uint)e.transactionID, e.parcelPrice, e.parcelArea); } } } @@ -1151,11 +1151,11 @@ namespace OpenSim.Region.CoreModules.World.Land if (lob != null) { - UUID AuthorizedID = lob.landData.AuthBuyerID; - int saleprice = lob.landData.SalePrice; - UUID pOwnerID = lob.landData.OwnerID; + UUID AuthorizedID = lob.LandData.AuthBuyerID; + int saleprice = lob.LandData.SalePrice; + UUID pOwnerID = lob.LandData.OwnerID; - bool landforsale = ((lob.landData.Flags & + bool landforsale = ((lob.LandData.Flags & (uint)(ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects)) != 0); if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) { @@ -1184,7 +1184,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - land.deedToGroup(groupID); + land.DeedToGroup(groupID); } } @@ -1203,8 +1203,8 @@ namespace OpenSim.Region.CoreModules.World.Land public void IncomingLandObjectFromStorage(LandData data) { ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); - new_land.landData = data.Copy(); - new_land.setLandBitmapFromByteArray(); + new_land.LandData = data.Copy(); + new_land.SetLandBitmapFromByteArray(); AddLandObject(new_land); } @@ -1218,7 +1218,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (selectedParcel == null) return; - selectedParcel.returnLandObjects(returnType, agentIDs, taskIDs, remoteClient); + selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); } public void EventManagerOnNoLandDataFromStorage() @@ -1234,7 +1234,7 @@ namespace OpenSim.Region.CoreModules.World.Land { foreach (LandObject obj in m_landList.Values) { - obj.setParcelObjectMaxOverride(overrideDel); + obj.SetParcelObjectMaxOverride(overrideDel); } } } @@ -1337,7 +1337,7 @@ namespace OpenSim.Region.CoreModules.World.Land return; } - remoteClient.SendParcelDwellReply(localID, selectedParcel.landData.GlobalID, selectedParcel.landData.Dwell); + remoteClient.SendParcelDwellReply(localID, selectedParcel.LandData.GlobalID, selectedParcel.LandData.Dwell); } private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID) @@ -1345,39 +1345,43 @@ namespace OpenSim.Region.CoreModules.World.Land if (parcelID == UUID.Zero) return; - ExtendedLandData data = (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), delegate(string id) { - UUID parcel = UUID.Zero; - UUID.TryParse(id, out parcel); - // assume we've got the parcelID we just computed in RemoteParcelRequest - ExtendedLandData extLandData = new ExtendedLandData(); - Util.ParseFakeParcelID(parcel, out extLandData.regionHandle, out extLandData.x, out extLandData.y); - m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", - extLandData.regionHandle, extLandData.x, extLandData.y); - - // for this region or for somewhere else? - if (extLandData.regionHandle == m_scene.RegionInfo.RegionHandle) - { - extLandData.landData = this.GetLandObject(extLandData.x, extLandData.y).landData; - } - else - { - ILandService landService = m_scene.RequestModuleInterface(); - extLandData.landData = landService.GetLandData(extLandData.regionHandle, - extLandData.x, - extLandData.y); - if (extLandData.landData == null) - { - // we didn't find the region/land => don't cache - return null; - } - } - return extLandData; - }); + ExtendedLandData data = + (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), + delegate(string id) + { + UUID parcel = UUID.Zero; + UUID.TryParse(id, out parcel); + // assume we've got the parcelID we just computed in RemoteParcelRequest + ExtendedLandData extLandData = new ExtendedLandData(); + Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, + out extLandData.X, out extLandData.Y); + m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", + extLandData.RegionHandle, extLandData.X, extLandData.Y); + + // for this region or for somewhere else? + if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) + { + extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; + } + else + { + ILandService landService = m_scene.RequestModuleInterface(); + extLandData.LandData = landService.GetLandData(extLandData.RegionHandle, + extLandData.X, + extLandData.Y); + if (extLandData.LandData == null) + { + // we didn't find the region/land => don't cache + return null; + } + } + return extLandData; + }); if (data != null) // if we found some data, send it { GridRegion info; - if (data.regionHandle == m_scene.RegionInfo.RegionHandle) + if (data.RegionHandle == m_scene.RegionInfo.RegionHandle) { info = new GridRegion(m_scene.RegionInfo); } @@ -1385,18 +1389,18 @@ namespace OpenSim.Region.CoreModules.World.Land { // most likely still cached from building the extLandData entry uint x = 0, y = 0; - Utils.LongToUInts(data.regionHandle, out x, out y); + Utils.LongToUInts(data.RegionHandle, out x, out y); info = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); } // we need to transfer the fake parcelID, not the one in landData, so the viewer can match it to the landmark. m_log.DebugFormat("[LAND] got parcelinfo for parcel {0} in region {1}; sending...", - data.landData.Name, data.regionHandle); + data.LandData.Name, data.RegionHandle); // HACK for now RegionInfo r = new RegionInfo(); r.RegionName = info.RegionName; r.RegionLocX = (uint)info.RegionLocX; r.RegionLocY = (uint)info.RegionLocY; - remoteClient.SendParcelInfo(r, data.landData, parcelID, data.x, data.y); + remoteClient.SendParcelInfo(r, data.LandData, parcelID, data.X, data.Y); } else m_log.Debug("[LAND] got no parcelinfo; not sending"); @@ -1415,9 +1419,9 @@ namespace OpenSim.Region.CoreModules.World.Land if (!m_scene.Permissions.CanEditParcel(remoteClient.AgentId, land)) return; - land.landData.OtherCleanTime = otherCleanTime; + land.LandData.OtherCleanTime = otherCleanTime; - UpdateLandObject(localID, land.landData); + UpdateLandObject(localID, land.LandData); } } } 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 protected Scene m_scene; protected List primsOverMe = new List(); - public bool[,] landBitmap + public bool[,] LandBitmap { get { return m_landBitmap; } set { m_landBitmap = value; } @@ -63,14 +63,14 @@ namespace OpenSim.Region.CoreModules.World.Land #region ILandObject Members - public LandData landData + public LandData LandData { get { return m_landData; } set { m_landData = value; } } - public UUID regionUUID + public UUID RegionUUID { get { return m_scene.RegionInfo.RegionID; } } @@ -80,8 +80,8 @@ namespace OpenSim.Region.CoreModules.World.Land public LandObject(UUID owner_id, bool is_group_owned, Scene scene) { m_scene = scene; - landData.OwnerID = owner_id; - landData.IsGroupOwned = is_group_owned; + LandData.OwnerID = owner_id; + LandData.IsGroupOwned = is_group_owned; } #endregion @@ -96,11 +96,11 @@ namespace OpenSim.Region.CoreModules.World.Land /// /// /// Returns true if the piece of land contains the specified point - public bool containsPoint(int x, int y) + public bool ContainsPoint(int x, int y) { if (x >= 0 && y >= 0 && x <= Constants.RegionSize && x <= Constants.RegionSize) { - return (landBitmap[x / 4, y / 4] == true); + return (LandBitmap[x / 4, y / 4] == true); } else { @@ -110,11 +110,11 @@ namespace OpenSim.Region.CoreModules.World.Land public ILandObject Copy() { - ILandObject newLand = new LandObject(landData.OwnerID, landData.IsGroupOwned, m_scene); + ILandObject newLand = new LandObject(LandData.OwnerID, LandData.IsGroupOwned, m_scene); //Place all new variables here! - newLand.landBitmap = (bool[,]) (landBitmap.Clone()); - newLand.landData = landData.Copy(); + newLand.LandBitmap = (bool[,]) (LandBitmap.Clone()); + newLand.LandData = LandData.Copy(); return newLand; } @@ -122,16 +122,16 @@ namespace OpenSim.Region.CoreModules.World.Land static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; - public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) + public void SetParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) { overrideParcelMaxPrimCount = overrideDel; } - public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) + public void SetSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) { overrideSimulatorMaxPrimCount = overrideDel; } - public int getParcelMaxPrimCount(ILandObject thisObject) + public int GetParcelMaxPrimCount(ILandObject thisObject) { if (overrideParcelMaxPrimCount != null) { @@ -141,11 +141,11 @@ namespace OpenSim.Region.CoreModules.World.Land { //Normal Calculations return Convert.ToInt32( - Math.Round((Convert.ToDecimal(landData.Area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity * + Math.Round((Convert.ToDecimal(LandData.Area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity * Convert.ToDecimal(m_scene.RegionInfo.RegionSettings.ObjectBonus))); ; } } - public int getSimulatorMaxPrimCount(ILandObject thisObject) + public int GetSimulatorMaxPrimCount(ILandObject thisObject) { if (overrideSimulatorMaxPrimCount != null) { @@ -161,7 +161,7 @@ namespace OpenSim.Region.CoreModules.World.Land #region Packet Request Handling - public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) + public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) { IEstateModule estateModule = m_scene.RequestModuleInterface(); uint regionFlags = 336723974 & ~((uint)(RegionFlags.AllowLandmark | RegionFlags.AllowSetHome)); @@ -175,18 +175,18 @@ namespace OpenSim.Region.CoreModules.World.Land // if (landData.OwnerID == remote_client.AgentId) // regionFlags |= (uint)RegionFlags.AllowSetHome; remote_client.SendLandProperties(sequence_id, - snap_selection, request_result, landData, + snap_selection, request_result, LandData, (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, - getParcelMaxPrimCount(this), - getSimulatorMaxPrimCount(this), regionFlags); + GetParcelMaxPrimCount(this), + GetSimulatorMaxPrimCount(this), regionFlags); } - public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) + public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) { if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) { //Needs later group support - LandData newData = landData.Copy(); + LandData newData = LandData.Copy(); if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) { @@ -212,15 +212,15 @@ namespace OpenSim.Region.CoreModules.World.Land newData.UserLocation = args.UserLocation; newData.UserLookAt = args.UserLookAt; - m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); + m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); - sendLandUpdateToAvatarsOverMe(); + SendLandUpdateToAvatarsOverMe(); } } - public void updateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) + public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) { - LandData newData = landData.Copy(); + LandData newData = LandData.Copy(); newData.OwnerID = avatarID; newData.GroupID = groupID; newData.IsGroupOwned = groupOwned; @@ -230,45 +230,45 @@ namespace OpenSim.Region.CoreModules.World.Land newData.SalePrice = 0; newData.AuthBuyerID = UUID.Zero; newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); - m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); + m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); - sendLandUpdateToAvatarsOverMe(); + SendLandUpdateToAvatarsOverMe(); } - public void deedToGroup(UUID groupID) + public void DeedToGroup(UUID groupID) { - LandData newData = landData.Copy(); + LandData newData = LandData.Copy(); newData.OwnerID = groupID; newData.GroupID = groupID; newData.IsGroupOwned = true; - m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); + m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); - sendLandUpdateToAvatarsOverMe(); + SendLandUpdateToAvatarsOverMe(); } - public bool isEitherBannedOrRestricted(UUID avatar) + public bool IsEitherBannedOrRestricted(UUID avatar) { - if (isBannedFromLand(avatar)) + if (IsBannedFromLand(avatar)) { return true; } - else if (isRestrictedFromLand(avatar)) + else if (IsRestrictedFromLand(avatar)) { return true; } return false; } - public bool isBannedFromLand(UUID avatar) + public bool IsBannedFromLand(UUID avatar) { - if ((landData.Flags & (uint) ParcelFlags.UseBanList) > 0) + if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); entry.AgentID = avatar; entry.Flags = AccessList.Ban; entry.Time = new DateTime(); - if (landData.ParcelAccessList.Contains(entry)) + if (LandData.ParcelAccessList.Contains(entry)) { //They are banned, so lets send them a notice about this parcel return true; @@ -277,15 +277,15 @@ namespace OpenSim.Region.CoreModules.World.Land return false; } - public bool isRestrictedFromLand(UUID avatar) + public bool IsRestrictedFromLand(UUID avatar) { - if ((landData.Flags & (uint) ParcelFlags.UseAccessList) > 0) + if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); entry.AgentID = avatar; entry.Flags = AccessList.Access; entry.Time = new DateTime(); - if (!landData.ParcelAccessList.Contains(entry)) + if (!LandData.ParcelAccessList.Contains(entry)) { //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel return true; @@ -294,12 +294,12 @@ namespace OpenSim.Region.CoreModules.World.Land return false; } - public void sendLandUpdateToClient(IClientAPI remote_client) + public void SendLandUpdateToClient(IClientAPI remote_client) { - sendLandProperties(0, false, 0, remote_client); + SendLandProperties(0, false, 0, remote_client); } - public void sendLandUpdateToAvatarsOverMe() + public void SendLandUpdateToAvatarsOverMe() { List avatars = m_scene.GetAvatars(); ILandObject over = null; @@ -319,14 +319,15 @@ namespace OpenSim.Region.CoreModules.World.Land if (over != null) { - if (over.landData.LocalID == landData.LocalID) + if (over.LandData.LocalID == LandData.LocalID) { - if (((over.landData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && m_scene.RegionInfo.RegionSettings.AllowDamage) + if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && + m_scene.RegionInfo.RegionSettings.AllowDamage) avatars[i].Invulnerable = false; else avatars[i].Invulnerable = true; - sendLandUpdateToClient(avatars[i].ControllingClient); + SendLandUpdateToClient(avatars[i].ControllingClient); } } } @@ -336,10 +337,10 @@ namespace OpenSim.Region.CoreModules.World.Land #region AccessList Functions - public List createAccessListArrayByFlag(AccessList flag) + public List CreateAccessListArrayByFlag(AccessList flag) { List list = new List(); - foreach (ParcelManager.ParcelAccessEntry entry in landData.ParcelAccessList) + foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList) { if (entry.Flags == flag) { @@ -354,26 +355,26 @@ namespace OpenSim.Region.CoreModules.World.Land return list; } - public void sendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, + public void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client) { if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both) { - List avatars = createAccessListArrayByFlag(AccessList.Access); - remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,landData.LocalID); + List avatars = CreateAccessListArrayByFlag(AccessList.Access); + remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,LandData.LocalID); } if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both) { - List avatars = createAccessListArrayByFlag(AccessList.Ban); - remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, landData.LocalID); + List avatars = CreateAccessListArrayByFlag(AccessList.Ban); + remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, LandData.LocalID); } } - public void updateAccessList(uint flags, List entries, IClientAPI remote_client) + public void UpdateAccessList(uint flags, List entries, IClientAPI remote_client) { - LandData newData = landData.Copy(); + LandData newData = LandData.Copy(); if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) { @@ -406,36 +407,36 @@ namespace OpenSim.Region.CoreModules.World.Land } } - m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData); + m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); } #endregion #region Update Functions - public void updateLandBitmapByteArray() + public void UpdateLandBitmapByteArray() { - landData.Bitmap = convertLandBitmapToBytes(); + LandData.Bitmap = ConvertLandBitmapToBytes(); } /// /// Update all settings in land such as area, bitmap byte array, etc /// - public void forceUpdateLandInfo() + public void ForceUpdateLandInfo() { - updateAABBAndAreaValues(); - updateLandBitmapByteArray(); + UpdateAABBAndAreaValues(); + UpdateLandBitmapByteArray(); } - public void setLandBitmapFromByteArray() + public void SetLandBitmapFromByteArray() { - landBitmap = convertBytesToLandBitmap(); + LandBitmap = ConvertBytesToLandBitmap(); } /// /// Updates the AABBMin and AABBMax values after area/shape modification of the land object /// - private void updateAABBAndAreaValues() + private void UpdateAABBAndAreaValues() { int min_x = 64; int min_y = 64; @@ -447,7 +448,7 @@ namespace OpenSim.Region.CoreModules.World.Land { for (y = 0; y < 64; y++) { - if (landBitmap[x, y] == true) + if (LandBitmap[x, y] == true) { if (min_x > x) min_x = x; if (min_y > y) min_y = y; @@ -463,7 +464,7 @@ namespace OpenSim.Region.CoreModules.World.Land int ty = min_y * 4; if (ty > ((int)Constants.RegionSize - 1)) ty = ((int)Constants.RegionSize - 1); - landData.AABBMin = + LandData.AABBMin = new Vector3((float) (min_x * 4), (float) (min_y * 4), (float) m_scene.Heightmap[tx, ty]); @@ -473,10 +474,10 @@ namespace OpenSim.Region.CoreModules.World.Land ty = max_y * 4; if (ty > ((int)Constants.RegionSize - 1)) ty = ((int)Constants.RegionSize - 1); - landData.AABBMax = + LandData.AABBMax = new Vector3((float) (max_x * 4), (float) (max_y * 4), (float) m_scene.Heightmap[tx, ty]); - landData.Area = tempArea; + LandData.Area = tempArea; } #endregion @@ -487,7 +488,7 @@ namespace OpenSim.Region.CoreModules.World.Land /// Sets the land's bitmap manually /// /// 64x64 block representing where this land is on a map - public void setLandBitmap(bool[,] bitmap) + public void SetLandBitmap(bool[,] bitmap) { if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2) { @@ -497,8 +498,8 @@ namespace OpenSim.Region.CoreModules.World.Land else { //Valid: Lets set it - landBitmap = bitmap; - forceUpdateLandInfo(); + LandBitmap = bitmap; + ForceUpdateLandInfo(); } } @@ -506,18 +507,18 @@ namespace OpenSim.Region.CoreModules.World.Land /// Gets the land's bitmap manually /// /// - public bool[,] getLandBitmap() + public bool[,] GetLandBitmap() { - return landBitmap; + return LandBitmap; } /// /// Full sim land object creation /// /// - public bool[,] basicFullRegionLandBitmap() + public bool[,] BasicFullRegionLandBitmap() { - return getSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize); + return GetSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize); } /// @@ -528,12 +529,12 @@ namespace OpenSim.Region.CoreModules.World.Land /// /// /// - public bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y) + public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y) { bool[,] tempBitmap = new bool[64,64]; tempBitmap.Initialize(); - tempBitmap = modifyLandBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true); + tempBitmap = ModifyLandBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true); return tempBitmap; } @@ -547,7 +548,7 @@ namespace OpenSim.Region.CoreModules.World.Land /// /// /// - public bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, + public bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value) { 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 /// /// /// - public bool[,] mergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add) + public bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add) { if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2) { @@ -608,7 +609,7 @@ namespace OpenSim.Region.CoreModules.World.Land /// Converts the land bitmap to a packet friendly byte array /// /// - private byte[] convertLandBitmapToBytes() + private byte[] ConvertLandBitmapToBytes() { byte[] tempConvertArr = new byte[512]; byte tempByte = 0; @@ -618,7 +619,7 @@ namespace OpenSim.Region.CoreModules.World.Land { for (x = 0; x < 64; x++) { - tempByte = Convert.ToByte(tempByte | Convert.ToByte(landBitmap[x, y]) << (i++ % 8)); + tempByte = Convert.ToByte(tempByte | Convert.ToByte(LandBitmap[x, y]) << (i++ % 8)); if (i % 8 == 0) { tempConvertArr[byteNum] = tempByte; @@ -631,7 +632,7 @@ namespace OpenSim.Region.CoreModules.World.Land return tempConvertArr; } - private bool[,] convertBytesToLandBitmap() + private bool[,] ConvertBytesToLandBitmap() { bool[,] tempConvertMap = new bool[landArrayMax, landArrayMax]; tempConvertMap.Initialize(); @@ -639,7 +640,7 @@ namespace OpenSim.Region.CoreModules.World.Land int x = 0, y = 0, i = 0, bitNum = 0; for (i = 0; i < 512; i++) { - tempByte = landData.Bitmap[i]; + tempByte = LandData.Bitmap[i]; for (bitNum = 0; bitNum < 8; bitNum++) { bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte) 1); @@ -659,7 +660,7 @@ namespace OpenSim.Region.CoreModules.World.Land #region Object Select and Object Owner Listing - public void sendForceObjectSelect(int local_id, int request_type, List returnIDs, IClientAPI remote_client) + public void SendForceObjectSelect(int local_id, int request_type, List returnIDs, IClientAPI remote_client) { if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) { @@ -672,11 +673,11 @@ namespace OpenSim.Region.CoreModules.World.Land { if (obj.LocalId > 0) { - if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == landData.OwnerID) + if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == LandData.OwnerID) { resultLocalIDs.Add(obj.LocalId); } - else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID == landData.GroupID && landData.GroupID != UUID.Zero) + else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID == LandData.GroupID && LandData.GroupID != UUID.Zero) { resultLocalIDs.Add(obj.LocalId); } @@ -709,7 +710,7 @@ namespace OpenSim.Region.CoreModules.World.Land /// /// A /// - public void sendLandObjectOwners(IClientAPI remote_client) + public void SendLandObjectOwners(IClientAPI remote_client) { if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) { @@ -752,11 +753,11 @@ namespace OpenSim.Region.CoreModules.World.Land } } - remote_client.SendLandObjectOwners(landData, groups, primCount); + remote_client.SendLandObjectOwners(LandData, groups, primCount); } } - public Dictionary getLandObjectOwners() + public Dictionary GetLandObjectOwners() { Dictionary ownersAndCount = new Dictionary(); lock (primsOverMe) @@ -786,14 +787,14 @@ namespace OpenSim.Region.CoreModules.World.Land #region Object Returning - public void returnObject(SceneObjectGroup obj) + public void ReturnObject(SceneObjectGroup obj) { SceneObjectGroup[] objs = new SceneObjectGroup[1]; objs[0] = obj; m_scene.returnObjects(objs, obj.OwnerID); } - public void returnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) + public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) { Dictionary> returns = new Dictionary>(); @@ -869,19 +870,19 @@ namespace OpenSim.Region.CoreModules.World.Land #region Object Adding/Removing from Parcel - public void resetLandPrimCounts() + public void ResetLandPrimCounts() { - landData.GroupPrims = 0; - landData.OwnerPrims = 0; - landData.OtherPrims = 0; - landData.SelectedPrims = 0; + LandData.GroupPrims = 0; + LandData.OwnerPrims = 0; + LandData.OtherPrims = 0; + LandData.SelectedPrims = 0; lock (primsOverMe) primsOverMe.Clear(); } - public void addPrimToCount(SceneObjectGroup obj) + public void AddPrimToCount(SceneObjectGroup obj) { UUID prim_owner = obj.OwnerID; @@ -889,23 +890,23 @@ namespace OpenSim.Region.CoreModules.World.Land if (obj.IsSelected) { - landData.SelectedPrims += prim_count; + LandData.SelectedPrims += prim_count; } else { - if (prim_owner == landData.OwnerID) + if (prim_owner == LandData.OwnerID) { - landData.OwnerPrims += prim_count; + LandData.OwnerPrims += prim_count; } - else if ((obj.GroupID == landData.GroupID || - prim_owner == landData.GroupID) && - landData.GroupID != UUID.Zero) + else if ((obj.GroupID == LandData.GroupID || + prim_owner == LandData.GroupID) && + LandData.GroupID != UUID.Zero) { - landData.GroupPrims += prim_count; + LandData.GroupPrims += prim_count; } else { - landData.OtherPrims += prim_count; + LandData.OtherPrims += prim_count; } } @@ -913,7 +914,7 @@ namespace OpenSim.Region.CoreModules.World.Land primsOverMe.Add(obj); } - public void removePrimFromCount(SceneObjectGroup obj) + public void RemovePrimFromCount(SceneObjectGroup obj) { lock (primsOverMe) { @@ -922,18 +923,18 @@ namespace OpenSim.Region.CoreModules.World.Land UUID prim_owner = obj.OwnerID; int prim_count = obj.PrimCount; - if (prim_owner == landData.OwnerID) + if (prim_owner == LandData.OwnerID) { - landData.OwnerPrims -= prim_count; + LandData.OwnerPrims -= prim_count; } - else if (obj.GroupID == landData.GroupID || - prim_owner == landData.GroupID) + else if (obj.GroupID == LandData.GroupID || + prim_owner == LandData.GroupID) { - landData.GroupPrims -= prim_count; + LandData.GroupPrims -= prim_count; } else { - landData.OtherPrims -= prim_count; + LandData.OtherPrims -= prim_count; } primsOverMe.Remove(obj); @@ -953,8 +954,8 @@ namespace OpenSim.Region.CoreModules.World.Land /// public void SetMediaUrl(string url) { - landData.MediaURL = url; - sendLandUpdateToAvatarsOverMe(); + LandData.MediaURL = url; + SendLandUpdateToAvatarsOverMe(); } /// @@ -963,8 +964,8 @@ namespace OpenSim.Region.CoreModules.World.Land /// public void SetMusicUrl(string url) { - landData.MusicURL = url; - sendLandUpdateToAvatarsOverMe(); + LandData.MusicURL = url; + SendLandUpdateToAvatarsOverMe(); } } } 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 } } ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); - obj.landData.Name = "NO LAND"; + obj.LandData.Name = "NO LAND"; return obj; } } @@ -118,7 +118,7 @@ public class RegionCombinerLargeLandChannel : ILandChannel } } ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); - obj.landData.Name = "NO LAND"; + obj.LandData.Name = "NO LAND"; return obj; } } 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 // Users should be able to edit what is over their land. ILandObject parcel = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); - if (parcel != null && parcel.landData.OwnerID == user && m_ParcelOwnerIsGod) + if (parcel != null && parcel.LandData.OwnerID == user && m_ParcelOwnerIsGod) { // Admin objects should not be editable by the above if (!IsAdministrator(objectOwner)) @@ -672,7 +672,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions // Users should be able to edit what is over their land. ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); - if ((parcel != null) && (parcel.landData.OwnerID == currentUser)) + if ((parcel != null) && (parcel.LandData.OwnerID == currentUser)) { permission = true; } @@ -740,12 +740,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions { bool permission = false; - if (parcel.landData.OwnerID == user) + if (parcel.LandData.OwnerID == user) { permission = true; } - if ((parcel.landData.GroupID != UUID.Zero) && IsGroupMember(parcel.landData.GroupID, user, groupPowers)) + if ((parcel.LandData.GroupID != UUID.Zero) && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) { permission = true; } @@ -767,12 +767,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions { bool permission = false; - if (parcel.landData.OwnerID == user) + if (parcel.LandData.OwnerID == user) { permission = true; } - if (parcel.landData.IsGroupOwned && IsGroupMember(parcel.landData.GroupID, user, groupPowers)) + if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) { permission = true; } @@ -820,13 +820,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if (parcel.landData.OwnerID != user) // Only the owner can deed! + if (parcel.LandData.OwnerID != user) // Only the owner can deed! return false; ScenePresence sp = scene.GetScenePresence(user); IClientAPI client = sp.ControllingClient; - if ((client.GetGroupPowers(parcel.landData.GroupID) & (ulong)GroupPowers.LandDeed) == 0) + if ((client.GetGroupPowers(parcel.LandData.GroupID) & (ulong)GroupPowers.LandDeed) == 0) return false; return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDeed); @@ -1189,7 +1189,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; } - if ((land.landData.Flags & ((int)ParcelFlags.AllowAPrimitiveEntry)) != 0) + if ((land.LandData.Flags & ((int)ParcelFlags.AllowAPrimitiveEntry)) != 0) { return true; } @@ -1233,7 +1233,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); if (land == null) return false; - if ((land.landData.Flags & ((int)ParcelFlags.CreateObjects)) == + if ((land.LandData.Flags & ((int)ParcelFlags.CreateObjects)) == (int)ParcelFlags.CreateObjects) permission = true; @@ -1360,7 +1360,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; // Others allowed to terraform? - if ((parcel.landData.Flags & ((int)ParcelFlags.AllowTerraform)) != 0) + if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowTerraform)) != 0) return true; // Land owner can terraform too @@ -1693,27 +1693,27 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_bypassPermissions) return m_bypassPermissionsValue; long powers = 0; - if (parcel.landData.GroupID != UUID.Zero) - client.GetGroupPowers(parcel.landData.GroupID); + if (parcel.LandData.GroupID != UUID.Zero) + client.GetGroupPowers(parcel.LandData.GroupID); switch (type) { case (uint)ObjectReturnType.Owner: // Don't let group members return owner's objects, ever // - if (parcel.landData.IsGroupOwned) + if (parcel.LandData.IsGroupOwned) { if ((powers & (long)GroupPowers.ReturnGroupOwned) != 0) return true; } else { - if (parcel.landData.OwnerID != client.AgentId) + if (parcel.LandData.OwnerID != client.AgentId) return false; } return GenericParcelOwnerPermission(client.AgentId, parcel, (ulong)GroupPowers.ReturnGroupOwned); case (uint)ObjectReturnType.Group: - if (parcel.landData.OwnerID != client.AgentId) + if (parcel.LandData.OwnerID != client.AgentId) { // If permissionis granted through a group... // diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs index 005659f..51eacef 100644 --- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs @@ -87,7 +87,7 @@ namespace OpenSim.Region.DataSnapshot.Providers //Index sim land foreach (KeyValuePair curLand in m_scene.LandManager.landList) { - //if ((curLand.Value.landData.landFlags & (uint)ParcelFlags.ShowDirectory) == (uint)ParcelFlags.ShowDirectory) + //if ((curLand.Value.LandData.landFlags & (uint)ParcelFlags.ShowDirectory) == (uint)ParcelFlags.ShowDirectory) //{ m_landIndexed.Add(curLand.Key, curLand.Value.Copy()); //} @@ -135,7 +135,7 @@ namespace OpenSim.Region.DataSnapshot.Providers LandObject land = (LandObject)parcel_interface; - LandData parcel = land.landData; + LandData parcel = land.LandData; if (m_parent.ExposureLevel.Equals("all") || (m_parent.ExposureLevel.Equals("minimum") && (parcel.Flags & (uint)ParcelFlags.ShowDirectory) == (uint)ParcelFlags.ShowDirectory)) @@ -393,26 +393,26 @@ namespace OpenSim.Region.DataSnapshot.Providers { m_log.DebugFormat("[DATASNAPSHOT] trying {0}, {1}", refX, refY); // the point we started with already is in the parcel - if (land.containsPoint((int)refX, (int)refY)) return; + if (land.ContainsPoint((int)refX, (int)refY)) return; // ... otherwise, we have to search for a point within the parcel - uint startX = (uint)land.landData.AABBMin.X; - uint startY = (uint)land.landData.AABBMin.Y; - uint endX = (uint)land.landData.AABBMax.X; - uint endY = (uint)land.landData.AABBMax.Y; + uint startX = (uint)land.LandData.AABBMin.X; + uint startY = (uint)land.LandData.AABBMin.Y; + uint endX = (uint)land.LandData.AABBMax.X; + uint endY = (uint)land.LandData.AABBMax.Y; // default: center of the parcel refX = (startX + endX) / 2; refY = (startY + endY) / 2; // If the center point is within the parcel, take that one - if (land.containsPoint((int)refX, (int)refY)) return; + if (land.ContainsPoint((int)refX, (int)refY)) return; // otherwise, go the long way. for (uint y = startY; y <= endY; ++y) { for (uint x = startX; x <= endX; ++x) { - if (land.containsPoint((int)x, (int)y)) + if (land.ContainsPoint((int)x, (int)y)) { // found a point refX = x; diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs index afd70bb..9639095 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs @@ -139,7 +139,7 @@ namespace OpenSim.Region.DataSnapshot.Providers xmlobject.AppendChild(node); node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", ""); - node.InnerText = land.landData.GlobalID.ToString(); + node.InnerText = land.LandData.GlobalID.ToString(); xmlobject.AppendChild(node); parent.AppendChild(xmlobject); diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs index a4e90d2..c2b1292 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs @@ -37,49 +37,49 @@ namespace OpenSim.Region.Framework.Interfaces public interface ILandObject { - int getParcelMaxPrimCount(ILandObject thisObject); - int getSimulatorMaxPrimCount(ILandObject thisObject); + int GetParcelMaxPrimCount(ILandObject thisObject); + int GetSimulatorMaxPrimCount(ILandObject thisObject); - LandData landData { get; set; } - bool[,] landBitmap { get; set; } - UUID regionUUID { get; } - bool containsPoint(int x, int y); + LandData LandData { get; set; } + bool[,] LandBitmap { get; set; } + UUID RegionUUID { get; } + bool ContainsPoint(int x, int y); ILandObject Copy(); - void sendLandUpdateToAvatarsOverMe(); + void SendLandUpdateToAvatarsOverMe(); - void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client); - void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client); - bool isEitherBannedOrRestricted(UUID avatar); - bool isBannedFromLand(UUID avatar); - bool isRestrictedFromLand(UUID avatar); - void sendLandUpdateToClient(IClientAPI remote_client); - List createAccessListArrayByFlag(AccessList flag); - void sendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); - void updateAccessList(uint flags, List entries, IClientAPI remote_client); - void updateLandBitmapByteArray(); - void setLandBitmapFromByteArray(); - bool[,] getLandBitmap(); - void forceUpdateLandInfo(); - void setLandBitmap(bool[,] bitmap); + void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client); + void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client); + bool IsEitherBannedOrRestricted(UUID avatar); + bool IsBannedFromLand(UUID avatar); + bool IsRestrictedFromLand(UUID avatar); + void SendLandUpdateToClient(IClientAPI remote_client); + List CreateAccessListArrayByFlag(AccessList flag); + void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); + void UpdateAccessList(uint flags, List entries, IClientAPI remote_client); + void UpdateLandBitmapByteArray(); + void SetLandBitmapFromByteArray(); + bool[,] GetLandBitmap(); + void ForceUpdateLandInfo(); + void SetLandBitmap(bool[,] bitmap); - bool[,] basicFullRegionLandBitmap(); - bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y); - bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value); - bool[,] mergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add); - void sendForceObjectSelect(int local_id, int request_type, List returnIDs, IClientAPI remote_client); - void sendLandObjectOwners(IClientAPI remote_client); - void returnObject(SceneObjectGroup obj); - void returnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client); - void resetLandPrimCounts(); - void addPrimToCount(SceneObjectGroup obj); - void removePrimFromCount(SceneObjectGroup obj); - void updateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); + bool[,] BasicFullRegionLandBitmap(); + bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y); + bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value); + bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add); + void SendForceObjectSelect(int local_id, int request_type, List returnIDs, IClientAPI remote_client); + void SendLandObjectOwners(IClientAPI remote_client); + void ReturnObject(SceneObjectGroup obj); + void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client); + void ResetLandPrimCounts(); + void AddPrimToCount(SceneObjectGroup obj); + void RemovePrimFromCount(SceneObjectGroup obj); + void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); - void deedToGroup(UUID groupID); + void DeedToGroup(UUID groupID); - void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); - void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); + void SetParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); + void SetSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); /// /// Set the media url for this land parcel diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 05a6f13..606135b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3206,9 +3206,9 @@ namespace OpenSim.Region.Framework.Scenes ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); if (land != null) { - if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero) + if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) { - agent.startpos = land.landData.UserLocation; + agent.startpos = land.LandData.UserLocation; } } } @@ -3846,13 +3846,13 @@ namespace OpenSim.Region.Framework.Scenes public LandData GetLandData(float x, float y) { - return LandChannel.GetLandObject(x, y).landData; + return LandChannel.GetLandObject(x, y).LandData; } public LandData GetLandData(uint x, uint y) { m_log.DebugFormat("[SCENE]: returning land for {0},{1}", x, y); - return LandChannel.GetLandObject((int)x, (int)y).landData; + return LandChannel.GetLandObject((int)x, (int)y).LandData; } @@ -3880,14 +3880,14 @@ namespace OpenSim.Region.Framework.Scenes { if (parcel != null) { - if ((parcel.landData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) + if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) { return true; } - else if ((parcel.landData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) + else if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) { - if (part.OwnerID == parcel.landData.OwnerID - || (parcel.landData.IsGroupOwned && part.GroupID == parcel.landData.GroupID) + if (part.OwnerID == parcel.LandData.OwnerID + || (parcel.LandData.IsGroupOwned && part.GroupID == parcel.LandData.GroupID) || Permissions.IsGod(part.OwnerID)) { return true; @@ -3899,7 +3899,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - if (part.OwnerID == parcel.landData.OwnerID) + if (part.OwnerID == parcel.LandData.OwnerID) { return true; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 25489d8..6a10618 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1320,15 +1320,15 @@ namespace OpenSim.Region.Framework.Scenes ILandObject parcel = m_scene.LandChannel.GetLandObject( m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y); - if (parcel != null && parcel.landData != null && - parcel.landData.OtherCleanTime != 0) + if (parcel != null && parcel.LandData != null && + parcel.LandData.OtherCleanTime != 0) { - if (parcel.landData.OwnerID != OwnerID && - (parcel.landData.GroupID != GroupID || - parcel.landData.GroupID == UUID.Zero)) + if (parcel.LandData.OwnerID != OwnerID && + (parcel.LandData.GroupID != GroupID || + parcel.LandData.GroupID == UUID.Zero)) { if ((DateTime.Now - RootPart.Rezzed).TotalMinutes > - parcel.landData.OtherCleanTime) + parcel.LandData.OtherCleanTime) { DetachFromBackup(); m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString()); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs index 37c7434..8df020f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs @@ -48,14 +48,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule public string Name { - get { return GetLO().landData.Name; } - set { GetLO().landData.Name = value; } + get { return GetLO().LandData.Name; } + set { GetLO().LandData.Name = value; } } public string Description { - get { return GetLO().landData.Description; } - set { GetLO().landData.Description = value; } + get { return GetLO().LandData.Description; } + set { GetLO().LandData.Description = value; } } public ISocialEntity Owner @@ -66,7 +66,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule public bool[,] Bitmap { - get { return GetLO().landBitmap; } + get { return GetLO().LandBitmap; } } } } diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index da5ea0d..6fcb5d0 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs @@ -191,7 +191,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule foreach (ILandObject landObject in m_los) { - m_parcels.Add(new LOParcel(m_internalScene, landObject.landData.LocalID)); + m_parcels.Add(new LOParcel(m_internalScene, landObject.LandData.LocalID)); } return m_parcels.ToArray(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0bd6546..cb91677 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3899,7 +3899,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // agent must be over the owners land if (m_host.OwnerID == World.LandChannel.GetLandObject( - presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) { presence.ControllingClient.SendTeleportLocationStart(); World.TeleportClientHome(agentId, presence.ControllingClient); @@ -4091,7 +4091,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; // Need provisions for Group Owned here - if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID) + if (m_host.OwnerID == targetlandObj.LandData.OwnerID || + targetlandObj.LandData.IsGroupOwned || m_host.OwnerID == targetID) { pushAllowed = true; } @@ -4107,10 +4108,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { // Parcel push restriction - if ((targetlandObj.landData.Flags & (uint)ParcelFlags.RestrictPushObject) == (uint)ParcelFlags.RestrictPushObject) + if ((targetlandObj.LandData.Flags & (uint)ParcelFlags.RestrictPushObject) == (uint)ParcelFlags.RestrictPushObject) { // Need provisions for Group Owned here - if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID) + if (m_host.OwnerID == targetlandObj.LandData.OwnerID || + targetlandObj.LandData.IsGroupOwned || + m_host.OwnerID == targetID) { pushAllowed = true; } @@ -5442,7 +5445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // agent must be over the owners land if (m_host.OwnerID == World.LandChannel.GetLandObject( - presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) World.TeleportClientHome(agentId, presence.ControllingClient); } } @@ -5532,7 +5535,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (m_host.OwnerID == World.LandChannel.GetLandObject( - presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) return 1; } else // object is not an avatar @@ -5541,7 +5544,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (obj != null) if (m_host.OwnerID == World.LandChannel.GetLandObject( - obj.AbsolutePosition.X, obj.AbsolutePosition.Y).landData.OwnerID) + obj.AbsolutePosition.X, obj.AbsolutePosition.Y).LandData.OwnerID) return 1; } } @@ -5552,7 +5555,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetLandOwnerAt(LSL_Vector pos) { m_host.AddScriptLPS(1); - return World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).landData.OwnerID.ToString(); + return World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).LandData.OwnerID.ToString(); } /// @@ -5621,9 +5624,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ILandObject parcel = World.LandChannel.GetLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y); if (parcel != null) { - if (m_host.ObjectOwner == parcel.landData.OwnerID || - (m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.landData.GroupID - && parcel.landData.IsGroupOwned) || World.Permissions.IsGod(m_host.OwnerID)) + if (m_host.ObjectOwner == parcel.LandData.OwnerID || + (m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.LandData.GroupID + && parcel.LandData.IsGroupOwned) || World.Permissions.IsGod(m_host.OwnerID)) { av.StandUp(); } @@ -6126,7 +6129,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key; - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; + LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; if (land.OwnerID == m_host.OwnerID) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); @@ -7144,7 +7147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (land.landData.OwnerID != m_host.ObjectOwner) + if (land.LandData.OwnerID != m_host.ObjectOwner) return; land.SetMusicUrl(url); @@ -8403,7 +8406,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)? byte loop = 0; - LandData landData = landObject.landData; + LandData landData = landObject.LandData; string url = landData.MediaURL; string texture = landData.MediaID.ToString(); bool autoAlign = landData.MediaAutoScale != 0; @@ -8832,7 +8835,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key; - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; + LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; if (land.OwnerID == m_host.OwnerID) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); @@ -8851,7 +8854,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key; - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; + LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; if (land.OwnerID == m_host.OwnerID) { if (UUID.TryParse(avatar, out key)) @@ -8873,7 +8876,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key; - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; + LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; if (land.OwnerID == m_host.OwnerID) { if (UUID.TryParse(avatar, out key)) @@ -9018,7 +9021,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetParcelFlags(LSL_Vector pos) { m_host.AddScriptLPS(1); - return (int)World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).landData.Flags; + return (int)World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).LandData.Flags; } public LSL_Integer llGetRegionFlags() @@ -9139,7 +9142,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llResetLandBanList() { m_host.AddScriptLPS(1); - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; + LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; if (land.OwnerID == m_host.OwnerID) { foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) @@ -9156,7 +9159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llResetLandPassList() { m_host.AddScriptLPS(1); - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; + LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; if (land.OwnerID == m_host.OwnerID) { foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) @@ -9240,7 +9243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_List ret = new LSL_List(); if (land != null) { - foreach (KeyValuePair detectedParams in land.getLandObjectOwners()) + foreach (KeyValuePair detectedParams in land.GetLandObjectOwners()) { ret.Add(detectedParams.Key.ToString()); ret.Add(detectedParams.Value); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 0b95abc..59525b6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -593,7 +593,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // agent must be over owners land to avoid abuse if (m_host.OwnerID == World.LandChannel.GetLandObject( - presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) { // Check for hostname , attempt to make a hglink @@ -647,7 +647,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // agent must be over owners land to avoid abuse if (m_host.OwnerID == World.LandChannel.GetLandObject( - presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) { presence.ControllingClient.SendTeleportLocationStart(); World.RequestTeleportLocation(presence.ControllingClient, regionHandle, @@ -1164,7 +1164,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (land.landData.OwnerID != m_host.ObjectOwner) + if (land.LandData.OwnerID != m_host.ObjectOwner) return; land.SetMediaUrl(url); @@ -1182,7 +1182,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (land.landData.OwnerID != m_host.ObjectOwner) + if (land.LandData.OwnerID != m_host.ObjectOwner) { OSSLError("osSetParcelSIPAddress: Sorry, you need to own the land to use this function"); return; @@ -1192,7 +1192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IVoiceModule voiceModule = World.RequestModuleInterface(); if (voiceModule != null) - voiceModule.setLandSIPAddress(SIPAddress,land.landData.GlobalID); + voiceModule.setLandSIPAddress(SIPAddress,land.LandData.GlobalID); else OSSLError("osSetParcelSIPAddress: No voice module enabled for this land"); -- cgit v1.1 From 6c068eaf12229ab767fda1a0cd28621f1b893b0c Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Fri, 2 Oct 2009 12:38:13 +0200 Subject: reducing script engine log spam --- OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index dc49549..4e13fb3 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs @@ -305,9 +305,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine if (engine != myScriptEngine.ScriptEngineName) return; - m_log.Debug("OnRezScript localID: " + localID + - " LLUID: " + itemID.ToString() + " Size: " + - script.Length); + // m_log.Debug("OnRezScript localID: " + localID + + // " LLUID: " + itemID.ToString() + " Size: " + + // script.Length); myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script, startParam, postOnRez); @@ -315,7 +315,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public void OnRemoveScript(uint localID, UUID itemID) { - m_log.Debug("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString()); + // m_log.Debug("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString()); myScriptEngine.m_ScriptManager.StopScript( localID, itemID -- cgit v1.1