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 +-- 8 files changed, 304 insertions(+), 268 deletions(-) (limited to 'OpenSim/Region/CoreModules') 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... // -- cgit v1.1