Prevent database lookups on every avatar movement when land is set to group
access. Fixes a massive performance degradation.avinationmerge
parent
fc33d569cd
commit
c3ddf46188
|
@ -290,29 +290,17 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
|
||||
public bool HasGroupAccess(UUID avatar)
|
||||
{
|
||||
if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||
{
|
||||
IGroupsModule groupsModule =
|
||||
m_scene.RequestModuleInterface<IGroupsModule>();
|
||||
ScenePresence sp;
|
||||
if (!m_scene.TryGetScenePresence(avatar, out sp))
|
||||
return false;
|
||||
|
||||
List<UUID> agentGroups = new List<UUID>();
|
||||
if (groupsModule != null)
|
||||
{
|
||||
GroupMembershipData[] GroupMembership =
|
||||
groupsModule.GetMembershipData(avatar);
|
||||
if (!sp.ControllingClient.IsGroupMember(LandData.GroupID))
|
||||
return false;
|
||||
|
||||
if (GroupMembership != null)
|
||||
{
|
||||
for (int i = 0; i < GroupMembership.Length; i++)
|
||||
{
|
||||
if (LandData.GroupID == GroupMembership[i].GroupID)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue