aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land
diff options
context:
space:
mode:
authorUbitUmarov2016-10-11 01:14:53 +0100
committerUbitUmarov2016-10-11 01:14:53 +0100
commit7494d7726afd9f8b9762d78aead918ba7a90efa3 (patch)
treeae8a219bc88bc833b8b7aeb30a146de4bad2ccfd /OpenSim/Region/CoreModules/World/Land
parent remove attachment to event OnPreAgentUpdate that is doing nothing (diff)
downloadopensim-SC-7494d7726afd9f8b9762d78aead918ba7a90efa3.zip
opensim-SC-7494d7726afd9f8b9762d78aead918ba7a90efa3.tar.gz
opensim-SC-7494d7726afd9f8b9762d78aead918ba7a90efa3.tar.bz2
opensim-SC-7494d7726afd9f8b9762d78aead918ba7a90efa3.tar.xz
change math on GetParcelMaxPrimCount and GetSimulatorMaxPrimCount to reduce round errors, limit both to region max prims. consider ObjectBonus on last one also. Change a variable name in PrimLimitsModule to make it more clear
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs25
1 files changed, 18 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 69a3455..4cbc8b8 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -341,10 +341,16 @@ namespace OpenSim.Region.CoreModules.World.Land
341 else 341 else
342 { 342 {
343 // Normal Calculations 343 // Normal Calculations
344 int parcelMax = (int)( (long)LandData.Area 344 int parcelMax = (int)(
345 * (long)m_scene.RegionInfo.ObjectCapacity 345 (double)LandData.Area
346 * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus 346 * (double)m_scene.RegionInfo.ObjectCapacity
347 / (long)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY) ); 347 * (double)m_scene.RegionInfo.RegionSettings.ObjectBonus
348 / (double)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY)
349 + 0.5 );
350
351 if(parcelMax > m_scene.RegionInfo.ObjectCapacity)
352 parcelMax = m_scene.RegionInfo.ObjectCapacity;
353
348 //m_log.DebugFormat("Area: {0}, Capacity {1}, Bonus {2}, Parcel {3}", LandData.Area, m_scene.RegionInfo.ObjectCapacity, m_scene.RegionInfo.RegionSettings.ObjectBonus, parcelMax); 354 //m_log.DebugFormat("Area: {0}, Capacity {1}, Bonus {2}, Parcel {3}", LandData.Area, m_scene.RegionInfo.ObjectCapacity, m_scene.RegionInfo.RegionSettings.ObjectBonus, parcelMax);
349 return parcelMax; 355 return parcelMax;
350 } 356 }
@@ -359,9 +365,14 @@ namespace OpenSim.Region.CoreModules.World.Land
359 else 365 else
360 { 366 {
361 //Normal Calculations 367 //Normal Calculations
362 int simMax = (int)( (long)LandData.SimwideArea 368 int simMax = (int)( (double)LandData.SimwideArea
363 * (long)m_scene.RegionInfo.ObjectCapacity 369 * (double)m_scene.RegionInfo.ObjectCapacity
364 / (long)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY) ); 370 * (double)m_scene.RegionInfo.RegionSettings.ObjectBonus
371 / (long)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY)
372 +0.5 );
373
374 if(simMax > m_scene.RegionInfo.ObjectCapacity)
375 simMax = m_scene.RegionInfo.ObjectCapacity;
365 //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}",
366 // LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax, LandData.SimwidePrims); 377 // LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax, LandData.SimwidePrims);
367 return simMax; 378 return simMax;