Merge branch 'master' of /home/opensim/var/repo/opensim

bulletsim
BlueWall 2011-04-21 19:08:31 -04:00
commit cbe49ed917
2 changed files with 25 additions and 0 deletions

View File

@ -3665,6 +3665,15 @@ namespace OpenSim.Region.Framework.Scenes
return false; return false;
} }
int num = m_sceneGraph.GetNumberOfScenePresences();
if (num >= RegionInfo.RegionSettings.AgentLimit)
{
if (!Permissions.IsAdministrator(cAgentData.AgentID))
return false;
}
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
if (childAgentUpdate != null) if (childAgentUpdate != null)
@ -4966,6 +4975,17 @@ namespace OpenSim.Region.Framework.Scenes
// child agent creation, thereby emulating the SL behavior. // child agent creation, thereby emulating the SL behavior.
public bool QueryAccess(UUID agentID, Vector3 position, out string reason) public bool QueryAccess(UUID agentID, Vector3 position, out string reason)
{ {
int num = m_sceneGraph.GetNumberOfScenePresences();
if (num >= RegionInfo.RegionSettings.AgentLimit)
{
if (!Permissions.IsAdministrator(agentID))
{
reason = "The region is full";
return false;
}
}
reason = String.Empty; reason = String.Empty;
return true; return true;
} }

View File

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