diff options
author | Snoopy Pfeffer | 2012-04-05 11:10:05 +0200 |
---|---|---|
committer | Snoopy Pfeffer | 2012-04-05 11:10:05 +0200 |
commit | 8f45eb913c6fad38735f00db818e03c4123904aa (patch) | |
tree | 7f3611e581ca820cfecb9b42dca37ac05c1f5a65 /OpenSim | |
parent | Group based access restrictions to parcels require group membership, but not ... (diff) | |
download | opensim-SC-8f45eb913c6fad38735f00db818e03c4123904aa.zip opensim-SC-8f45eb913c6fad38735f00db818e03c4123904aa.tar.gz opensim-SC-8f45eb913c6fad38735f00db818e03c4123904aa.tar.bz2 opensim-SC-8f45eb913c6fad38735f00db818e03c4123904aa.tar.xz |
Revert last commit
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index a7c7cc5..ced7b52 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -424,34 +424,37 @@ 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 | bool isMember; | 427 | ScenePresence sp; |
428 | if (m_groupMemberCache.TryGetValue(avatar, out isMember)) | 428 | if (!m_scene.TryGetScenePresence(avatar, out sp)) |
429 | return isMember; | ||
430 | |||
431 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
432 | if (groupsModule == null) | ||
433 | { | 429 | { |
434 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | 430 | bool isMember; |
435 | return false; | 431 | if (m_groupMemberCache.TryGetValue(avatar, out isMember)) |
436 | } | 432 | return isMember; |
437 | 433 | ||
438 | GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); | 434 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); |
439 | if (membership == null || membership.Length == 0) | 435 | if (groupsModule == null) |
440 | { | 436 | return false; |
441 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | ||
442 | return false; | ||
443 | } | ||
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) | ||
448 | { | 440 | { |
449 | m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout); | 441 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); |
450 | return true; | 442 | return false; |
451 | } | 443 | } |
444 | |||
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; | ||
452 | } | 455 | } |
453 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | 456 | |
454 | return false; | 457 | return sp.ControllingClient.IsGroupMember(LandData.GroupID); |
455 | } | 458 | } |
456 | return false; | 459 | return false; |
457 | } | 460 | } |