diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
6 files changed, 269 insertions, 269 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 9de88d9..e4c0373 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
51 | public const int LAND_SELECT_OBJECTS_GROUP = 4; | 51 | public const int LAND_SELECT_OBJECTS_GROUP = 4; |
52 | public const int LAND_SELECT_OBJECTS_OTHER = 8; | 52 | public const int LAND_SELECT_OBJECTS_OTHER = 8; |
53 | 53 | ||
54 | 54 | ||
55 | public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 | 55 | public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 |
56 | // types 1 to 7 are exclusive | 56 | // types 1 to 7 are exclusive |
57 | public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 | 57 | public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 |
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
75 | #endregion | 75 | #endregion |
76 | 76 | ||
77 | private readonly Scene m_scene; | 77 | private readonly Scene m_scene; |
78 | private readonly LandManagementModule m_landManagementModule; | 78 | private readonly LandManagementModule m_landManagementModule; |
79 | 79 | ||
80 | public LandChannel(Scene scene, LandManagementModule landManagementMod) | 80 | public LandChannel(Scene scene, LandManagementModule landManagementMod) |
81 | { | 81 | { |
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
91 | { | 91 | { |
92 | return m_landManagementModule.GetLandObject(x_float, y_float); | 92 | return m_landManagementModule.GetLandObject(x_float, y_float); |
93 | } | 93 | } |
94 | 94 | ||
95 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | 95 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
96 | obj.LandData.Name = "NO LAND"; | 96 | obj.LandData.Name = "NO LAND"; |
97 | return obj; | 97 | return obj; |
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
117 | { | 117 | { |
118 | return m_landManagementModule.GetLandObject(x, y); | 118 | return m_landManagementModule.GetLandObject(x, y); |
119 | } | 119 | } |
120 | 120 | ||
121 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | 121 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
122 | obj.LandData.Name = "NO LAND"; | 122 | obj.LandData.Name = "NO LAND"; |
123 | return obj; | 123 | return obj; |
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
132 | 132 | ||
133 | return new List<ILandObject>(); | 133 | return new List<ILandObject>(); |
134 | } | 134 | } |
135 | 135 | ||
136 | public void Clear(bool setupDefaultParcel) | 136 | public void Clear(bool setupDefaultParcel) |
137 | { | 137 | { |
138 | if (m_landManagementModule != null) | 138 | if (m_landManagementModule != null) |
@@ -182,7 +182,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
182 | m_landManagementModule.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); | 182 | m_landManagementModule.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); |
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | 186 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |
187 | { | 187 | { |
188 | if (m_landManagementModule != null) | 188 | if (m_landManagementModule != null) |
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; | |||
52 | namespace OpenSim.Region.CoreModules.World.Land | 52 | namespace 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); |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 4cbc8b8..fc2282d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
75 | return free; | 75 | return free; |
76 | } | 76 | } |
77 | 77 | ||
78 | protected LandData m_landData; | 78 | protected LandData m_landData; |
79 | public LandData LandData | 79 | public LandData LandData |
80 | { | 80 | { |
81 | get { return m_landData; } | 81 | get { return m_landData; } |
@@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
196 | else if(testpos.Y >= maxy) | 196 | else if(testpos.Y >= maxy) |
197 | return null; // will never get there | 197 | return null; // will never get there |
198 | } | 198 | } |
199 | 199 | ||
200 | while(!LandBitmap[(int)testpos.X, (int)testpos.Y]) | 200 | while(!LandBitmap[(int)testpos.X, (int)testpos.Y]) |
201 | { | 201 | { |
202 | testpos += direction; | 202 | testpos += direction; |
@@ -278,14 +278,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
278 | else | 278 | else |
279 | LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; | 279 | LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; |
280 | 280 | ||
281 | LandData = new LandData(); | 281 | LandData = new LandData(); |
282 | LandData.OwnerID = owner_id; | 282 | LandData.OwnerID = owner_id; |
283 | if (is_group_owned) | 283 | if (is_group_owned) |
284 | LandData.GroupID = owner_id; | 284 | LandData.GroupID = owner_id; |
285 | else | 285 | else |
286 | LandData.GroupID = UUID.Zero; | 286 | LandData.GroupID = UUID.Zero; |
287 | LandData.IsGroupOwned = is_group_owned; | 287 | LandData.IsGroupOwned = is_group_owned; |
288 | 288 | ||
289 | m_scene.EventManager.OnFrame += OnFrame; | 289 | m_scene.EventManager.OnFrame += OnFrame; |
290 | } | 290 | } |
291 | 291 | ||
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
294 | #region Member Functions | 294 | #region Member Functions |
295 | 295 | ||
296 | #region General Functions | 296 | #region General Functions |
297 | 297 | ||
298 | /// <summary> | 298 | /// <summary> |
299 | /// Checks to see if this land object contains a point | 299 | /// Checks to see if this land object contains a point |
300 | /// </summary> | 300 | /// </summary> |
@@ -373,12 +373,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
373 | 373 | ||
374 | if(simMax > m_scene.RegionInfo.ObjectCapacity) | 374 | if(simMax > m_scene.RegionInfo.ObjectCapacity) |
375 | simMax = m_scene.RegionInfo.ObjectCapacity; | 375 | simMax = m_scene.RegionInfo.ObjectCapacity; |
376 | //m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}, SimWidePrims {3}", | 376 | //m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}, SimWidePrims {3}", |
377 | // LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax, LandData.SimwidePrims); | 377 | // LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax, LandData.SimwidePrims); |
378 | return simMax; | 378 | return simMax; |
379 | } | 379 | } |
380 | } | 380 | } |
381 | 381 | ||
382 | #endregion | 382 | #endregion |
383 | 383 | ||
384 | #region Packet Request Handling | 384 | #region Packet Request Handling |
@@ -552,7 +552,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
552 | needOverlay = true; | 552 | needOverlay = true; |
553 | 553 | ||
554 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 554 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
555 | return true; | 555 | return true; |
556 | } | 556 | } |
557 | return false; | 557 | return false; |
558 | } | 558 | } |
@@ -720,11 +720,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
720 | 720 | ||
721 | if(sp==null || !sp.isNPC) | 721 | if(sp==null || !sp.isNPC) |
722 | return true; | 722 | return true; |
723 | 723 | ||
724 | INPC npccli = (INPC)sp.ControllingClient; | 724 | INPC npccli = (INPC)sp.ControllingClient; |
725 | if(npccli== null) | 725 | if(npccli== null) |
726 | return true; | 726 | return true; |
727 | 727 | ||
728 | UUID owner = npccli.Owner; | 728 | UUID owner = npccli.Owner; |
729 | 729 | ||
730 | if(owner == UUID.Zero) | 730 | if(owner == UUID.Zero) |
@@ -898,7 +898,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
898 | // update use lists flags | 898 | // update use lists flags |
899 | // rights already checked or we wont be here | 899 | // rights already checked or we wont be here |
900 | uint parcelflags = newData.Flags; | 900 | uint parcelflags = newData.Flags; |
901 | 901 | ||
902 | if((flags & (uint)AccessList.Access) != 0) | 902 | if((flags & (uint)AccessList.Access) != 0) |
903 | parcelflags |= (uint)ParcelFlags.UseAccessList; | 903 | parcelflags |= (uint)ParcelFlags.UseAccessList; |
904 | if((flags & (uint)AccessList.Ban) != 0) | 904 | if((flags & (uint)AccessList.Ban) != 0) |
@@ -1024,7 +1024,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1024 | LandData.AABBMin = new Vector3(tx, ty, 0f); | 1024 | LandData.AABBMin = new Vector3(tx, ty, 0f); |
1025 | else | 1025 | else |
1026 | LandData.AABBMin = new Vector3(tx, ty, (float)m_scene.Heightmap[tx, ty]); | 1026 | LandData.AABBMin = new Vector3(tx, ty, (float)m_scene.Heightmap[tx, ty]); |
1027 | 1027 | ||
1028 | max_x++; | 1028 | max_x++; |
1029 | tx = max_x * landUnit; | 1029 | tx = max_x * landUnit; |
1030 | if (tx > regionSizeX) | 1030 | if (tx > regionSizeX) |
@@ -1042,7 +1042,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1042 | LandData.AABBMax = new Vector3(tx, ty, 0f); | 1042 | LandData.AABBMax = new Vector3(tx, ty, 0f); |
1043 | else | 1043 | else |
1044 | LandData.AABBMax = new Vector3(tx, ty, (float)m_scene.Heightmap[tx - 1, ty - 1]); | 1044 | LandData.AABBMax = new Vector3(tx, ty, (float)m_scene.Heightmap[tx - 1, ty - 1]); |
1045 | 1045 | ||
1046 | LandData.Area = tempArea * landUnit * landUnit; | 1046 | LandData.Area = tempArea * landUnit * landUnit; |
1047 | } | 1047 | } |
1048 | 1048 | ||
@@ -1073,7 +1073,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1073 | { | 1073 | { |
1074 | return GetSquareLandBitmap(0, 0, (int)m_scene.RegionInfo.RegionSizeX, (int) m_scene.RegionInfo.RegionSizeY, true); | 1074 | return GetSquareLandBitmap(0, 0, (int)m_scene.RegionInfo.RegionSizeX, (int) m_scene.RegionInfo.RegionSizeY, true); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y, bool set_value = true) | 1077 | public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y, bool set_value = true) |
1078 | { | 1078 | { |
1079 | // Empty bitmap for the whole region | 1079 | // Empty bitmap for the whole region |
@@ -1317,7 +1317,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1317 | /// <param name="isEmptyNow">out: This is set if the resultant bitmap is now empty</param> | 1317 | /// <param name="isEmptyNow">out: This is set if the resultant bitmap is now empty</param> |
1318 | /// <param name="AABBMin">out: parcel.AABBMin <x,y,0></param> | 1318 | /// <param name="AABBMin">out: parcel.AABBMin <x,y,0></param> |
1319 | /// <param name="AABBMax">out: parcel.AABBMax <x,y,0></param> | 1319 | /// <param name="AABBMax">out: parcel.AABBMax <x,y,0></param> |
1320 | /// <returns>New parcel bitmap</returns> | 1320 | /// <returns>New parcel bitmap</returns> |
1321 | public bool[,] RemoveFromLandBitmap(bool[,] bitmap_base, bool[,] bitmap_new, out bool isEmptyNow, out Vector3 AABBMin, out Vector3 AABBMax) | 1321 | public bool[,] RemoveFromLandBitmap(bool[,] bitmap_base, bool[,] bitmap_new, out bool isEmptyNow, out Vector3 AABBMin, out Vector3 AABBMax) |
1322 | { | 1322 | { |
1323 | // get the size of the incoming bitmaps | 1323 | // get the size of the incoming bitmaps |
@@ -1409,7 +1409,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1409 | // Importing land parcel data from an OAR where the source region is a different size to the dest region requires us | 1409 | // Importing land parcel data from an OAR where the source region is a different size to the dest region requires us |
1410 | // to make a LandBitmap that's not derived from the current region's size. We use the LandData.Bitmap size in bytes | 1410 | // to make a LandBitmap that's not derived from the current region's size. We use the LandData.Bitmap size in bytes |
1411 | // to figure out what the OAR's region dimensions are. (Is there a better way to get the src region x and y from the OAR?) | 1411 | // to figure out what the OAR's region dimensions are. (Is there a better way to get the src region x and y from the OAR?) |
1412 | // This method assumes we always will have square regions | 1412 | // This method assumes we always will have square regions |
1413 | 1413 | ||
1414 | bitmapLen = LandData.Bitmap.Length; | 1414 | bitmapLen = LandData.Bitmap.Length; |
1415 | xLen = (int)Math.Abs(Math.Sqrt(bitmapLen * 8)); | 1415 | xLen = (int)Math.Abs(Math.Sqrt(bitmapLen * 8)); |
@@ -1550,9 +1550,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1550 | lock (primsOverMe) | 1550 | lock (primsOverMe) |
1551 | { | 1551 | { |
1552 | // m_log.DebugFormat( | 1552 | // m_log.DebugFormat( |
1553 | // "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", | 1553 | // "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", |
1554 | // remote_client.Name, primsOverMe.Count); | 1554 | // remote_client.Name, primsOverMe.Count); |
1555 | 1555 | ||
1556 | try | 1556 | try |
1557 | { | 1557 | { |
1558 | foreach (SceneObjectGroup obj in primsOverMe) | 1558 | foreach (SceneObjectGroup obj in primsOverMe) |
@@ -1593,7 +1593,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1593 | public Dictionary<UUID, int> GetLandObjectOwners() | 1593 | public Dictionary<UUID, int> GetLandObjectOwners() |
1594 | { | 1594 | { |
1595 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); | 1595 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); |
1596 | 1596 | ||
1597 | lock (primsOverMe) | 1597 | lock (primsOverMe) |
1598 | { | 1598 | { |
1599 | try | 1599 | try |
@@ -1669,7 +1669,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1669 | { | 1669 | { |
1670 | // m_log.DebugFormat( | 1670 | // m_log.DebugFormat( |
1671 | // "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name); | 1671 | // "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name); |
1672 | 1672 | ||
1673 | Dictionary<UUID,List<SceneObjectGroup>> returns = new Dictionary<UUID,List<SceneObjectGroup>>(); | 1673 | Dictionary<UUID,List<SceneObjectGroup>> returns = new Dictionary<UUID,List<SceneObjectGroup>>(); |
1674 | 1674 | ||
1675 | lock (primsOverMe) | 1675 | lock (primsOverMe) |
@@ -1752,7 +1752,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1752 | public void AddPrimOverMe(SceneObjectGroup obj) | 1752 | public void AddPrimOverMe(SceneObjectGroup obj) |
1753 | { | 1753 | { |
1754 | // m_log.DebugFormat("[LAND OBJECT]: Adding scene object {0} {1} over {2}", obj.Name, obj.LocalId, LandData.Name); | 1754 | // m_log.DebugFormat("[LAND OBJECT]: Adding scene object {0} {1} over {2}", obj.Name, obj.LocalId, LandData.Name); |
1755 | 1755 | ||
1756 | lock (primsOverMe) | 1756 | lock (primsOverMe) |
1757 | primsOverMe.Add(obj); | 1757 | primsOverMe.Add(obj); |
1758 | } | 1758 | } |
@@ -1760,13 +1760,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1760 | public void RemovePrimFromOverMe(SceneObjectGroup obj) | 1760 | public void RemovePrimFromOverMe(SceneObjectGroup obj) |
1761 | { | 1761 | { |
1762 | // m_log.DebugFormat("[LAND OBJECT]: Removing scene object {0} {1} from over {2}", obj.Name, obj.LocalId, LandData.Name); | 1762 | // m_log.DebugFormat("[LAND OBJECT]: Removing scene object {0} {1} from over {2}", obj.Name, obj.LocalId, LandData.Name); |
1763 | 1763 | ||
1764 | lock (primsOverMe) | 1764 | lock (primsOverMe) |
1765 | primsOverMe.Remove(obj); | 1765 | primsOverMe.Remove(obj); |
1766 | } | 1766 | } |
1767 | 1767 | ||
1768 | #endregion | 1768 | #endregion |
1769 | 1769 | ||
1770 | /// <summary> | 1770 | /// <summary> |
1771 | /// Set the media url for this land parcel | 1771 | /// Set the media url for this land parcel |
1772 | /// </summary> | 1772 | /// </summary> |
@@ -1777,7 +1777,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1777 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, LandData); | 1777 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, LandData); |
1778 | SendLandUpdateToAvatarsOverMe(); | 1778 | SendLandUpdateToAvatarsOverMe(); |
1779 | } | 1779 | } |
1780 | 1780 | ||
1781 | /// <summary> | 1781 | /// <summary> |
1782 | /// Set the music url for this land parcel | 1782 | /// Set the music url for this land parcel |
1783 | /// </summary> | 1783 | /// </summary> |
@@ -1824,7 +1824,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1824 | { | 1824 | { |
1825 | LandData.ParcelAccessList.Remove(entry); | 1825 | LandData.ParcelAccessList.Remove(entry); |
1826 | ScenePresence presence; | 1826 | ScenePresence presence; |
1827 | 1827 | ||
1828 | if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent)) | 1828 | if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent)) |
1829 | { | 1829 | { |
1830 | ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); | 1830 | ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); |
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index 771fdd2..857f919 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | |||
@@ -69,11 +69,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
69 | /// For now, a simple simwide taint to get this up. Later parcel based | 69 | /// For now, a simple simwide taint to get this up. Later parcel based |
70 | /// taint to allow recounting a parcel if only ownership has changed | 70 | /// taint to allow recounting a parcel if only ownership has changed |
71 | /// without recounting the whole sim. | 71 | /// without recounting the whole sim. |
72 | /// | 72 | /// |
73 | /// We start out tainted so that the first get call resets the various prim counts. | 73 | /// We start out tainted so that the first get call resets the various prim counts. |
74 | /// </value> | 74 | /// </value> |
75 | private bool m_Tainted = true; | 75 | private bool m_Tainted = true; |
76 | 76 | ||
77 | private Object m_TaintLock = new Object(); | 77 | private Object m_TaintLock = new Object(); |
78 | 78 | ||
79 | public Type ReplaceableInterface | 79 | public Type ReplaceableInterface |
@@ -88,10 +88,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
88 | public void AddRegion(Scene scene) | 88 | public void AddRegion(Scene scene) |
89 | { | 89 | { |
90 | m_Scene = scene; | 90 | m_Scene = scene; |
91 | 91 | ||
92 | m_Scene.RegisterModuleInterface<IPrimCountModule>(this); | 92 | m_Scene.RegisterModuleInterface<IPrimCountModule>(this); |
93 | 93 | ||
94 | m_Scene.EventManager.OnObjectAddedToScene += OnParcelPrimCountAdd; | 94 | m_Scene.EventManager.OnObjectAddedToScene += OnParcelPrimCountAdd; |
95 | m_Scene.EventManager.OnObjectBeingRemovedFromScene += | 95 | m_Scene.EventManager.OnObjectBeingRemovedFromScene += |
96 | OnObjectBeingRemovedFromScene; | 96 | OnObjectBeingRemovedFromScene; |
97 | m_Scene.EventManager.OnParcelPrimCountTainted += | 97 | m_Scene.EventManager.OnParcelPrimCountTainted += |
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
104 | } | 104 | } |
105 | 105 | ||
106 | public void RemoveRegion(Scene scene) | 106 | public void RemoveRegion(Scene scene) |
107 | { | 107 | { |
108 | } | 108 | } |
109 | 109 | ||
110 | public void Close() | 110 | public void Close() |
@@ -126,7 +126,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
126 | AddObject(obj); | 126 | AddObject(obj); |
127 | // else | 127 | // else |
128 | // m_log.DebugFormat( | 128 | // m_log.DebugFormat( |
129 | // "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted", | 129 | // "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted", |
130 | // obj.Name, m_Scene.RegionInfo.RegionName); | 130 | // obj.Name, m_Scene.RegionInfo.RegionName); |
131 | } | 131 | } |
132 | } | 132 | } |
@@ -140,16 +140,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
140 | RemoveObject(obj); | 140 | RemoveObject(obj); |
141 | // else | 141 | // else |
142 | // m_log.DebugFormat( | 142 | // m_log.DebugFormat( |
143 | // "[PRIM COUNT MODULE]: Ignoring OnObjectBeingRemovedFromScene() for {0} on {1} since count is tainted", | 143 | // "[PRIM COUNT MODULE]: Ignoring OnObjectBeingRemovedFromScene() for {0} on {1} since count is tainted", |
144 | // obj.Name, m_Scene.RegionInfo.RegionName); | 144 | // obj.Name, m_Scene.RegionInfo.RegionName); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | private void OnParcelPrimCountTainted() | 148 | private void OnParcelPrimCountTainted() |
149 | { | 149 | { |
150 | // m_log.DebugFormat( | 150 | // m_log.DebugFormat( |
151 | // "[PRIM COUNT MODULE]: OnParcelPrimCountTainted() called on {0}", m_Scene.RegionInfo.RegionName); | 151 | // "[PRIM COUNT MODULE]: OnParcelPrimCountTainted() called on {0}", m_Scene.RegionInfo.RegionName); |
152 | 152 | ||
153 | lock (m_TaintLock) | 153 | lock (m_TaintLock) |
154 | m_Tainted = true; | 154 | m_Tainted = true; |
155 | } | 155 | } |
@@ -174,33 +174,33 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
174 | 174 | ||
175 | // NOTE: Call under Taint Lock | 175 | // NOTE: Call under Taint Lock |
176 | private void AddObject(SceneObjectGroup obj) | 176 | private void AddObject(SceneObjectGroup obj) |
177 | { | 177 | { |
178 | if (obj.IsAttachment) | 178 | if (obj.IsAttachment) |
179 | return; | 179 | return; |
180 | if (((obj.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)) | 180 | if (((obj.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)) |
181 | return; | 181 | return; |
182 | 182 | ||
183 | Vector3 pos = obj.AbsolutePosition; | 183 | Vector3 pos = obj.AbsolutePosition; |
184 | ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); | 184 | ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); |
185 | 185 | ||
186 | // If for some reason there is no land object (perhaps the object is out of bounds) then we can't count it | 186 | // If for some reason there is no land object (perhaps the object is out of bounds) then we can't count it |
187 | if (landObject == null) | 187 | if (landObject == null) |
188 | { | 188 | { |
189 | // m_log.WarnFormat( | 189 | // m_log.WarnFormat( |
190 | // "[PRIM COUNT MODULE]: Found no land object for {0} at position ({1}, {2}) on {3}", | 190 | // "[PRIM COUNT MODULE]: Found no land object for {0} at position ({1}, {2}) on {3}", |
191 | // obj.Name, pos.X, pos.Y, m_Scene.RegionInfo.RegionName); | 191 | // obj.Name, pos.X, pos.Y, m_Scene.RegionInfo.RegionName); |
192 | 192 | ||
193 | return; | 193 | return; |
194 | } | 194 | } |
195 | 195 | ||
196 | LandData landData = landObject.LandData; | 196 | LandData landData = landObject.LandData; |
197 | 197 | ||
198 | // m_log.DebugFormat( | 198 | // m_log.DebugFormat( |
199 | // "[PRIM COUNT MODULE]: Adding object {0} with {1} parts to prim count for parcel {2} on {3}", | 199 | // "[PRIM COUNT MODULE]: Adding object {0} with {1} parts to prim count for parcel {2} on {3}", |
200 | // obj.Name, obj.Parts.Length, landData.Name, m_Scene.RegionInfo.RegionName); | 200 | // obj.Name, obj.Parts.Length, landData.Name, m_Scene.RegionInfo.RegionName); |
201 | 201 | ||
202 | // m_log.DebugFormat( | 202 | // m_log.DebugFormat( |
203 | // "[PRIM COUNT MODULE]: Object {0} is owned by {1} over land owned by {2}", | 203 | // "[PRIM COUNT MODULE]: Object {0} is owned by {1} over land owned by {2}", |
204 | // obj.Name, obj.OwnerID, landData.OwnerID); | 204 | // obj.Name, obj.OwnerID, landData.OwnerID); |
205 | 205 | ||
206 | ParcelCounts parcelCounts; | 206 | ParcelCounts parcelCounts; |
@@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
217 | 217 | ||
218 | if (obj.IsSelected) | 218 | if (obj.IsSelected) |
219 | { | 219 | { |
220 | parcelCounts.Selected += partCount; | 220 | parcelCounts.Selected += partCount; |
221 | } | 221 | } |
222 | else | 222 | else |
223 | { | 223 | { |
@@ -244,8 +244,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
244 | // NOTE: Call under Taint Lock | 244 | // NOTE: Call under Taint Lock |
245 | private void RemoveObject(SceneObjectGroup obj) | 245 | private void RemoveObject(SceneObjectGroup obj) |
246 | { | 246 | { |
247 | // m_log.DebugFormat("[PRIM COUNT MODULE]: Removing object {0} {1} from prim count", obj.Name, obj.UUID); | 247 | // m_log.DebugFormat("[PRIM COUNT MODULE]: Removing object {0} {1} from prim count", obj.Name, obj.UUID); |
248 | 248 | ||
249 | // Currently this is being done by tainting the count instead. | 249 | // Currently this is being done by tainting the count instead. |
250 | } | 250 | } |
251 | 251 | ||
@@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
253 | { | 253 | { |
254 | // m_log.DebugFormat( | 254 | // m_log.DebugFormat( |
255 | // "[PRIM COUNT MODULE]: GetPrimCounts for parcel {0} in {1}", parcelID, m_Scene.RegionInfo.RegionName); | 255 | // "[PRIM COUNT MODULE]: GetPrimCounts for parcel {0} in {1}", parcelID, m_Scene.RegionInfo.RegionName); |
256 | 256 | ||
257 | PrimCounts primCounts; | 257 | PrimCounts primCounts; |
258 | 258 | ||
259 | lock (m_PrimCounts) | 259 | lock (m_PrimCounts) |
@@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
267 | return primCounts; | 267 | return primCounts; |
268 | } | 268 | } |
269 | 269 | ||
270 | 270 | ||
271 | /// <summary> | 271 | /// <summary> |
272 | /// Get the number of prims on the parcel that are owned by the parcel owner. | 272 | /// Get the number of prims on the parcel that are owned by the parcel owner. |
273 | /// </summary> | 273 | /// </summary> |
@@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
276 | public int GetOwnerCount(UUID parcelID) | 276 | public int GetOwnerCount(UUID parcelID) |
277 | { | 277 | { |
278 | int count = 0; | 278 | int count = 0; |
279 | 279 | ||
280 | lock (m_TaintLock) | 280 | lock (m_TaintLock) |
281 | { | 281 | { |
282 | if (m_Tainted) | 282 | if (m_Tainted) |
@@ -286,11 +286,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
286 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | 286 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) |
287 | count = counts.Owner; | 287 | count = counts.Owner; |
288 | } | 288 | } |
289 | 289 | ||
290 | // m_log.DebugFormat( | 290 | // m_log.DebugFormat( |
291 | // "[PRIM COUNT MODULE]: GetOwnerCount for parcel {0} in {1} returning {2}", | 291 | // "[PRIM COUNT MODULE]: GetOwnerCount for parcel {0} in {1} returning {2}", |
292 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 292 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
293 | 293 | ||
294 | return count; | 294 | return count; |
295 | } | 295 | } |
296 | 296 | ||
@@ -298,11 +298,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
298 | /// Get the number of prims on the parcel that have been set to the group that owns the parcel. | 298 | /// Get the number of prims on the parcel that have been set to the group that owns the parcel. |
299 | /// </summary> | 299 | /// </summary> |
300 | /// <param name="parcelID"></param> | 300 | /// <param name="parcelID"></param> |
301 | /// <returns></returns> | 301 | /// <returns></returns> |
302 | public int GetGroupCount(UUID parcelID) | 302 | public int GetGroupCount(UUID parcelID) |
303 | { | 303 | { |
304 | int count = 0; | 304 | int count = 0; |
305 | 305 | ||
306 | lock (m_TaintLock) | 306 | lock (m_TaintLock) |
307 | { | 307 | { |
308 | if (m_Tainted) | 308 | if (m_Tainted) |
@@ -312,11 +312,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
312 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | 312 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) |
313 | count = counts.Group; | 313 | count = counts.Group; |
314 | } | 314 | } |
315 | 315 | ||
316 | // m_log.DebugFormat( | 316 | // m_log.DebugFormat( |
317 | // "[PRIM COUNT MODULE]: GetGroupCount for parcel {0} in {1} returning {2}", | 317 | // "[PRIM COUNT MODULE]: GetGroupCount for parcel {0} in {1} returning {2}", |
318 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 318 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
319 | 319 | ||
320 | return count; | 320 | return count; |
321 | } | 321 | } |
322 | 322 | ||
@@ -324,11 +324,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
324 | /// Get the number of prims on the parcel that are not owned by the parcel owner or set to the parcel group. | 324 | /// Get the number of prims on the parcel that are not owned by the parcel owner or set to the parcel group. |
325 | /// </summary> | 325 | /// </summary> |
326 | /// <param name="parcelID"></param> | 326 | /// <param name="parcelID"></param> |
327 | /// <returns></returns> | 327 | /// <returns></returns> |
328 | public int GetOthersCount(UUID parcelID) | 328 | public int GetOthersCount(UUID parcelID) |
329 | { | 329 | { |
330 | int count = 0; | 330 | int count = 0; |
331 | 331 | ||
332 | lock (m_TaintLock) | 332 | lock (m_TaintLock) |
333 | { | 333 | { |
334 | if (m_Tainted) | 334 | if (m_Tainted) |
@@ -338,23 +338,23 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
338 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | 338 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) |
339 | count = counts.Others; | 339 | count = counts.Others; |
340 | } | 340 | } |
341 | 341 | ||
342 | // m_log.DebugFormat( | 342 | // m_log.DebugFormat( |
343 | // "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", | 343 | // "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", |
344 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 344 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
345 | 345 | ||
346 | return count; | 346 | return count; |
347 | } | 347 | } |
348 | 348 | ||
349 | /// <summary> | 349 | /// <summary> |
350 | /// Get the number of selected prims. | 350 | /// Get the number of selected prims. |
351 | /// </summary> | 351 | /// </summary> |
352 | /// <param name="parcelID"></param> | 352 | /// <param name="parcelID"></param> |
353 | /// <returns></returns> | 353 | /// <returns></returns> |
354 | public int GetSelectedCount(UUID parcelID) | 354 | public int GetSelectedCount(UUID parcelID) |
355 | { | 355 | { |
356 | int count = 0; | 356 | int count = 0; |
357 | 357 | ||
358 | lock (m_TaintLock) | 358 | lock (m_TaintLock) |
359 | { | 359 | { |
360 | if (m_Tainted) | 360 | if (m_Tainted) |
@@ -364,24 +364,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
364 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | 364 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) |
365 | count = counts.Selected; | 365 | count = counts.Selected; |
366 | } | 366 | } |
367 | 367 | ||
368 | // m_log.DebugFormat( | 368 | // m_log.DebugFormat( |
369 | // "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}", | 369 | // "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}", |
370 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 370 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
371 | 371 | ||
372 | return count; | 372 | return count; |
373 | } | 373 | } |
374 | 374 | ||
375 | /// <summary> | 375 | /// <summary> |
376 | /// Get the total count of owner, group and others prims on the parcel. | 376 | /// Get the total count of owner, group and others prims on the parcel. |
377 | /// FIXME: Need to do selected prims once this is reimplemented. | 377 | /// FIXME: Need to do selected prims once this is reimplemented. |
378 | /// </summary> | 378 | /// </summary> |
379 | /// <param name="parcelID"></param> | 379 | /// <param name="parcelID"></param> |
380 | /// <returns></returns> | 380 | /// <returns></returns> |
381 | public int GetTotalCount(UUID parcelID) | 381 | public int GetTotalCount(UUID parcelID) |
382 | { | 382 | { |
383 | int count = 0; | 383 | int count = 0; |
384 | 384 | ||
385 | lock (m_TaintLock) | 385 | lock (m_TaintLock) |
386 | { | 386 | { |
387 | if (m_Tainted) | 387 | if (m_Tainted) |
@@ -396,28 +396,28 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
396 | count += counts.Selected; | 396 | count += counts.Selected; |
397 | } | 397 | } |
398 | } | 398 | } |
399 | 399 | ||
400 | // m_log.DebugFormat( | 400 | // m_log.DebugFormat( |
401 | // "[PRIM COUNT MODULE]: GetTotalCount for parcel {0} in {1} returning {2}", | 401 | // "[PRIM COUNT MODULE]: GetTotalCount for parcel {0} in {1} returning {2}", |
402 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 402 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
403 | 403 | ||
404 | return count; | 404 | return count; |
405 | } | 405 | } |
406 | 406 | ||
407 | /// <summary> | 407 | /// <summary> |
408 | /// Get the number of prims that are in the entire simulator for the owner of this parcel. | 408 | /// Get the number of prims that are in the entire simulator for the owner of this parcel. |
409 | /// </summary> | 409 | /// </summary> |
410 | /// <param name="parcelID"></param> | 410 | /// <param name="parcelID"></param> |
411 | /// <returns></returns> | 411 | /// <returns></returns> |
412 | public int GetSimulatorCount(UUID parcelID) | 412 | public int GetSimulatorCount(UUID parcelID) |
413 | { | 413 | { |
414 | int count = 0; | 414 | int count = 0; |
415 | 415 | ||
416 | lock (m_TaintLock) | 416 | lock (m_TaintLock) |
417 | { | 417 | { |
418 | if (m_Tainted) | 418 | if (m_Tainted) |
419 | Recount(); | 419 | Recount(); |
420 | 420 | ||
421 | UUID owner; | 421 | UUID owner; |
422 | if (m_OwnerMap.TryGetValue(parcelID, out owner)) | 422 | if (m_OwnerMap.TryGetValue(parcelID, out owner)) |
423 | { | 423 | { |
@@ -426,11 +426,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
426 | count = val; | 426 | count = val; |
427 | } | 427 | } |
428 | } | 428 | } |
429 | 429 | ||
430 | // m_log.DebugFormat( | 430 | // m_log.DebugFormat( |
431 | // "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", | 431 | // "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", |
432 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 432 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
433 | 433 | ||
434 | return count; | 434 | return count; |
435 | } | 435 | } |
436 | 436 | ||
@@ -439,11 +439,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
439 | /// </summary> | 439 | /// </summary> |
440 | /// <param name="parcelID"></param> | 440 | /// <param name="parcelID"></param> |
441 | /// <param name="userID"></param> | 441 | /// <param name="userID"></param> |
442 | /// <returns></returns> | 442 | /// <returns></returns> |
443 | public int GetUserCount(UUID parcelID, UUID userID) | 443 | public int GetUserCount(UUID parcelID, UUID userID) |
444 | { | 444 | { |
445 | int count = 0; | 445 | int count = 0; |
446 | 446 | ||
447 | lock (m_TaintLock) | 447 | lock (m_TaintLock) |
448 | { | 448 | { |
449 | if (m_Tainted) | 449 | if (m_Tainted) |
@@ -459,9 +459,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
459 | } | 459 | } |
460 | 460 | ||
461 | // m_log.DebugFormat( | 461 | // m_log.DebugFormat( |
462 | // "[PRIM COUNT MODULE]: GetUserCount for user {0} in parcel {1} in region {2} returning {3}", | 462 | // "[PRIM COUNT MODULE]: GetUserCount for user {0} in parcel {1} in region {2} returning {3}", |
463 | // userID, parcelID, m_Scene.RegionInfo.RegionName, count); | 463 | // userID, parcelID, m_Scene.RegionInfo.RegionName, count); |
464 | 464 | ||
465 | return count; | 465 | return count; |
466 | } | 466 | } |
467 | 467 | ||
@@ -469,13 +469,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
469 | private void Recount() | 469 | private void Recount() |
470 | { | 470 | { |
471 | // m_log.DebugFormat("[PRIM COUNT MODULE]: Recounting prims on {0}", m_Scene.RegionInfo.RegionName); | 471 | // m_log.DebugFormat("[PRIM COUNT MODULE]: Recounting prims on {0}", m_Scene.RegionInfo.RegionName); |
472 | 472 | ||
473 | m_OwnerMap.Clear(); | 473 | m_OwnerMap.Clear(); |
474 | m_SimwideCounts.Clear(); | 474 | m_SimwideCounts.Clear(); |
475 | m_ParcelCounts.Clear(); | 475 | m_ParcelCounts.Clear(); |
476 | 476 | ||
477 | List<ILandObject> land = m_Scene.LandChannel.AllParcels(); | 477 | List<ILandObject> land = m_Scene.LandChannel.AllParcels(); |
478 | 478 | ||
479 | foreach (ILandObject l in land) | 479 | foreach (ILandObject l in land) |
480 | { | 480 | { |
481 | LandData landData = l.LandData; | 481 | LandData landData = l.LandData; |
@@ -483,7 +483,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
483 | m_OwnerMap[landData.GlobalID] = landData.OwnerID; | 483 | m_OwnerMap[landData.GlobalID] = landData.OwnerID; |
484 | m_SimwideCounts[landData.OwnerID] = 0; | 484 | m_SimwideCounts[landData.OwnerID] = 0; |
485 | // m_log.DebugFormat( | 485 | // m_log.DebugFormat( |
486 | // "[PRIM COUNT MODULE]: Initializing parcel count for {0} on {1}", | 486 | // "[PRIM COUNT MODULE]: Initializing parcel count for {0} on {1}", |
487 | // landData.Name, m_Scene.RegionInfo.RegionName); | 487 | // landData.Name, m_Scene.RegionInfo.RegionName); |
488 | m_ParcelCounts[landData.GlobalID] = new ParcelCounts(); | 488 | m_ParcelCounts[landData.GlobalID] = new ParcelCounts(); |
489 | } | 489 | } |
@@ -499,7 +499,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
499 | m_PrimCounts.Remove(k); | 499 | m_PrimCounts.Remove(k); |
500 | } | 500 | } |
501 | } | 501 | } |
502 | 502 | ||
503 | m_Tainted = false; | 503 | m_Tainted = false; |
504 | } | 504 | } |
505 | } | 505 | } |
@@ -541,7 +541,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
541 | return m_Parent.GetOthersCount(m_ParcelID); | 541 | return m_Parent.GetOthersCount(m_ParcelID); |
542 | } | 542 | } |
543 | } | 543 | } |
544 | 544 | ||
545 | public int Selected | 545 | public int Selected |
546 | { | 546 | { |
547 | get | 547 | get |
@@ -549,7 +549,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
549 | return m_Parent.GetSelectedCount(m_ParcelID); | 549 | return m_Parent.GetSelectedCount(m_ParcelID); |
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | public int Total | 553 | public int Total |
554 | { | 554 | { |
555 | get | 555 | get |
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs index 4ed67f3..d6a3ded 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs | |||
@@ -45,14 +45,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
45 | UUID userId = TestHelpers.ParseTail(0x1); | 45 | UUID userId = TestHelpers.ParseTail(0x1); |
46 | 46 | ||
47 | LandManagementModule lmm = new LandManagementModule(); | 47 | LandManagementModule lmm = new LandManagementModule(); |
48 | Scene scene = new SceneHelpers().SetupScene(); | 48 | Scene scene = new SceneHelpers().SetupScene(); |
49 | SceneHelpers.SetupSceneModules(scene, lmm); | 49 | SceneHelpers.SetupSceneModules(scene, lmm); |
50 | 50 | ||
51 | ILandObject lo = new LandObject(userId, false, scene); | 51 | ILandObject lo = new LandObject(userId, false, scene); |
52 | lo.LandData.Name = "lo1"; | 52 | lo.LandData.Name = "lo1"; |
53 | lo.SetLandBitmap( | 53 | lo.SetLandBitmap( |
54 | lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 54 | lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
55 | lo = lmm.AddLandObject(lo); | 55 | lo = lmm.AddLandObject(lo); |
56 | 56 | ||
57 | // TODO: Should add asserts to check that land object was added properly. | 57 | // TODO: Should add asserts to check that land object was added properly. |
58 | 58 | ||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
67 | { | 67 | { |
68 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); | 68 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); |
69 | Assert.That(loAtCoord.LandData.LocalID, Is.EqualTo(lo.LandData.LocalID)); | 69 | Assert.That(loAtCoord.LandData.LocalID, Is.EqualTo(lo.LandData.LocalID)); |
70 | Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(lo.LandData.GlobalID)); | 70 | Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(lo.LandData.GlobalID)); |
71 | } | 71 | } |
72 | 72 | ||
73 | { | 73 | { |
@@ -88,8 +88,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
88 | 88 | ||
89 | SceneHelpers sh = new SceneHelpers(); | 89 | SceneHelpers sh = new SceneHelpers(); |
90 | LandManagementModule lmm = new LandManagementModule(); | 90 | LandManagementModule lmm = new LandManagementModule(); |
91 | Scene scene = sh.SetupScene(); | 91 | Scene scene = sh.SetupScene(); |
92 | SceneHelpers.SetupSceneModules(scene, lmm); | 92 | SceneHelpers.SetupSceneModules(scene, lmm); |
93 | 93 | ||
94 | scene.loadAllLandObjectsFromStorage(scene.RegionInfo.RegionID); | 94 | scene.loadAllLandObjectsFromStorage(scene.RegionInfo.RegionID); |
95 | 95 | ||
@@ -115,8 +115,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
115 | 115 | ||
116 | SceneHelpers sh = new SceneHelpers(); | 116 | SceneHelpers sh = new SceneHelpers(); |
117 | LandManagementModule lmm = new LandManagementModule(); | 117 | LandManagementModule lmm = new LandManagementModule(); |
118 | Scene scene = sh.SetupScene(); | 118 | Scene scene = sh.SetupScene(); |
119 | SceneHelpers.SetupSceneModules(scene, lmm); | 119 | SceneHelpers.SetupSceneModules(scene, lmm); |
120 | 120 | ||
121 | ILandObject originalLo1 = new LandObject(userId, false, scene); | 121 | ILandObject originalLo1 = new LandObject(userId, false, scene); |
122 | originalLo1.LandData.Name = "lo1"; | 122 | originalLo1.LandData.Name = "lo1"; |
@@ -149,8 +149,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
149 | 149 | ||
150 | SceneHelpers sh = new SceneHelpers(); | 150 | SceneHelpers sh = new SceneHelpers(); |
151 | LandManagementModule lmm = new LandManagementModule(); | 151 | LandManagementModule lmm = new LandManagementModule(); |
152 | Scene scene = sh.SetupScene(); | 152 | Scene scene = sh.SetupScene(); |
153 | SceneHelpers.SetupSceneModules(scene, lmm); | 153 | SceneHelpers.SetupSceneModules(scene, lmm); |
154 | 154 | ||
155 | ILandObject originalLo1 = new LandObject(userId, false, scene); | 155 | ILandObject originalLo1 = new LandObject(userId, false, scene); |
156 | originalLo1.LandData.Name = "lo1"; | 156 | originalLo1.LandData.Name = "lo1"; |
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
173 | Assert.That(loAtCoord1.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); | 173 | Assert.That(loAtCoord1.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); |
174 | Assert.That(loAtCoord1.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); | 174 | Assert.That(loAtCoord1.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); |
175 | 175 | ||
176 | ILandObject loAtCoord2 | 176 | ILandObject loAtCoord2 |
177 | = lmm.GetLandObject((int)Constants.RegionSize - 1, (((int)Constants.RegionSize / 4) * 3) - 1); | 177 | = lmm.GetLandObject((int)Constants.RegionSize - 1, (((int)Constants.RegionSize / 4) * 3) - 1); |
178 | Assert.That(loAtCoord2.LandData.Name, Is.EqualTo(originalLo2.LandData.Name)); | 178 | Assert.That(loAtCoord2.LandData.Name, Is.EqualTo(originalLo2.LandData.Name)); |
179 | Assert.That(loAtCoord2.LandData.GlobalID, Is.EqualTo(originalLo2.LandData.GlobalID)); | 179 | Assert.That(loAtCoord2.LandData.GlobalID, Is.EqualTo(originalLo2.LandData.GlobalID)); |
@@ -198,8 +198,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
198 | 198 | ||
199 | SceneHelpers sh = new SceneHelpers(); | 199 | SceneHelpers sh = new SceneHelpers(); |
200 | LandManagementModule lmm = new LandManagementModule(); | 200 | LandManagementModule lmm = new LandManagementModule(); |
201 | Scene scene = sh.SetupScene(); | 201 | Scene scene = sh.SetupScene(); |
202 | SceneHelpers.SetupSceneModules(scene, lmm); | 202 | SceneHelpers.SetupSceneModules(scene, lmm); |
203 | 203 | ||
204 | ILandObject originalLo1 = new LandObject(userId, false, scene); | 204 | ILandObject originalLo1 = new LandObject(userId, false, scene); |
205 | originalLo1.LandData.Name = "lo1"; | 205 | originalLo1.LandData.Name = "lo1"; |
@@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
220 | { | 220 | { |
221 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); | 221 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); |
222 | Assert.That(loAtCoord.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); | 222 | Assert.That(loAtCoord.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); |
223 | Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); | 223 | Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); |
224 | } | 224 | } |
225 | 225 | ||
226 | { | 226 | { |
@@ -239,21 +239,21 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
239 | UUID userId = TestHelpers.ParseTail(0x1); | 239 | UUID userId = TestHelpers.ParseTail(0x1); |
240 | 240 | ||
241 | LandManagementModule lmm = new LandManagementModule(); | 241 | LandManagementModule lmm = new LandManagementModule(); |
242 | Scene scene = new SceneHelpers().SetupScene(); | 242 | Scene scene = new SceneHelpers().SetupScene(); |
243 | SceneHelpers.SetupSceneModules(scene, lmm); | 243 | SceneHelpers.SetupSceneModules(scene, lmm); |
244 | 244 | ||
245 | ILandObject lo = new LandObject(userId, false, scene); | 245 | ILandObject lo = new LandObject(userId, false, scene); |
246 | lo.LandData.Name = "lo1"; | 246 | lo.LandData.Name = "lo1"; |
247 | lo.SetLandBitmap( | 247 | lo.SetLandBitmap( |
248 | lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 248 | lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
249 | lo = lmm.AddLandObject(lo); | 249 | lo = lmm.AddLandObject(lo); |
250 | 250 | ||
251 | lmm.Subdivide(0, 0, LandManagementModule.LandUnit, LandManagementModule.LandUnit, userId); | 251 | lmm.Subdivide(0, 0, LandManagementModule.LandUnit, LandManagementModule.LandUnit, userId); |
252 | 252 | ||
253 | { | 253 | { |
254 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); | 254 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); |
255 | Assert.That(loAtCoord.LandData.LocalID, Is.Not.EqualTo(lo.LandData.LocalID)); | 255 | Assert.That(loAtCoord.LandData.LocalID, Is.Not.EqualTo(lo.LandData.LocalID)); |
256 | Assert.That(loAtCoord.LandData.GlobalID, Is.Not.EqualTo(lo.LandData.GlobalID)); | 256 | Assert.That(loAtCoord.LandData.GlobalID, Is.Not.EqualTo(lo.LandData.GlobalID)); |
257 | } | 257 | } |
258 | 258 | ||
259 | { | 259 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index 949acb6..0d8ece7 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | |||
@@ -43,21 +43,21 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
43 | public class PrimCountModuleTests : OpenSimTestCase | 43 | public class PrimCountModuleTests : OpenSimTestCase |
44 | { | 44 | { |
45 | protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); | 45 | protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); |
46 | protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); | 46 | protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); |
47 | protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); | 47 | protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); |
48 | protected TestScene m_scene; | 48 | protected TestScene m_scene; |
49 | protected PrimCountModule m_pcm; | 49 | protected PrimCountModule m_pcm; |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// A parcel that covers the entire sim except for a 1 unit wide strip on the eastern side. | 52 | /// A parcel that covers the entire sim except for a 1 unit wide strip on the eastern side. |
53 | /// </summary> | 53 | /// </summary> |
54 | protected ILandObject m_lo; | 54 | protected ILandObject m_lo; |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// A parcel that covers just the eastern strip of the sim. | 57 | /// A parcel that covers just the eastern strip of the sim. |
58 | /// </summary> | 58 | /// </summary> |
59 | protected ILandObject m_lo2; | 59 | protected ILandObject m_lo2; |
60 | 60 | ||
61 | [SetUp] | 61 | [SetUp] |
62 | public override void SetUp() | 62 | public override void SetUp() |
63 | { | 63 | { |
@@ -65,24 +65,24 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
65 | 65 | ||
66 | m_pcm = new PrimCountModule(); | 66 | m_pcm = new PrimCountModule(); |
67 | LandManagementModule lmm = new LandManagementModule(); | 67 | LandManagementModule lmm = new LandManagementModule(); |
68 | m_scene = new SceneHelpers().SetupScene(); | 68 | m_scene = new SceneHelpers().SetupScene(); |
69 | SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); | 69 | SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); |
70 | 70 | ||
71 | int xParcelDivider = (int)Constants.RegionSize - 1; | 71 | int xParcelDivider = (int)Constants.RegionSize - 1; |
72 | 72 | ||
73 | ILandObject lo = new LandObject(m_userId, false, m_scene); | 73 | ILandObject lo = new LandObject(m_userId, false, m_scene); |
74 | lo.LandData.Name = "m_lo"; | 74 | lo.LandData.Name = "m_lo"; |
75 | lo.SetLandBitmap( | 75 | lo.SetLandBitmap( |
76 | lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize)); | 76 | lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize)); |
77 | m_lo = lmm.AddLandObject(lo); | 77 | m_lo = lmm.AddLandObject(lo); |
78 | 78 | ||
79 | ILandObject lo2 = new LandObject(m_userId, false, m_scene); | 79 | ILandObject lo2 = new LandObject(m_userId, false, m_scene); |
80 | lo2.SetLandBitmap( | 80 | lo2.SetLandBitmap( |
81 | lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 81 | lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
82 | lo2.LandData.Name = "m_lo2"; | 82 | lo2.LandData.Name = "m_lo2"; |
83 | m_lo2 = lmm.AddLandObject(lo2); | 83 | m_lo2 = lmm.AddLandObject(lo2); |
84 | } | 84 | } |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// Test that counts before we do anything are correct. | 87 | /// Test that counts before we do anything are correct. |
88 | /// </summary> | 88 | /// </summary> |
@@ -90,7 +90,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
90 | public void TestInitialCounts() | 90 | public void TestInitialCounts() |
91 | { | 91 | { |
92 | IPrimCounts pc = m_lo.PrimCounts; | 92 | IPrimCounts pc = m_lo.PrimCounts; |
93 | 93 | ||
94 | Assert.That(pc.Owner, Is.EqualTo(0)); | 94 | Assert.That(pc.Owner, Is.EqualTo(0)); |
95 | Assert.That(pc.Group, Is.EqualTo(0)); | 95 | Assert.That(pc.Group, Is.EqualTo(0)); |
96 | Assert.That(pc.Others, Is.EqualTo(0)); | 96 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -98,9 +98,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
98 | Assert.That(pc.Selected, Is.EqualTo(0)); | 98 | Assert.That(pc.Selected, Is.EqualTo(0)); |
99 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 99 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
100 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 100 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
101 | Assert.That(pc.Simulator, Is.EqualTo(0)); | 101 | Assert.That(pc.Simulator, Is.EqualTo(0)); |
102 | } | 102 | } |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// Test count after a parcel owner owned object is added. | 105 | /// Test count after a parcel owner owned object is added. |
106 | /// </summary> | 106 | /// </summary> |
@@ -108,13 +108,13 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
108 | public void TestAddOwnerObject() | 108 | public void TestAddOwnerObject() |
109 | { | 109 | { |
110 | TestHelpers.InMethod(); | 110 | TestHelpers.InMethod(); |
111 | // log4net.Config.XmlConfigurator.Configure(); | 111 | // log4net.Config.XmlConfigurator.Configure(); |
112 | 112 | ||
113 | IPrimCounts pc = m_lo.PrimCounts; | 113 | IPrimCounts pc = m_lo.PrimCounts; |
114 | 114 | ||
115 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 115 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
116 | m_scene.AddNewSceneObject(sog, false); | 116 | m_scene.AddNewSceneObject(sog, false); |
117 | 117 | ||
118 | Assert.That(pc.Owner, Is.EqualTo(3)); | 118 | Assert.That(pc.Owner, Is.EqualTo(3)); |
119 | Assert.That(pc.Group, Is.EqualTo(0)); | 119 | Assert.That(pc.Group, Is.EqualTo(0)); |
120 | Assert.That(pc.Others, Is.EqualTo(0)); | 120 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -122,12 +122,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
122 | Assert.That(pc.Selected, Is.EqualTo(0)); | 122 | Assert.That(pc.Selected, Is.EqualTo(0)); |
123 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); | 123 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); |
124 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 124 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
125 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 125 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
126 | 126 | ||
127 | // Add a second object and retest | 127 | // Add a second object and retest |
128 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 128 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); |
129 | m_scene.AddNewSceneObject(sog2, false); | 129 | m_scene.AddNewSceneObject(sog2, false); |
130 | 130 | ||
131 | Assert.That(pc.Owner, Is.EqualTo(5)); | 131 | Assert.That(pc.Owner, Is.EqualTo(5)); |
132 | Assert.That(pc.Group, Is.EqualTo(0)); | 132 | Assert.That(pc.Group, Is.EqualTo(0)); |
133 | Assert.That(pc.Others, Is.EqualTo(0)); | 133 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -135,9 +135,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
135 | Assert.That(pc.Selected, Is.EqualTo(0)); | 135 | Assert.That(pc.Selected, Is.EqualTo(0)); |
136 | Assert.That(pc.Users[m_userId], Is.EqualTo(5)); | 136 | Assert.That(pc.Users[m_userId], Is.EqualTo(5)); |
137 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 137 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
138 | Assert.That(pc.Simulator, Is.EqualTo(5)); | 138 | Assert.That(pc.Simulator, Is.EqualTo(5)); |
139 | } | 139 | } |
140 | 140 | ||
141 | /// <summary> | 141 | /// <summary> |
142 | /// Test count after a parcel owner owned copied object is added. | 142 | /// Test count after a parcel owner owned copied object is added. |
143 | /// </summary> | 143 | /// </summary> |
@@ -145,14 +145,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
145 | public void TestCopyOwnerObject() | 145 | public void TestCopyOwnerObject() |
146 | { | 146 | { |
147 | TestHelpers.InMethod(); | 147 | TestHelpers.InMethod(); |
148 | // log4net.Config.XmlConfigurator.Configure(); | 148 | // log4net.Config.XmlConfigurator.Configure(); |
149 | 149 | ||
150 | IPrimCounts pc = m_lo.PrimCounts; | 150 | IPrimCounts pc = m_lo.PrimCounts; |
151 | 151 | ||
152 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 152 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
153 | m_scene.AddNewSceneObject(sog, false); | 153 | m_scene.AddNewSceneObject(sog, false); |
154 | m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); | 154 | m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); |
155 | 155 | ||
156 | Assert.That(pc.Owner, Is.EqualTo(6)); | 156 | Assert.That(pc.Owner, Is.EqualTo(6)); |
157 | Assert.That(pc.Group, Is.EqualTo(0)); | 157 | Assert.That(pc.Group, Is.EqualTo(0)); |
158 | Assert.That(pc.Others, Is.EqualTo(0)); | 158 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -160,9 +160,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
160 | Assert.That(pc.Selected, Is.EqualTo(0)); | 160 | Assert.That(pc.Selected, Is.EqualTo(0)); |
161 | Assert.That(pc.Users[m_userId], Is.EqualTo(6)); | 161 | Assert.That(pc.Users[m_userId], Is.EqualTo(6)); |
162 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 162 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
163 | Assert.That(pc.Simulator, Is.EqualTo(6)); | 163 | Assert.That(pc.Simulator, Is.EqualTo(6)); |
164 | } | 164 | } |
165 | 165 | ||
166 | /// <summary> | 166 | /// <summary> |
167 | /// Test that parcel counts update correctly when an object is moved between parcels, where that movement | 167 | /// Test that parcel counts update correctly when an object is moved between parcels, where that movement |
168 | /// is not done directly by the user/ | 168 | /// is not done directly by the user/ |
@@ -171,18 +171,18 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
171 | public void TestMoveOwnerObject() | 171 | public void TestMoveOwnerObject() |
172 | { | 172 | { |
173 | TestHelpers.InMethod(); | 173 | TestHelpers.InMethod(); |
174 | // log4net.Config.XmlConfigurator.Configure(); | 174 | // log4net.Config.XmlConfigurator.Configure(); |
175 | 175 | ||
176 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 176 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
177 | m_scene.AddNewSceneObject(sog, false); | 177 | m_scene.AddNewSceneObject(sog, false); |
178 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 178 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); |
179 | m_scene.AddNewSceneObject(sog2, false); | 179 | m_scene.AddNewSceneObject(sog2, false); |
180 | 180 | ||
181 | // Move the first scene object to the eastern strip parcel | 181 | // Move the first scene object to the eastern strip parcel |
182 | sog.AbsolutePosition = new Vector3(254, 2, 2); | 182 | sog.AbsolutePosition = new Vector3(254, 2, 2); |
183 | 183 | ||
184 | IPrimCounts pclo1 = m_lo.PrimCounts; | 184 | IPrimCounts pclo1 = m_lo.PrimCounts; |
185 | 185 | ||
186 | Assert.That(pclo1.Owner, Is.EqualTo(2)); | 186 | Assert.That(pclo1.Owner, Is.EqualTo(2)); |
187 | Assert.That(pclo1.Group, Is.EqualTo(0)); | 187 | Assert.That(pclo1.Group, Is.EqualTo(0)); |
188 | Assert.That(pclo1.Others, Is.EqualTo(0)); | 188 | Assert.That(pclo1.Others, Is.EqualTo(0)); |
@@ -190,10 +190,10 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
190 | Assert.That(pclo1.Selected, Is.EqualTo(0)); | 190 | Assert.That(pclo1.Selected, Is.EqualTo(0)); |
191 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); | 191 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); |
192 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); | 192 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); |
193 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); | 193 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); |
194 | 194 | ||
195 | IPrimCounts pclo2 = m_lo2.PrimCounts; | 195 | IPrimCounts pclo2 = m_lo2.PrimCounts; |
196 | 196 | ||
197 | Assert.That(pclo2.Owner, Is.EqualTo(3)); | 197 | Assert.That(pclo2.Owner, Is.EqualTo(3)); |
198 | Assert.That(pclo2.Group, Is.EqualTo(0)); | 198 | Assert.That(pclo2.Group, Is.EqualTo(0)); |
199 | Assert.That(pclo2.Others, Is.EqualTo(0)); | 199 | Assert.That(pclo2.Others, Is.EqualTo(0)); |
@@ -201,11 +201,11 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
201 | Assert.That(pclo2.Selected, Is.EqualTo(0)); | 201 | Assert.That(pclo2.Selected, Is.EqualTo(0)); |
202 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); | 202 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); |
203 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); | 203 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); |
204 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); | 204 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); |
205 | 205 | ||
206 | // Now move it back again | 206 | // Now move it back again |
207 | sog.AbsolutePosition = new Vector3(2, 2, 2); | 207 | sog.AbsolutePosition = new Vector3(2, 2, 2); |
208 | 208 | ||
209 | Assert.That(pclo1.Owner, Is.EqualTo(5)); | 209 | Assert.That(pclo1.Owner, Is.EqualTo(5)); |
210 | Assert.That(pclo1.Group, Is.EqualTo(0)); | 210 | Assert.That(pclo1.Group, Is.EqualTo(0)); |
211 | Assert.That(pclo1.Others, Is.EqualTo(0)); | 211 | Assert.That(pclo1.Others, Is.EqualTo(0)); |
@@ -213,8 +213,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
213 | Assert.That(pclo1.Selected, Is.EqualTo(0)); | 213 | Assert.That(pclo1.Selected, Is.EqualTo(0)); |
214 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(5)); | 214 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(5)); |
215 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); | 215 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); |
216 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); | 216 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); |
217 | 217 | ||
218 | Assert.That(pclo2.Owner, Is.EqualTo(0)); | 218 | Assert.That(pclo2.Owner, Is.EqualTo(0)); |
219 | Assert.That(pclo2.Group, Is.EqualTo(0)); | 219 | Assert.That(pclo2.Group, Is.EqualTo(0)); |
220 | Assert.That(pclo2.Others, Is.EqualTo(0)); | 220 | Assert.That(pclo2.Others, Is.EqualTo(0)); |
@@ -222,9 +222,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
222 | Assert.That(pclo2.Selected, Is.EqualTo(0)); | 222 | Assert.That(pclo2.Selected, Is.EqualTo(0)); |
223 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(0)); | 223 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(0)); |
224 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); | 224 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); |
225 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); | 225 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); |
226 | } | 226 | } |
227 | 227 | ||
228 | /// <summary> | 228 | /// <summary> |
229 | /// Test count after a parcel owner owned object is removed. | 229 | /// Test count after a parcel owner owned object is removed. |
230 | /// </summary> | 230 | /// </summary> |
@@ -233,14 +233,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
233 | { | 233 | { |
234 | TestHelpers.InMethod(); | 234 | TestHelpers.InMethod(); |
235 | // log4net.Config.XmlConfigurator.Configure(); | 235 | // log4net.Config.XmlConfigurator.Configure(); |
236 | 236 | ||
237 | IPrimCounts pc = m_lo.PrimCounts; | 237 | IPrimCounts pc = m_lo.PrimCounts; |
238 | 238 | ||
239 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); | 239 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); |
240 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); | 240 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); |
241 | m_scene.AddNewSceneObject(sogToDelete, false); | 241 | m_scene.AddNewSceneObject(sogToDelete, false); |
242 | m_scene.DeleteSceneObject(sogToDelete, false); | 242 | m_scene.DeleteSceneObject(sogToDelete, false); |
243 | 243 | ||
244 | Assert.That(pc.Owner, Is.EqualTo(1)); | 244 | Assert.That(pc.Owner, Is.EqualTo(1)); |
245 | Assert.That(pc.Group, Is.EqualTo(0)); | 245 | Assert.That(pc.Group, Is.EqualTo(0)); |
246 | Assert.That(pc.Others, Is.EqualTo(0)); | 246 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -248,37 +248,37 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
248 | Assert.That(pc.Selected, Is.EqualTo(0)); | 248 | Assert.That(pc.Selected, Is.EqualTo(0)); |
249 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); | 249 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); |
250 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 250 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
251 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 251 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
252 | } | 252 | } |
253 | 253 | ||
254 | [Test] | 254 | [Test] |
255 | public void TestAddGroupObject() | 255 | public void TestAddGroupObject() |
256 | { | 256 | { |
257 | TestHelpers.InMethod(); | 257 | TestHelpers.InMethod(); |
258 | // log4net.Config.XmlConfigurator.Configure(); | 258 | // log4net.Config.XmlConfigurator.Configure(); |
259 | 259 | ||
260 | m_lo.DeedToGroup(m_groupId); | 260 | m_lo.DeedToGroup(m_groupId); |
261 | 261 | ||
262 | IPrimCounts pc = m_lo.PrimCounts; | 262 | IPrimCounts pc = m_lo.PrimCounts; |
263 | 263 | ||
264 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); | 264 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); |
265 | sog.GroupID = m_groupId; | 265 | sog.GroupID = m_groupId; |
266 | m_scene.AddNewSceneObject(sog, false); | 266 | m_scene.AddNewSceneObject(sog, false); |
267 | 267 | ||
268 | Assert.That(pc.Owner, Is.EqualTo(0)); | 268 | Assert.That(pc.Owner, Is.EqualTo(0)); |
269 | Assert.That(pc.Group, Is.EqualTo(3)); | 269 | Assert.That(pc.Group, Is.EqualTo(3)); |
270 | Assert.That(pc.Others, Is.EqualTo(0)); | 270 | Assert.That(pc.Others, Is.EqualTo(0)); |
271 | Assert.That(pc.Total, Is.EqualTo(3)); | 271 | Assert.That(pc.Total, Is.EqualTo(3)); |
272 | Assert.That(pc.Selected, Is.EqualTo(0)); | 272 | Assert.That(pc.Selected, Is.EqualTo(0)); |
273 | 273 | ||
274 | // Is this desired behaviour? Not totally sure. | 274 | // Is this desired behaviour? Not totally sure. |
275 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 275 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
276 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); | 276 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); |
277 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); | 277 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); |
278 | 278 | ||
279 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 279 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
280 | } | 280 | } |
281 | 281 | ||
282 | /// <summary> | 282 | /// <summary> |
283 | /// Test count after a parcel owner owned object is removed. | 283 | /// Test count after a parcel owner owned object is removed. |
284 | /// </summary> | 284 | /// </summary> |
@@ -287,19 +287,19 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
287 | { | 287 | { |
288 | TestHelpers.InMethod(); | 288 | TestHelpers.InMethod(); |
289 | // log4net.Config.XmlConfigurator.Configure(); | 289 | // log4net.Config.XmlConfigurator.Configure(); |
290 | 290 | ||
291 | m_lo.DeedToGroup(m_groupId); | 291 | m_lo.DeedToGroup(m_groupId); |
292 | 292 | ||
293 | IPrimCounts pc = m_lo.PrimCounts; | 293 | IPrimCounts pc = m_lo.PrimCounts; |
294 | 294 | ||
295 | SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1); | 295 | SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1); |
296 | sogToKeep.GroupID = m_groupId; | 296 | sogToKeep.GroupID = m_groupId; |
297 | m_scene.AddNewSceneObject(sogToKeep, false); | 297 | m_scene.AddNewSceneObject(sogToKeep, false); |
298 | 298 | ||
299 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); | 299 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); |
300 | m_scene.AddNewSceneObject(sogToDelete, false); | 300 | m_scene.AddNewSceneObject(sogToDelete, false); |
301 | m_scene.DeleteSceneObject(sogToDelete, false); | 301 | m_scene.DeleteSceneObject(sogToDelete, false); |
302 | 302 | ||
303 | Assert.That(pc.Owner, Is.EqualTo(0)); | 303 | Assert.That(pc.Owner, Is.EqualTo(0)); |
304 | Assert.That(pc.Group, Is.EqualTo(1)); | 304 | Assert.That(pc.Group, Is.EqualTo(1)); |
305 | Assert.That(pc.Others, Is.EqualTo(0)); | 305 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -308,20 +308,20 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
308 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); | 308 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); |
309 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); | 309 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); |
310 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 310 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
311 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 311 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
312 | } | 312 | } |
313 | 313 | ||
314 | [Test] | 314 | [Test] |
315 | public void TestAddOthersObject() | 315 | public void TestAddOthersObject() |
316 | { | 316 | { |
317 | TestHelpers.InMethod(); | 317 | TestHelpers.InMethod(); |
318 | // log4net.Config.XmlConfigurator.Configure(); | 318 | // log4net.Config.XmlConfigurator.Configure(); |
319 | 319 | ||
320 | IPrimCounts pc = m_lo.PrimCounts; | 320 | IPrimCounts pc = m_lo.PrimCounts; |
321 | 321 | ||
322 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); | 322 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); |
323 | m_scene.AddNewSceneObject(sog, false); | 323 | m_scene.AddNewSceneObject(sog, false); |
324 | 324 | ||
325 | Assert.That(pc.Owner, Is.EqualTo(0)); | 325 | Assert.That(pc.Owner, Is.EqualTo(0)); |
326 | Assert.That(pc.Group, Is.EqualTo(0)); | 326 | Assert.That(pc.Group, Is.EqualTo(0)); |
327 | Assert.That(pc.Others, Is.EqualTo(3)); | 327 | Assert.That(pc.Others, Is.EqualTo(3)); |
@@ -329,22 +329,22 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
329 | Assert.That(pc.Selected, Is.EqualTo(0)); | 329 | Assert.That(pc.Selected, Is.EqualTo(0)); |
330 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 330 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
331 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); | 331 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); |
332 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 332 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
333 | } | 333 | } |
334 | 334 | ||
335 | [Test] | 335 | [Test] |
336 | public void TestRemoveOthersObject() | 336 | public void TestRemoveOthersObject() |
337 | { | 337 | { |
338 | TestHelpers.InMethod(); | 338 | TestHelpers.InMethod(); |
339 | // log4net.Config.XmlConfigurator.Configure(); | 339 | // log4net.Config.XmlConfigurator.Configure(); |
340 | 340 | ||
341 | IPrimCounts pc = m_lo.PrimCounts; | 341 | IPrimCounts pc = m_lo.PrimCounts; |
342 | 342 | ||
343 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); | 343 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); |
344 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); | 344 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); |
345 | m_scene.AddNewSceneObject(sogToDelete, false); | 345 | m_scene.AddNewSceneObject(sogToDelete, false); |
346 | m_scene.DeleteSceneObject(sogToDelete, false); | 346 | m_scene.DeleteSceneObject(sogToDelete, false); |
347 | 347 | ||
348 | Assert.That(pc.Owner, Is.EqualTo(0)); | 348 | Assert.That(pc.Owner, Is.EqualTo(0)); |
349 | Assert.That(pc.Group, Is.EqualTo(0)); | 349 | Assert.That(pc.Group, Is.EqualTo(0)); |
350 | Assert.That(pc.Others, Is.EqualTo(1)); | 350 | Assert.That(pc.Others, Is.EqualTo(1)); |
@@ -352,9 +352,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
352 | Assert.That(pc.Selected, Is.EqualTo(0)); | 352 | Assert.That(pc.Selected, Is.EqualTo(0)); |
353 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 353 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
354 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(1)); | 354 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(1)); |
355 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 355 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
356 | } | 356 | } |
357 | 357 | ||
358 | /// <summary> | 358 | /// <summary> |
359 | /// Test the count is correct after is has been tainted. | 359 | /// Test the count is correct after is has been tainted. |
360 | /// </summary> | 360 | /// </summary> |
@@ -363,12 +363,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
363 | { | 363 | { |
364 | TestHelpers.InMethod(); | 364 | TestHelpers.InMethod(); |
365 | IPrimCounts pc = m_lo.PrimCounts; | 365 | IPrimCounts pc = m_lo.PrimCounts; |
366 | 366 | ||
367 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 367 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
368 | m_scene.AddNewSceneObject(sog, false); | 368 | m_scene.AddNewSceneObject(sog, false); |
369 | 369 | ||
370 | m_pcm.TaintPrimCount(); | 370 | m_pcm.TaintPrimCount(); |
371 | 371 | ||
372 | Assert.That(pc.Owner, Is.EqualTo(3)); | 372 | Assert.That(pc.Owner, Is.EqualTo(3)); |
373 | Assert.That(pc.Group, Is.EqualTo(0)); | 373 | Assert.That(pc.Group, Is.EqualTo(0)); |
374 | Assert.That(pc.Others, Is.EqualTo(0)); | 374 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -376,7 +376,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
376 | Assert.That(pc.Selected, Is.EqualTo(0)); | 376 | Assert.That(pc.Selected, Is.EqualTo(0)); |
377 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); | 377 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); |
378 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 378 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
379 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 379 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
380 | } | 380 | } |
381 | } | 381 | } |
382 | } \ No newline at end of file | 382 | } \ No newline at end of file |