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.
This commit is contained in:
Melanie Thielker
2014-08-23 19:38:08 +02:00
parent 39e052982b
commit 1fc5dadc60
3 changed files with 71 additions and 2 deletions

View File

@@ -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<IMapTileModule>();
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");