Add admin_refresh_search command to RemoteAdmin

avinationmerge
Melanie 2013-01-16 14:52:04 +01:00
parent b5f5400e06
commit 451b6c0e82
1 changed files with 29 additions and 0 deletions

View File

@ -157,6 +157,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
availableMethods["admin_acl_remove"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListRemove);
availableMethods["admin_acl_list"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListList);
// Misc
availableMethods["admin_refresh_search"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshSearch);
// Either enable full remote functionality or just selected features
string enabledMethods = m_config.GetString("enabled_methods", "all");
@ -1948,6 +1951,32 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = true;
}
private void XmlRpcRefreshSearch(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: Received Refresh Search Request");
Hashtable responseData = (Hashtable)response.Value;
Hashtable requestData = (Hashtable)request.Params[0];
CheckRegionParams(requestData, responseData);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
ISearchModule searchModule = scene.RequestModuleInterface<ISearchModule>();
if (searchModule != null)
{
searchModule.Refresh();
responseData["success"] = true;
}
else
{
responseData["success"] = false;
}
m_log.Info("[RADMIN]: Refresh Search Request complete");
}
/// <summary>
/// Parse a float with the given parameter name from a request data hash table.
/// </summary>