From 18b91fdbe95ac499c92556f15f067ca94d88d343 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Sat, 12 Apr 2014 09:40:36 -0400 Subject: [PATCH] Tweak to PrimLimits and add missing Regions.ini example Signed-off-by: Melanie --- .../PrimLimitsModule/PrimLimitsModule.cs | 21 +++++-------------- bin/Regions/Regions.ini.example | 6 +++++- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 2b421e596b..395bbf1011 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs @@ -175,15 +175,9 @@ namespace OpenSim.Region.OptionalModules private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo, Scene scene) { string response = null; - EstateSettings estateSettings = scene.RegionInfo.EstateSettings; - // counts don't seem to be updated, so force it. - scene.EventManager.TriggerParcelPrimCountUpdate(); - - int usedPrims = lo.PrimCounts.Total; int simulatorCapacity = lo.GetSimulatorMaxPrimCount(); - - if ((objectCount + usedPrims) > simulatorCapacity) + if ((objectCount + lo.PrimCounts.Total) > simulatorCapacity) { response = "Unable to rez object because the parcel is too full"; } @@ -195,21 +189,16 @@ namespace OpenSim.Region.OptionalModules // per-user prim limit is set if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned) { - // caller is not the sole parcel owner + // caller is not the sole Parcel owner + EstateSettings estateSettings = scene.RegionInfo.EstateSettings; if (ownerID != estateSettings.EstateOwner) { // caller is NOT the Estate owner List mgrs = new List(estateSettings.EstateManagers); if (!mgrs.Contains(ownerID)) { - // caller is NOT an Estate Manager, so check quota - Dictionary objectMap = lo.GetLandObjectOwners(); - int currentCount; - if (!objectMap.TryGetValue(ownerID, out currentCount)) - { - currentCount = 0; - } - if ((currentCount + objectCount) > maxPrimsPerUser) + // caller is not an Estate Manager + if ((lo.PrimCounts.Users[ownerID] + objectCount) > maxPrimsPerUser) { response = "Unable to rez object because you have reached your limit"; } diff --git a/bin/Regions/Regions.ini.example b/bin/Regions/Regions.ini.example index 36ccd8c4db..253e897d28 100644 --- a/bin/Regions/Regions.ini.example +++ b/bin/Regions/Regions.ini.example @@ -34,6 +34,10 @@ ExternalHostName = "SYSTEMIP" ; MaxPrims = 15000 ; MaxAgents = 100 +; * Max prims per user (per parcel). +; * Negative values will disable the check. +; MaxPrimsPerUser = -1 + ; * ; * Multi-Tenancy. Only set if needed ; * @@ -83,4 +87,4 @@ ExternalHostName = "SYSTEMIP" ; * built using MapImageModule's terrain and prim renderer. Parcel 'for sale' overlays are ; * still drawn on top of the static map by the World Map module. -; MaptileStaticFile = "SomeFile.png" \ No newline at end of file +; MaptileStaticFile = "SomeFile.png"