aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
authorMelanie Thielker2014-11-21 04:41:45 +0100
committerMelanie Thielker2014-11-21 04:42:27 +0100
commit6a849e8cdfaa881cea18d10bcffc89bbe4414f74 (patch)
treeebe1a336989d747fc21fc67858e7b777d2238ddb /OpenSim/ApplicationPlugins
parentMerge branch 'ubitworkmaster' (diff)
downloadopensim-SC_OLD-6a849e8cdfaa881cea18d10bcffc89bbe4414f74.zip
opensim-SC_OLD-6a849e8cdfaa881cea18d10bcffc89bbe4414f74.tar.gz
opensim-SC_OLD-6a849e8cdfaa881cea18d10bcffc89bbe4414f74.tar.bz2
opensim-SC_OLD-6a849e8cdfaa881cea18d10bcffc89bbe4414f74.tar.xz
Add an XmlRpc method to get a region's root agent count. This is intended
to let us restart grid regions when the last agent leaves.
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 4c05ec8..eba6a9c 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -170,6 +170,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
170 availableMethods["admin_refresh_search"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshSearch); 170 availableMethods["admin_refresh_search"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshSearch);
171 availableMethods["admin_refresh_map"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshMap); 171 availableMethods["admin_refresh_map"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshMap);
172 availableMethods["admin_get_opensim_version"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetOpenSimVersion); 172 availableMethods["admin_get_opensim_version"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetOpenSimVersion);
173 availableMethods["admin_get_agent_count"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetAgentCount);
173 174
174 // Either enable full remote functionality or just selected features 175 // Either enable full remote functionality or just selected features
175 string enabledMethods = m_config.GetString("enabled_methods", "all"); 176 string enabledMethods = m_config.GetString("enabled_methods", "all");
@@ -2266,6 +2267,31 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2266 m_log.Info("[RADMIN]: Get OpenSim Version Request complete"); 2267 m_log.Info("[RADMIN]: Get OpenSim Version Request complete");
2267 } 2268 }
2268 2269
2270 private void XmlRpcGetAgentCount(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
2271 {
2272 m_log.Info("[RADMIN]: Received Get Agent Count Request");
2273
2274 Hashtable responseData = (Hashtable)response.Value;
2275 Hashtable requestData = (Hashtable)request.Params[0];
2276
2277 CheckRegionParams(requestData, responseData);
2278
2279 Scene scene = null;
2280 GetSceneFromRegionParams(requestData, responseData, out scene);
2281
2282 if (scene == null)
2283 {
2284 responseData["success"] = false;
2285 }
2286 else
2287 {
2288 responseData["count"] = scene.GetRootAgentCount();
2289 responseData["success"] = true;
2290 }
2291
2292 m_log.Info("[RADMIN]: Get Agent Count Request complete");
2293 }
2294
2269 /// <summary> 2295 /// <summary>
2270 /// Parse a float with the given parameter name from a request data hash table. 2296 /// Parse a float with the given parameter name from a request data hash table.
2271 /// </summary> 2297 /// </summary>