diff options
author | Melanie | 2010-10-23 00:18:56 +0200 |
---|---|---|
committer | Melanie | 2010-10-23 00:18:56 +0200 |
commit | c3ddf461880ded2bff0f9ca6bd6b956fbe4c23d5 (patch) | |
tree | 65c434f0610abaf1b33074479def128ae8880c1b /OpenSim/Region/CoreModules/World | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC-c3ddf461880ded2bff0f9ca6bd6b956fbe4c23d5.zip opensim-SC-c3ddf461880ded2bff0f9ca6bd6b956fbe4c23d5.tar.gz opensim-SC-c3ddf461880ded2bff0f9ca6bd6b956fbe4c23d5.tar.bz2 opensim-SC-c3ddf461880ded2bff0f9ca6bd6b956fbe4c23d5.tar.xz |
Prevent database lookups on every avatar movement when land is set to group
access. Fixes a massive performance degradation.
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index bd1dd66..d0517b7 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -290,28 +290,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
290 | 290 | ||
291 | public bool HasGroupAccess(UUID avatar) | 291 | public bool HasGroupAccess(UUID avatar) |
292 | { | 292 | { |
293 | if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) | 293 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) |
294 | { | 294 | { |
295 | IGroupsModule groupsModule = | 295 | ScenePresence sp; |
296 | m_scene.RequestModuleInterface<IGroupsModule>(); | 296 | if (!m_scene.TryGetScenePresence(avatar, out sp)) |
297 | return false; | ||
297 | 298 | ||
298 | List<UUID> agentGroups = new List<UUID>(); | 299 | if (!sp.ControllingClient.IsGroupMember(LandData.GroupID)) |
299 | if (groupsModule != null) | 300 | return false; |
300 | { | 301 | |
301 | GroupMembershipData[] GroupMembership = | 302 | return true; |
302 | groupsModule.GetMembershipData(avatar); | ||
303 | |||
304 | if (GroupMembership != null) | ||
305 | { | ||
306 | for (int i = 0; i < GroupMembership.Length; i++) | ||
307 | { | ||
308 | if (LandData.GroupID == GroupMembership[i].GroupID) | ||
309 | { | ||
310 | return true; | ||
311 | } | ||
312 | } | ||
313 | } | ||
314 | } | ||
315 | } | 303 | } |
316 | return false; | 304 | return false; |
317 | } | 305 | } |