Check ban list for a particular parcel only when an avatar moves into it.

This restores functionality remove in the last commit without reintroducing
the performance penalty.
iar_mods
Melanie 2012-02-05 04:03:32 +00:00
parent 35f14a262d
commit 8923ad755d
2 changed files with 17 additions and 4 deletions

View File

@ -389,6 +389,8 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT)
{ {
ExpireAccessList(parcelAvatarIsEntering);
if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID))
{ {
SendYouAreBannedNotice(avatar); SendYouAreBannedNotice(avatar);
@ -1711,5 +1713,20 @@ namespace OpenSim.Region.CoreModules.World.Land
MainConsole.Instance.Output(report.ToString()); MainConsole.Instance.Output(report.ToString());
} }
private void ExpireAccessList(ILandObject land)
{
List<LandAccessEntry> delete = new List<LandAccessEntry>();
foreach (LandAccessEntry entry in land.LandData.ParcelAccessList)
{
if (entry.Expires != 0 && entry.Expires < Util.UnixTimeSinceEpoch())
delete.Add(entry);
}
foreach (LandAccessEntry entry in delete)
land.LandData.ParcelAccessList.Remove(entry);
m_scene.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
}
} }
} }

View File

@ -418,8 +418,6 @@ namespace OpenSim.Region.CoreModules.World.Land
public bool IsBannedFromLand(UUID avatar) public bool IsBannedFromLand(UUID avatar)
{ {
// ExpireAccessList();
//
if (m_scene.Permissions.IsAdministrator(avatar)) if (m_scene.Permissions.IsAdministrator(avatar))
return false; return false;
@ -447,8 +445,6 @@ namespace OpenSim.Region.CoreModules.World.Land
public bool IsRestrictedFromLand(UUID avatar) public bool IsRestrictedFromLand(UUID avatar)
{ {
// ExpireAccessList();
//
if (m_scene.Permissions.IsAdministrator(avatar)) if (m_scene.Permissions.IsAdministrator(avatar))
return false; return false;