Implement agent limits
parent
212326eeb0
commit
13d6e05d5a
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue