aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs47
1 files changed, 22 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index ced7b52..a7c7cc5 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -424,37 +424,34 @@ namespace OpenSim.Region.CoreModules.World.Land
424 { 424 {
425 if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) 425 if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
426 { 426 {
427 ScenePresence sp; 427 bool isMember;
428 if (!m_scene.TryGetScenePresence(avatar, out sp)) 428 if (m_groupMemberCache.TryGetValue(avatar, out isMember))
429 { 429 return isMember;
430 bool isMember;
431 if (m_groupMemberCache.TryGetValue(avatar, out isMember))
432 return isMember;
433
434 IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
435 if (groupsModule == null)
436 return false;
437 430
438 GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); 431 IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
439 if (membership == null || membership.Length == 0) 432 if (groupsModule == null)
440 { 433 {
441 m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); 434 m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout);
442 return false; 435 return false;
443 } 436 }
444 437
445 foreach (GroupMembershipData d in membership) 438 GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar);
446 { 439 if (membership == null || membership.Length == 0)
447 if (d.GroupID == LandData.GroupID) 440 {
448 {
449 m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout);
450 return true;
451 }
452 }
453 m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); 441 m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout);
454 return false; 442 return false;
455 } 443 }
456 444
457 return sp.ControllingClient.IsGroupMember(LandData.GroupID); 445 foreach (GroupMembershipData d in membership)
446 {
447 if (d.GroupID == LandData.GroupID)
448 {
449 m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout);
450 return true;
451 }
452 }
453 m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout);
454 return false;
458 } 455 }
459 return false; 456 return false;
460 } 457 }