aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/LandData.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs24
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandObject.cs1
5 files changed, 28 insertions, 10 deletions
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index accf52e..a9a493d 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -697,6 +697,8 @@ namespace OpenSim.Framework
697 landData._mediaLoop = _mediaLoop; 697 landData._mediaLoop = _mediaLoop;
698 landData._obscureMusic = _obscureMusic; 698 landData._obscureMusic = _obscureMusic;
699 landData._obscureMedia = _obscureMedia; 699 landData._obscureMedia = _obscureMedia;
700 landData._simwideArea = _simwideArea;
701 landData._simwidePrims = _simwidePrims;
700 702
701 landData._parcelAccessList.Clear(); 703 landData._parcelAccessList.Clear();
702 foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList) 704 foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 5dab1bc..2c6795f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4333,7 +4333,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4333 updateMessage.SequenceID = sequence_id; 4333 updateMessage.SequenceID = sequence_id;
4334 if (landData.SimwideArea > 0) 4334 if (landData.SimwideArea > 0)
4335 { 4335 {
4336 updateMessage.SimWideMaxPrims = parcelObjectCapacity; 4336 int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
4337 updateMessage.SimWideMaxPrims = simulatorCapacity;
4337 } 4338 }
4338 else 4339 else
4339 { 4340 {
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index a46be13..893e35c 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -709,7 +709,7 @@ namespace OpenSim.Region.CoreModules.World.Land
709 int x; 709 int x;
710 int y; 710 int y;
711 711
712 if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0) 712 if (x_float >= Constants.RegionSize || x_float < 0 || y_float >= Constants.RegionSize || y_float < 0)
713 return null; 713 return null;
714 714
715 try 715 try
@@ -751,10 +751,10 @@ namespace OpenSim.Region.CoreModules.World.Land
751 { 751 {
752 try 752 try
753 { 753 {
754 if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4])) 754 //if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4]))
755 return m_landList[m_landIDList[x / 4, y / 4]]; 755 return m_landList[m_landIDList[x / 4, y / 4]];
756 else 756 //else
757 return null; 757 // return null;
758 } 758 }
759 catch (IndexOutOfRangeException) 759 catch (IndexOutOfRangeException)
760 { 760 {
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index b90e307..46c15ed 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -66,6 +66,13 @@ namespace OpenSim.Region.CoreModules.World.Land
66 66
67 #region ILandObject Members 67 #region ILandObject Members
68 68
69 public int GetPrimsFree()
70 {
71 m_scene.EventManager.TriggerParcelPrimCountUpdate();
72 int free = GetSimulatorMaxPrimCount(this) - m_landData.SimwidePrims;
73 return free;
74 }
75
69 public LandData LandData 76 public LandData LandData
70 { 77 {
71 get { return m_landData; } 78 get { return m_landData; }
@@ -141,7 +148,7 @@ namespace OpenSim.Region.CoreModules.World.Land
141 /// <returns>Returns true if the piece of land contains the specified point</returns> 148 /// <returns>Returns true if the piece of land contains the specified point</returns>
142 public bool ContainsPoint(int x, int y) 149 public bool ContainsPoint(int x, int y)
143 { 150 {
144 if (x >= 0 && y >= 0 && x <= Constants.RegionSize && y <= Constants.RegionSize) 151 if (x >= 0 && y >= 0 && x < Constants.RegionSize && y < Constants.RegionSize)
145 { 152 {
146 return (LandBitmap[x / 4, y / 4] == true); 153 return (LandBitmap[x / 4, y / 4] == true);
147 } 154 }
@@ -183,7 +190,11 @@ namespace OpenSim.Region.CoreModules.World.Land
183 else 190 else
184 { 191 {
185 // Normal Calculations 192 // Normal Calculations
186 return (int)Math.Round(((float)LandData.Area / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus); 193 int parcelMax = (int)(((float)LandData.Area / 65536.0f)
194 * (float)m_scene.RegionInfo.ObjectCapacity
195 * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
196 // TODO: The calculation of ObjectBonus should be refactored. It does still not work in the same manner as SL!
197 return parcelMax;
187 } 198 }
188 } 199 }
189 public int GetSimulatorMaxPrimCount(ILandObject thisObject) 200 public int GetSimulatorMaxPrimCount(ILandObject thisObject)
@@ -195,7 +206,9 @@ namespace OpenSim.Region.CoreModules.World.Land
195 else 206 else
196 { 207 {
197 //Normal Calculations 208 //Normal Calculations
198 return m_scene.RegionInfo.ObjectCapacity; 209 int simMax = (int)(((float)LandData.SimwideArea / 65536.0f)
210 * (float)m_scene.RegionInfo.ObjectCapacity);
211 return simMax;
199 } 212 }
200 } 213 }
201 #endregion 214 #endregion
@@ -369,7 +382,7 @@ namespace OpenSim.Region.CoreModules.World.Land
369 newData.AuthBuyerID = UUID.Zero; 382 newData.AuthBuyerID = UUID.Zero;
370 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); 383 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
371 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 384 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
372 385 m_scene.EventManager.TriggerParcelPrimCountUpdate();
373 SendLandUpdateToAvatarsOverMe(true); 386 SendLandUpdateToAvatarsOverMe(true);
374 } 387 }
375 388
@@ -384,7 +397,7 @@ namespace OpenSim.Region.CoreModules.World.Land
384 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); 397 newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
385 398
386 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 399 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
387 400 m_scene.EventManager.TriggerParcelPrimCountUpdate();
388 SendLandUpdateToAvatarsOverMe(true); 401 SendLandUpdateToAvatarsOverMe(true);
389 } 402 }
390 403
@@ -450,6 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Land
450 463
451 public void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client) 464 public void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client)
452 { 465 {
466 m_scene.EventManager.TriggerParcelPrimCountUpdate();
453 SendLandProperties(0, snap_selection, 0, remote_client); 467 SendLandProperties(0, snap_selection, 0, remote_client);
454 } 468 }
455 469
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
index 576b645..eeb9d3a 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
@@ -39,6 +39,7 @@ namespace OpenSim.Region.Framework.Interfaces
39 { 39 {
40 int GetParcelMaxPrimCount(ILandObject thisObject); 40 int GetParcelMaxPrimCount(ILandObject thisObject);
41 int GetSimulatorMaxPrimCount(ILandObject thisObject); 41 int GetSimulatorMaxPrimCount(ILandObject thisObject);
42 int GetPrimsFree();
42 43
43 LandData LandData { get; set; } 44 LandData LandData { get; set; }
44 bool[,] LandBitmap { get; set; } 45 bool[,] LandBitmap { get; set; }