Add userFlags check to isBanned. This checks bans against DenyAnonymous and DenyMinors. Note that the ban doesn't actually work yet due to some stuff mel's working on .

This commit is contained in:
Tom
2011-01-26 14:20:39 -08:00
parent 04c62c4959
commit 3ecf712e4d
5 changed files with 78 additions and 10 deletions

View File

@@ -338,11 +338,30 @@ namespace OpenSim.Framework
return false;
}
public bool IsBanned(UUID avatarID)
public bool IsBanned(UUID avatarID, int userFlags)
{
foreach (EstateBan ban in l_EstateBans)
if (ban.BannedUserID == avatarID)
return true;
if (!IsEstateManager(avatarID) && !HasAccess(avatarID))
{
if (DenyMinors)
{
if ((userFlags & 32) == 0)
{
return true;
}
}
if (DenyAnonymous)
{
if ((userFlags & 4) == 0)
{
return true;
}
}
}
return false;
}
@@ -350,7 +369,7 @@ namespace OpenSim.Framework
{
if (ban == null)
return;
if (!IsBanned(ban.BannedUserID))
if (!IsBanned(ban.BannedUserID, 32)) //Ignore age-based bans
l_EstateBans.Add(ban);
}