Enforce region agent limit as set in estate tools

avinationmerge
Melanie 2010-09-30 20:01:55 +02:00
parent 521e2c8355
commit 7ad1b60eca
2 changed files with 13 additions and 0 deletions

View File

@ -3856,6 +3856,14 @@ namespace OpenSim.Region.Framework.Scenes
// We have to wait until the viewer contacts this region after receiving EAC.
// That calls AddNewClient, which finally creates the ScenePresence
int num = m_sceneGraph.GetNumberOfScenePresences();
if (num >= RegionInfo.RegionSettings.AgentLimit)
{
if (!Permissions.IsAdministrator(cAgentData.AgentID))
return false;
}
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
if (childAgentUpdate != null)
{

View File

@ -826,6 +826,11 @@ namespace OpenSim.Region.Framework.Scenes
return m_scenePresenceArray;
}
public int GetNumberOfScenePresences()
{
return m_scenePresenceArray.Count;
}
/// <summary>
/// Request a scene presence by UUID. Fast, indexed lookup.
/// </summary>