From 6ef9d4da901a346c232458317cca6268da888e2e Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 18 Aug 2008 00:39:10 +0000 Subject: Formatting cleanup. --- .../Modules/World/Land/LandManagementModule.cs | 85 +++++++--------------- .../Environment/Modules/World/Land/LandObject.cs | 4 +- 2 files changed, 28 insertions(+), 61 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/World/Land') diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 9b1b9b5..00994fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private static readonly string remoteParcelRequestPath = "0009/"; - + private LandChannel landChannel; private Scene m_scene; - - private readonly int[,] landIDList = new int[64, 64]; private readonly Dictionary landList = new Dictionary(); @@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - - public void PostInitialise() { } @@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - - public bool AllowedForcefulBans { get { return m_allowedForcefulBans; } @@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land public List ParcelsNearPoint(LLVector3 position) { List parcelsNear = new List(); - int x; - for (x = -4; x <= 4; x += 4) + for (int x = -4; x <= 4; x += 4) { - int y; - for (y = -4; y <= 4; y += 4) + for (int y = -4; y <= 4; y += 4) { ILandObject check = GetLandObject(position.X + x, position.Y + y); if (check != null) @@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); - if (over != null) { if (force) @@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land Console.WriteLine("INVALID LOCAL LAND ID"); } } + /// /// Creates a basic Parcel object without an owner (a zeroed key) /// @@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land new_land.landData.LocalID = lastLandLocalID; landList.Add(lastLandLocalID, new_land.Copy()); - bool[,] landBitmap = new_land.getLandBitmap(); - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landBitmap[x, y]) { @@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land /// Land.localID of the peice of land to remove. public void removeLandObject(int local_id) { - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landIDList[x, y] == local_id) { @@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land private void performFinalLandJoin(ILandObject master, ILandObject slave) { - int x; bool[,] landBitmapSlave = slave.getLandBitmap(); - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landBitmapSlave[x, y]) { @@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } return landList[landIDList[x / 4, y / 4]]; } + #endregion #region Parcel Modification @@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land ResetAllLandPrimCounts(); lock (m_scene.Entities) { - foreach (EntityBase obj in m_scene.Entities.Values) + foreach (EntityBase obj in m_scene.Entities.Values) { if (obj != null) { @@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land { int totalX = end_x - start_x; int totalY = end_y - start_y; - int y; - for (y = 0; y < totalY; y++) + for (int y = 0; y < totalY; y++) { - int x; - for (x = 0; x < totalX; x++) + for (int x = 0; x < totalX; x++) { ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); if (tempLandObject == null) return; @@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject result = AddLandObject(newLand); UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); result.sendLandUpdateToAvatarsOverMe(); - - - return; } /// @@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject masterLandObject = selectedLandObjects[0]; selectedLandObjects.RemoveAt(0); - if (selectedLandObjects.Count < 1) { return; @@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land performFinalLandJoin(masterLandObject, slaveLandObject); } - SetPrimsTainted(); masterLandObject.sendLandUpdateToAvatarsOverMe(); - - return; } #endregion @@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land int byteArrayCount = 0; int sequenceID = 0; - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { byte tempByte = 0; //This represents the byte for the current 4x4 ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); - if (currentParcelBlock != null) { if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) @@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); } - //Now for border control ILandObject westParcel = null; @@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { //Get the land objects within the bounds List temp = new List(); - int x; - int i; int inc_x = end_x - start_x; int inc_y = end_y - start_y; - for (x = 0; x < inc_x; x++) + for (int x = 0; x < inc_x; x++) { - int y; - for (y = 0; y < inc_y; y++) + for (int y = 0; y < inc_y; y++) { ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); @@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land requestResult = LandChannel.LAND_RESULT_MULTIPLE; } - for (i = 0; i < temp.Count; i++) + for (int i = 0; i < temp.Count; i++) { temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); } - SendParcelOverlay(remote_client); } @@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) { - landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); } @@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land landList[local_id].sendLandUpdateToClient(remote_client); } } - } public void handleParcelReclaim(int local_id, IClientAPI remote_client) @@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land landList[local_id].sendLandUpdateToClient(remote_client); } } - } #endregion @@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land { selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); } - } public void NoLandDataFromStorage() @@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land obj.setParcelObjectMaxOverride(overrideDel); } } + public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) { } #region CAPS handler + private void OnRegisterCaps(LLUUID agentID, Caps caps) { string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return RemoteParcelRequest(request, path, param, agentID, caps); })); } - + // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x @@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); } - + LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); response.parcel_id = parcelID; m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); - + return LLSDHelpers.SerialiseLLSDReply(response); } @@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land uint x, y; Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); - + LandData landData; if (regionHandle == m_scene.RegionInfo.RegionHandle) landData = this.GetLandObject(x, y).landData; diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 305e236..6388a1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return newLand; } - + static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } #endregion - + #region Packet Request Handling public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) -- cgit v1.1