From 1fc5dadc604daebd4aeaf6954ac64f45fdfc7a2f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 23 Aug 2014 19:38:08 +0200 Subject: Add an admin message to refesh a region's map tile. Will be used to periodically rebuild the world map to clean out unused tiles. --- .../RemoteController/RemoteAdminPlugin.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index e50dac6..d2a5c43 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -164,6 +164,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Misc availableMethods["admin_refresh_search"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshSearch); + availableMethods["admin_refresh_map"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshMap); availableMethods["admin_get_opensim_version"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetOpenSimVersion); // Either enable full remote functionality or just selected features @@ -2048,6 +2049,32 @@ namespace OpenSim.ApplicationPlugins.RemoteController m_log.Info("[RADMIN]: Refresh Search Request complete"); } + private void XmlRpcRefreshMap(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) + { + m_log.Info("[RADMIN]: Received Refresh Map Request"); + + Hashtable responseData = (Hashtable)response.Value; + Hashtable requestData = (Hashtable)request.Params[0]; + + CheckRegionParams(requestData, responseData); + + Scene scene = null; + GetSceneFromRegionParams(requestData, responseData, out scene); + + IMapTileModule mapTileModule = scene.RequestModuleInterface(); + if (mapTileModule != null) + { + mapTileModule.UploadMapTile(scene); + responseData["success"] = true; + } + else + { + responseData["success"] = false; + } + + m_log.Info("[RADMIN]: Refresh Map Request complete"); + } + private void XmlRpcGetOpenSimVersion(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) { m_log.Info("[RADMIN]: Received Get OpenSim Version Request"); -- cgit v1.1