diff options
author | Dev Random | 2014-04-12 09:40:36 -0400 |
---|---|---|
committer | Melanie | 2014-04-12 14:40:34 +0100 |
commit | 18b91fdbe95ac499c92556f15f067ca94d88d343 (patch) | |
tree | dbd155ceea59b66120f4c8d0a1584e677e9b7dd5 /OpenSim/Region/OptionalModules | |
parent | Add per-user checking to PrimLimitsModule (diff) | |
download | opensim-SC_OLD-18b91fdbe95ac499c92556f15f067ca94d88d343.zip opensim-SC_OLD-18b91fdbe95ac499c92556f15f067ca94d88d343.tar.gz opensim-SC_OLD-18b91fdbe95ac499c92556f15f067ca94d88d343.tar.bz2 opensim-SC_OLD-18b91fdbe95ac499c92556f15f067ca94d88d343.tar.xz |
Tweak to PrimLimits and add missing Regions.ini example
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r-- | OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 2b421e5..395bbf1 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |||
@@ -175,15 +175,9 @@ namespace OpenSim.Region.OptionalModules | |||
175 | private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo, Scene scene) | 175 | private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo, Scene scene) |
176 | { | 176 | { |
177 | string response = null; | 177 | string response = null; |
178 | EstateSettings estateSettings = scene.RegionInfo.EstateSettings; | ||
179 | 178 | ||
180 | // counts don't seem to be updated, so force it. | ||
181 | scene.EventManager.TriggerParcelPrimCountUpdate(); | ||
182 | |||
183 | int usedPrims = lo.PrimCounts.Total; | ||
184 | int simulatorCapacity = lo.GetSimulatorMaxPrimCount(); | 179 | int simulatorCapacity = lo.GetSimulatorMaxPrimCount(); |
185 | 180 | if ((objectCount + lo.PrimCounts.Total) > simulatorCapacity) | |
186 | if ((objectCount + usedPrims) > simulatorCapacity) | ||
187 | { | 181 | { |
188 | response = "Unable to rez object because the parcel is too full"; | 182 | response = "Unable to rez object because the parcel is too full"; |
189 | } | 183 | } |
@@ -195,21 +189,16 @@ namespace OpenSim.Region.OptionalModules | |||
195 | // per-user prim limit is set | 189 | // per-user prim limit is set |
196 | if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned) | 190 | if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned) |
197 | { | 191 | { |
198 | // caller is not the sole parcel owner | 192 | // caller is not the sole Parcel owner |
193 | EstateSettings estateSettings = scene.RegionInfo.EstateSettings; | ||
199 | if (ownerID != estateSettings.EstateOwner) | 194 | if (ownerID != estateSettings.EstateOwner) |
200 | { | 195 | { |
201 | // caller is NOT the Estate owner | 196 | // caller is NOT the Estate owner |
202 | List<UUID> mgrs = new List<UUID>(estateSettings.EstateManagers); | 197 | List<UUID> mgrs = new List<UUID>(estateSettings.EstateManagers); |
203 | if (!mgrs.Contains(ownerID)) | 198 | if (!mgrs.Contains(ownerID)) |
204 | { | 199 | { |
205 | // caller is NOT an Estate Manager, so check quota | 200 | // caller is not an Estate Manager |
206 | Dictionary<UUID, int> objectMap = lo.GetLandObjectOwners(); | 201 | if ((lo.PrimCounts.Users[ownerID] + objectCount) > maxPrimsPerUser) |
207 | int currentCount; | ||
208 | if (!objectMap.TryGetValue(ownerID, out currentCount)) | ||
209 | { | ||
210 | currentCount = 0; | ||
211 | } | ||
212 | if ((currentCount + objectCount) > maxPrimsPerUser) | ||
213 | { | 202 | { |
214 | response = "Unable to rez object because you have reached your limit"; | 203 | response = "Unable to rez object because you have reached your limit"; |
215 | } | 204 | } |