aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs74
1 files changed, 37 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 22bc49e..63b8de0 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -52,7 +52,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
52namespace OpenSim.Region.CoreModules.World.Land 52namespace OpenSim.Region.CoreModules.World.Land
53{ 53{
54 // used for caching 54 // used for caching
55 internal class ExtendedLandData 55 internal class ExtendedLandData
56 { 56 {
57 public LandData LandData; 57 public LandData LandData;
58 public ulong RegionHandle; 58 public ulong RegionHandle;
@@ -151,9 +151,9 @@ namespace OpenSim.Region.CoreModules.World.Land
151 151
152 m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd; 152 m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd;
153 m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate; 153 m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate;
154 m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; 154 m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene;
155 m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; 155 m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate;
156 156
157 m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel; 157 m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel;
158 m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement; 158 m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement;
159 m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; 159 m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy;
@@ -163,14 +163,14 @@ namespace OpenSim.Region.CoreModules.World.Land
163 m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; 163 m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement;
164 m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; 164 m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage;
165 m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; 165 m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage;
166 m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; 166 m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan;
167 m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; 167 m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps;
168 168
169 lock (m_scene) 169 lock (m_scene)
170 { 170 {
171 m_scene.LandChannel = (ILandChannel)landChannel; 171 m_scene.LandChannel = (ILandChannel)landChannel;
172 } 172 }
173 173
174 RegisterCommands(); 174 RegisterCommands();
175 } 175 }
176 176
@@ -183,8 +183,8 @@ namespace OpenSim.Region.CoreModules.World.Land
183 } 183 }
184 184
185 public void RemoveRegion(Scene scene) 185 public void RemoveRegion(Scene scene)
186 { 186 {
187 // TODO: Release event manager listeners here 187 // TODO: Release event manager listeners here
188 } 188 }
189 189
190// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) 190// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason)
@@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.World.Land
192// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); 192// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y);
193// reason = "You are not allowed to enter this sim."; 193// reason = "You are not allowed to enter this sim.";
194// return nearestParcel != null; 194// return nearestParcel != null;
195// } 195// }
196 196
197 void EventManagerOnNewClient(IClientAPI client) 197 void EventManagerOnNewClient(IClientAPI client)
198 { 198 {
@@ -274,7 +274,7 @@ namespace OpenSim.Region.CoreModules.World.Land
274 m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; 274 m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit];
275 } 275 }
276 } 276 }
277 277
278 /// <summary> 278 /// <summary>
279 /// Create a default parcel that spans the entire region and is owned by the estate owner. 279 /// Create a default parcel that spans the entire region and is owned by the estate owner.
280 /// </summary> 280 /// </summary>
@@ -360,7 +360,7 @@ namespace OpenSim.Region.CoreModules.World.Land
360 return false; 360 return false;
361 } 361 }
362 } 362 }
363 363
364 if(ban) 364 if(ban)
365 { 365 {
366 if (!forcedPosition.Contains(avatar.UUID)) 366 if (!forcedPosition.Contains(avatar.UUID))
@@ -581,13 +581,13 @@ namespace OpenSim.Region.CoreModules.World.Land
581 /// Adds a land object to the stored list and adds them to the landIDList to what they own 581 /// Adds a land object to the stored list and adds them to the landIDList to what they own
582 /// </summary> 582 /// </summary>
583 /// <param name="new_land"> 583 /// <param name="new_land">
584 /// The land object being added. 584 /// The land object being added.
585 /// Will return null if this overlaps with an existing parcel that has not had its bitmap adjusted. 585 /// Will return null if this overlaps with an existing parcel that has not had its bitmap adjusted.
586 /// </param> 586 /// </param>
587 public ILandObject AddLandObject(ILandObject land) 587 public ILandObject AddLandObject(ILandObject land)
588 { 588 {
589 ILandObject new_land = land.Copy(); 589 ILandObject new_land = land.Copy();
590 590
591 // Only now can we add the prim counts to the land object - we rely on the global ID which is generated 591 // Only now can we add the prim counts to the land object - we rely on the global ID which is generated
592 // as a random UUID inside LandData initialization 592 // as a random UUID inside LandData initialization
593 if (m_primCountModule != null) 593 if (m_primCountModule != null)
@@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Land
607 } 607 }
608 else 608 else
609 { 609 {
610 // If other land objects still believe that they occupy any parts of the same space, 610 // If other land objects still believe that they occupy any parts of the same space,
611 // then do not allow the add to proceed. 611 // then do not allow the add to proceed.
612 for (int x = 0; x < landBitmap.GetLength(0); x++) 612 for (int x = 0; x < landBitmap.GetLength(0); x++)
613 { 613 {
@@ -642,7 +642,7 @@ namespace OpenSim.Region.CoreModules.World.Land
642 if (landBitmap[x, y]) 642 if (landBitmap[x, y])
643 { 643 {
644 // m_log.DebugFormat( 644 // m_log.DebugFormat(
645 // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", 645 // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}",
646 // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); 646 // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName);
647 647
648 m_landIDList[x, y] = newLandLocalID; 648 m_landIDList[x, y] = newLandLocalID;
@@ -690,10 +690,10 @@ namespace OpenSim.Region.CoreModules.World.Land
690 690
691 m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); 691 m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID);
692 } 692 }
693 693
694 /// <summary> 694 /// <summary>
695 /// Clear the scene of all parcels 695 /// Clear the scene of all parcels
696 /// </summary> 696 /// </summary>
697 public void Clear(bool setupDefaultParcel) 697 public void Clear(bool setupDefaultParcel)
698 { 698 {
699 Dictionary<int, ILandObject> landworkList; 699 Dictionary<int, ILandObject> landworkList;
@@ -1077,7 +1077,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1077 1077
1078 if(maxindex < 0 || selectedLandObjects.Count < 2) 1078 if(maxindex < 0 || selectedLandObjects.Count < 2)
1079 return; 1079 return;
1080 1080
1081 ILandObject masterLandObject = selectedLandObjects[maxindex]; 1081 ILandObject masterLandObject = selectedLandObjects[maxindex];
1082 selectedLandObjects.RemoveAt(maxindex); 1082 selectedLandObjects.RemoveAt(maxindex);
1083 1083
@@ -1146,7 +1146,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1146 1146
1147 if (currentParcelBlock != null) 1147 if (currentParcelBlock != null)
1148 { 1148 {
1149 // types 1149 // types
1150 if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) 1150 if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId)
1151 { 1151 {
1152 //Owner Flag 1152 //Owner Flag
@@ -1165,7 +1165,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1165 } 1165 }
1166 else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) 1166 else if (currentParcelBlock.LandData.OwnerID == UUID.Zero)
1167 { 1167 {
1168 //Public type 1168 //Public type
1169 tempByte = (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero 1169 tempByte = (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero
1170 } 1170 }
1171 // LAND_TYPE_IS_BEING_AUCTIONED still unsuported 1171 // LAND_TYPE_IS_BEING_AUCTIONED still unsuported
@@ -1402,7 +1402,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1402 land.LandData.GroupID = UUID.Zero; 1402 land.LandData.GroupID = UUID.Zero;
1403 land.LandData.IsGroupOwned = false; 1403 land.LandData.IsGroupOwned = false;
1404 land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); 1404 land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
1405 1405
1406 m_scene.ForEachClient(SendParcelOverlay); 1406 m_scene.ForEachClient(SendParcelOverlay);
1407 land.SendLandUpdateToClient(true, remote_client); 1407 land.SendLandUpdateToClient(true, remote_client);
1408 UpdateLandObject(land.LandData.LocalID, land.LandData); 1408 UpdateLandObject(land.LandData.LocalID, land.LandData);
@@ -1584,7 +1584,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1584 ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); 1584 ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
1585 new_land.LandData = data.Copy(); 1585 new_land.LandData = data.Copy();
1586 1586
1587 new_land.SetLandBitmapFromByteArray(); 1587 new_land.SetLandBitmapFromByteArray();
1588 AddLandObject(new_land); 1588 AddLandObject(new_land);
1589// new_land.SendLandUpdateToAvatarsOverMe(); 1589// new_land.SendLandUpdateToAvatarsOverMe();
1590 } 1590 }
@@ -1599,7 +1599,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1599 m_landList.TryGetValue(localID, out selectedParcel); 1599 m_landList.TryGetValue(localID, out selectedParcel);
1600 } 1600 }
1601 1601
1602 if (selectedParcel == null) 1602 if (selectedParcel == null)
1603 return; 1603 return;
1604 1604
1605 selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); 1605 selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient);
@@ -1706,7 +1706,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1706 private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) 1706 private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps)
1707 { 1707 {
1708 IClientAPI client; 1708 IClientAPI client;
1709 if (!m_scene.TryGetClient(agentID, out client)) 1709 if (!m_scene.TryGetClient(agentID, out client))
1710 { 1710 {
1711 m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to retrieve IClientAPI for {0}", agentID); 1711 m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to retrieve IClientAPI for {0}", agentID);
1712 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); 1712 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
@@ -1765,7 +1765,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1765 1765
1766 if (land != null) 1766 if (land != null)
1767 { 1767 {
1768 UpdateLandProperties(land,land_update, client); 1768 UpdateLandProperties(land,land_update, client);
1769 m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); 1769 m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client);
1770 } 1770 }
1771 else 1771 else
@@ -2103,7 +2103,7 @@ namespace OpenSim.Region.CoreModules.World.Land
2103 targetAvatar.TeleportWithMomentum(pos, null); 2103 targetAvatar.TeleportWithMomentum(pos, null);
2104 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); 2104 targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
2105 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); 2105 parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
2106 2106
2107 if ((flags & 1) != 0) // Ban TODO: Remove magic number 2107 if ((flags & 1) != 0) // Ban TODO: Remove magic number
2108 { 2108 {
2109 LandAccessEntry entry = new LandAccessEntry(); 2109 LandAccessEntry entry = new LandAccessEntry();
@@ -2144,7 +2144,7 @@ namespace OpenSim.Region.CoreModules.World.Land
2144 if (// Required: local user; foreign users cannot set home 2144 if (// Required: local user; foreign users cannot set home
2145 m_scene.UserManagementModule.IsLocalGridUser(remoteClient.AgentId) && 2145 m_scene.UserManagementModule.IsLocalGridUser(remoteClient.AgentId) &&
2146 (// (a) gods and land managers can set home 2146 (// (a) gods and land managers can set home
2147 m_scene.Permissions.IsAdministrator(remoteClient.AgentId) || 2147 m_scene.Permissions.IsAdministrator(remoteClient.AgentId) ||
2148 m_scene.Permissions.IsGod(remoteClient.AgentId) || 2148 m_scene.Permissions.IsGod(remoteClient.AgentId) ||
2149 // (b) land owners can set home 2149 // (b) land owners can set home
2150 remoteClient.AgentId == land.LandData.OwnerID || 2150 remoteClient.AgentId == land.LandData.OwnerID ||
@@ -2196,8 +2196,8 @@ namespace OpenSim.Region.CoreModules.World.Land
2196 "If no local land ID is given, then summary information about all the parcels is shown.\n" 2196 "If no local land ID is given, then summary information about all the parcels is shown.\n"
2197 + "If a local land ID is given then full information about that parcel is shown.", 2197 + "If a local land ID is given then full information about that parcel is shown.",
2198 HandleShowCommand); 2198 HandleShowCommand);
2199 } 2199 }
2200 2200
2201 protected void HandleClearCommand(string module, string[] args) 2201 protected void HandleClearCommand(string module, string[] args)
2202 { 2202 {
2203 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) 2203 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
@@ -2205,9 +2205,9 @@ namespace OpenSim.Region.CoreModules.World.Land
2205 2205
2206 string response = MainConsole.Instance.CmdPrompt( 2206 string response = MainConsole.Instance.CmdPrompt(
2207 string.Format( 2207 string.Format(
2208 "Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name), 2208 "Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name),
2209 "n"); 2209 "n");
2210 2210
2211 if (response.ToLower() == "y") 2211 if (response.ToLower() == "y")
2212 { 2212 {
2213 Clear(true); 2213 Clear(true);
@@ -2217,14 +2217,14 @@ namespace OpenSim.Region.CoreModules.World.Land
2217 { 2217 {
2218 MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.Name); 2218 MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.Name);
2219 } 2219 }
2220 } 2220 }
2221 2221
2222 protected void HandleShowCommand(string module, string[] args) 2222 protected void HandleShowCommand(string module, string[] args)
2223 { 2223 {
2224 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) 2224 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
2225 return; 2225 return;
2226 2226
2227 StringBuilder report = new StringBuilder(); 2227 StringBuilder report = new StringBuilder();
2228 2228
2229 if (args.Length <= 2) 2229 if (args.Length <= 2)
2230 { 2230 {
@@ -2240,7 +2240,7 @@ namespace OpenSim.Region.CoreModules.World.Land
2240 ILandObject lo; 2240 ILandObject lo;
2241 2241
2242 lock (m_landList) 2242 lock (m_landList)
2243 { 2243 {
2244 if (!m_landList.TryGetValue(landLocalId, out lo)) 2244 if (!m_landList.TryGetValue(landLocalId, out lo))
2245 { 2245 {
2246 MainConsole.Instance.OutputFormat("No parcel found with local ID {0}", landLocalId); 2246 MainConsole.Instance.OutputFormat("No parcel found with local ID {0}", landLocalId);
@@ -2265,7 +2265,7 @@ namespace OpenSim.Region.CoreModules.World.Land
2265 cdt.AddColumn("Starts", ConsoleDisplayUtil.VectorSize); 2265 cdt.AddColumn("Starts", ConsoleDisplayUtil.VectorSize);
2266 cdt.AddColumn("Ends", ConsoleDisplayUtil.VectorSize); 2266 cdt.AddColumn("Ends", ConsoleDisplayUtil.VectorSize);
2267 cdt.AddColumn("Owner", ConsoleDisplayUtil.UserNameSize); 2267 cdt.AddColumn("Owner", ConsoleDisplayUtil.UserNameSize);
2268 2268
2269 lock (m_landList) 2269 lock (m_landList)
2270 { 2270 {
2271 foreach (ILandObject lo in m_landList.Values) 2271 foreach (ILandObject lo in m_landList.Values)
@@ -2316,7 +2316,7 @@ namespace OpenSim.Region.CoreModules.World.Land
2316 cdl.AddRow("GroupID", ld.GroupID); 2316 cdl.AddRow("GroupID", ld.GroupID);
2317 2317
2318 cdl.AddRow("Status", ld.Status); 2318 cdl.AddRow("Status", ld.Status);
2319 cdl.AddRow("Flags", (ParcelFlags)ld.Flags); 2319 cdl.AddRow("Flags", (ParcelFlags)ld.Flags);
2320 2320
2321 cdl.AddRow("Landing Type", (LandingType)ld.LandingType); 2321 cdl.AddRow("Landing Type", (LandingType)ld.LandingType);
2322 cdl.AddRow("User Location", ld.UserLocation); 2322 cdl.AddRow("User Location", ld.UserLocation);