Make timed bans / timed passes work as expected. Prevent transmission of media

URLs to banned clients.
avinationmerge
Melanie 2012-06-07 00:24:33 +02:00
parent 5876a4d392
commit a945105003
2 changed files with 34 additions and 2 deletions

View File

@ -1100,6 +1100,8 @@ namespace OpenSim.Region.CoreModules.World.Land
if (currentParcel != null) if (currentParcel != null)
{ {
if (!temp.Contains(currentParcel)) if (!temp.Contains(currentParcel))
{
if (!currentParcel.IsEitherBannedOrRestricted(remote_client.AgentId))
{ {
currentParcel.ForceUpdateLandInfo(); currentParcel.ForceUpdateLandInfo();
temp.Add(currentParcel); temp.Add(currentParcel);
@ -1107,6 +1109,7 @@ namespace OpenSim.Region.CoreModules.World.Land
} }
} }
} }
}
int requestResult = LandChannel.LAND_RESULT_SINGLE; int requestResult = LandChannel.LAND_RESULT_SINGLE;
if (temp.Count > 1) if (temp.Count > 1)

View File

@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Land
private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax];
private int m_lastSeqId = 0; private int m_lastSeqId = 0;
private int m_expiryCounter = 0;
protected LandData m_landData = new LandData(); protected LandData m_landData = new LandData();
protected Scene m_scene; protected Scene m_scene;
@ -135,6 +136,8 @@ namespace OpenSim.Region.CoreModules.World.Land
else else
LandData.GroupID = UUID.Zero; LandData.GroupID = UUID.Zero;
LandData.IsGroupOwned = is_group_owned; LandData.IsGroupOwned = is_group_owned;
m_scene.EventManager.OnFrame += OnFrame;
} }
#endregion #endregion
@ -1196,6 +1199,17 @@ namespace OpenSim.Region.CoreModules.World.Land
#endregion #endregion
private void OnFrame()
{
m_expiryCounter++;
if (m_expiryCounter >= 50)
{
ExpireAccessList();
m_expiryCounter = 0;
}
}
private void ExpireAccessList() private void ExpireAccessList()
{ {
List<LandAccessEntry> delete = new List<LandAccessEntry>(); List<LandAccessEntry> delete = new List<LandAccessEntry>();
@ -1206,7 +1220,22 @@ namespace OpenSim.Region.CoreModules.World.Land
delete.Add(entry); delete.Add(entry);
} }
foreach (LandAccessEntry entry in delete) foreach (LandAccessEntry entry in delete)
{
LandData.ParcelAccessList.Remove(entry); LandData.ParcelAccessList.Remove(entry);
ScenePresence presence;
if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent))
{
ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
if (land.LandData.LocalID == LandData.LocalID)
{
Vector3 pos = m_scene.GetNearestAllowedPosition(presence, land);
presence.TeleportWithMomentum(pos);
presence.ControllingClient.SendAlertMessage("You have been ejected from this land");
}
}
m_log.DebugFormat("[LAND]: Removing entry {0} because it has expired", entry.AgentID);
}
if (delete.Count > 0) if (delete.Count > 0)
m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this);