aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorThomas Grimshaw2010-04-05 22:08:34 +0200
committerThomas Grimshaw2010-04-05 22:08:34 +0200
commitf34cc6b46949033803c79235b9d82da9bf9634dd (patch)
treed1117656803e210151e480b960184bc4524f129e
parentChange land overlay to send group owned status properly (diff)
downloadopensim-SC-f34cc6b46949033803c79235b9d82da9bf9634dd.zip
opensim-SC-f34cc6b46949033803c79235b9d82da9bf9634dd.tar.gz
opensim-SC-f34cc6b46949033803c79235b9d82da9bf9634dd.tar.bz2
opensim-SC-f34cc6b46949033803c79235b9d82da9bf9634dd.tar.xz
Add a much cheaper agent count retrieval method. This is obsoleted by 0.7 so it can be reverted then.
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs2
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs2
4 files changed, 12 insertions, 4 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
index ed18207..dea166d 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
@@ -192,7 +192,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
192 192
193 protected string RegionStats(OSHttpResponse httpResponse, Scene scene) 193 protected string RegionStats(OSHttpResponse httpResponse, Scene scene)
194 { 194 {
195 int users = scene.GetAvatars().Count; 195 int users = scene.GetRootAgentCount();
196 int objects = scene.Entities.Count - users; 196 int objects = scene.Entities.Count - users;
197 197
198 RestXmlWriter rxw = new RestXmlWriter(new StringWriter()); 198 RestXmlWriter rxw = new RestXmlWriter(new StringWriter());
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs
index 5798286..82e9d9b 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs
@@ -125,7 +125,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
125 rxw.WriteString(s.RegionInfo.InternalEndPoint.ToString()); 125 rxw.WriteString(s.RegionInfo.InternalEndPoint.ToString());
126 rxw.WriteEndAttribute(); 126 rxw.WriteEndAttribute();
127 127
128 int users = s.GetAvatars().Count; 128 int users = s.GetRootAgentCount();
129 rxw.WriteStartAttribute(String.Empty, "avatars", String.Empty); 129 rxw.WriteStartAttribute(String.Empty, "avatars", String.Empty);
130 rxw.WriteValue(users); 130 rxw.WriteValue(users);
131 rxw.WriteEndAttribute(); 131 rxw.WriteEndAttribute();
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ab0d397..e5e6fc9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1523,7 +1523,7 @@ namespace OpenSim.Region.Framework.Scenes
1523 public void SaveTerrain() 1523 public void SaveTerrain()
1524 { 1524 {
1525 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); 1525 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
1526 } 1526 }
1527 1527
1528 public void StoreWindlightProfile(RegionMeta7WindlightData wl) 1528 public void StoreWindlightProfile(RegionMeta7WindlightData wl)
1529 { 1529 {
@@ -4339,6 +4339,14 @@ namespace OpenSim.Region.Framework.Scenes
4339 } 4339 }
4340 4340
4341 /// <summary> 4341 /// <summary>
4342 /// Cheaply return the number of avatars in a region (without fetching a list object)
4343 /// </summary>
4344 public int GetRootAgentCount()
4345 {
4346 return m_sceneGraph.GetRootAgentCount();
4347 }
4348
4349 /// <summary>
4342 /// Return a list of all ScenePresences in this region. This returns child agents as well as root agents. 4350 /// Return a list of all ScenePresences in this region. This returns child agents as well as root agents.
4343 /// This list is a new object, so it can be iterated over without locking. 4351 /// This list is a new object, so it can be iterated over without locking.
4344 /// </summary> 4352 /// </summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 10ebf67..a76f386 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5266,7 +5266,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5266 public LSL_Integer llGetRegionAgentCount() 5266 public LSL_Integer llGetRegionAgentCount()
5267 { 5267 {
5268 m_host.AddScriptLPS(1); 5268 m_host.AddScriptLPS(1);
5269 return new LSL_Integer(World.GetAvatars().Count); 5269 return new LSL_Integer(World.GetRootAgentCount());
5270 } 5270 }
5271 5271
5272 public LSL_Vector llGetRegionCorner() 5272 public LSL_Vector llGetRegionCorner()