diff options
author | Melanie Thielker | 2014-11-21 04:41:45 +0100 |
---|---|---|
committer | Melanie Thielker | 2014-11-21 04:42:27 +0100 |
commit | 6a849e8cdfaa881cea18d10bcffc89bbe4414f74 (patch) | |
tree | ebe1a336989d747fc21fc67858e7b777d2238ddb /OpenSim | |
parent | Merge branch 'ubitworkmaster' (diff) | |
download | opensim-SC-6a849e8cdfaa881cea18d10bcffc89bbe4414f74.zip opensim-SC-6a849e8cdfaa881cea18d10bcffc89bbe4414f74.tar.gz opensim-SC-6a849e8cdfaa881cea18d10bcffc89bbe4414f74.tar.bz2 opensim-SC-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 '')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 26 |
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> |