From 282e116f948d431b570f7c17425cfc0a8ea767a2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 21 Apr 2011 22:34:49 +0200 Subject: Honor agent limit for region crossings and teleports --- OpenSim/Region/Framework/Scenes/Scene.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index eed5ebc..e29b51c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5191,6 +5191,17 @@ namespace OpenSim.Region.Framework.Scenes return true; } + int num = m_sceneGraph.GetNumberOfScenePresences(); + + if (num >= RegionInfo.RegionSettings.AgentLimit) + { + if (!Permissions.IsAdministrator(cAgentData.AgentID)) + { + reason = "The region is full"; + return false; + } + } + if (!AuthorizeUser(agentID, out reason)) { // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); -- cgit v1.1