From b6e7e5ed424c4c26c3f86f8decbd2b15a5ab90e1 Mon Sep 17 00:00:00 2001 From: diva Date: Wed, 11 Feb 2009 21:07:41 +0000 Subject: Enforce estate bans on Teleports. --- OpenSim/Region/Framework/Scenes/Scene.cs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 18245e5..848b497 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2286,6 +2286,32 @@ namespace OpenSim.Region.Framework.Scenes public override void AddNewClient(IClientAPI client) { + if (m_regInfo.EstateSettings.IsBanned(client.AgentId)) + { + m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", + client.AgentId, client.FirstName, client.LastName, RegionInfo.RegionName); + client.SendAlertMessage("Denied access to region " + RegionInfo.RegionName + ". You have been banned from that region."); + try + { + IEventQueue eq = RequestModuleInterface(); + if (eq != null) + { + eq.DisableSimulator(RegionInfo.RegionHandle, client.AgentId); + } + else + client.SendShutdownConnectionNotice(); + + client.Close(false); + CapsModule.RemoveCapsHandler(client.AgentId); + m_authenticateHandler.RemoveCircuit(client.CircuitCode); + } + catch (Exception e) + { + m_log.DebugFormat("[SCENE]: Exception while closing banned client {0} {1}: {2}", client.FirstName, client.LastName, e.Message); + } + } + + SubscribeToClientEvents(client); ScenePresence presence; @@ -2803,7 +2829,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) { m_log.WarnFormat( - "[CONNECTION BEGIN]: Denied access to: {0} at {1} because the user is on the region banlist", + "[CONNECTION BEGIN]: Incoming user {0} at {1} is on the region banlist", agent.AgentID, RegionInfo.RegionName); } -- cgit v1.1