diff options
author | Melanie Thielker | 2014-08-23 19:39:31 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-08-23 19:39:31 +0200 |
commit | 9ce1fd7a3ca688e8c4f5e9082b95aa9c6334293c (patch) | |
tree | 8764186e0c310fa5e7e1651bf370bea5726a1f26 /OpenSim | |
parent | Merge branch 'avination-current' (diff) | |
parent | Add an admin message to refesh a region's map tile. Will be used to periodically (diff) | |
download | opensim-SC-9ce1fd7a3ca688e8c4f5e9082b95aa9c6334293c.zip opensim-SC-9ce1fd7a3ca688e8c4f5e9082b95aa9c6334293c.tar.gz opensim-SC-9ce1fd7a3ca688e8c4f5e9082b95aa9c6334293c.tar.bz2 opensim-SC-9ce1fd7a3ca688e8c4f5e9082b95aa9c6334293c.tar.xz |
Merge branch 'avination-current'
Diffstat (limited to '')
3 files changed, 71 insertions, 2 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index eb5d784..4c05ec8 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -168,6 +168,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
168 | 168 | ||
169 | // Misc | 169 | // Misc |
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_get_opensim_version"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetOpenSimVersion); | 172 | availableMethods["admin_get_opensim_version"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetOpenSimVersion); |
172 | 173 | ||
173 | // Either enable full remote functionality or just selected features | 174 | // Either enable full remote functionality or just selected features |
@@ -2227,6 +2228,32 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2227 | m_log.Info("[RADMIN]: Refresh Search Request complete"); | 2228 | m_log.Info("[RADMIN]: Refresh Search Request complete"); |
2228 | } | 2229 | } |
2229 | 2230 | ||
2231 | private void XmlRpcRefreshMap(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) | ||
2232 | { | ||
2233 | m_log.Info("[RADMIN]: Received Refresh Map Request"); | ||
2234 | |||
2235 | Hashtable responseData = (Hashtable)response.Value; | ||
2236 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
2237 | |||
2238 | CheckRegionParams(requestData, responseData); | ||
2239 | |||
2240 | Scene scene = null; | ||
2241 | GetSceneFromRegionParams(requestData, responseData, out scene); | ||
2242 | |||
2243 | IMapTileModule mapTileModule = scene.RequestModuleInterface<IMapTileModule>(); | ||
2244 | if (mapTileModule != null) | ||
2245 | { | ||
2246 | mapTileModule.UploadMapTile(scene); | ||
2247 | responseData["success"] = true; | ||
2248 | } | ||
2249 | else | ||
2250 | { | ||
2251 | responseData["success"] = false; | ||
2252 | } | ||
2253 | |||
2254 | m_log.Info("[RADMIN]: Refresh Map Request complete"); | ||
2255 | } | ||
2256 | |||
2230 | private void XmlRpcGetOpenSimVersion(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) | 2257 | private void XmlRpcGetOpenSimVersion(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) |
2231 | { | 2258 | { |
2232 | m_log.Info("[RADMIN]: Received Get OpenSim Version Request"); | 2259 | m_log.Info("[RADMIN]: Received Get OpenSim Version Request"); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 40bedc1..96182cd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
53 | /// </remarks> | 53 | /// </remarks> |
54 | 54 | ||
55 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MapImageServiceModule")] | 55 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MapImageServiceModule")] |
56 | public class MapImageServiceModule : ISharedRegionModule | 56 | public class MapImageServiceModule : ISharedRegionModule, IMapTileModule |
57 | { | 57 | { |
58 | private static readonly ILog m_log = | 58 | private static readonly ILog m_log = |
59 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 59 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -143,6 +143,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
143 | lock (m_scenes) | 143 | lock (m_scenes) |
144 | m_scenes[scene.RegionInfo.RegionID] = scene; | 144 | m_scenes[scene.RegionInfo.RegionID] = scene; |
145 | 145 | ||
146 | scene.RegisterModuleInterface<IMapTileModule>(this); | ||
147 | |||
146 | scene.EventManager.OnRegionReadyStatusChange += s => { if (s.Ready) UploadMapTile(s); }; | 148 | scene.EventManager.OnRegionReadyStatusChange += s => { if (s.Ready) UploadMapTile(s); }; |
147 | } | 149 | } |
148 | 150 | ||
@@ -193,7 +195,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
193 | ///<summary> | 195 | ///<summary> |
194 | /// | 196 | /// |
195 | ///</summary> | 197 | ///</summary> |
196 | private void UploadMapTile(IScene scene) | 198 | public void UploadMapTile(IScene scene) |
197 | { | 199 | { |
198 | m_log.DebugFormat("[MAP IMAGE SERVICE MODULE]: upload maptile for {0}", scene.RegionInfo.RegionName); | 200 | m_log.DebugFormat("[MAP IMAGE SERVICE MODULE]: upload maptile for {0}", scene.RegionInfo.RegionName); |
199 | 201 | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IMapTileModule.cs b/OpenSim/Region/Framework/Interfaces/IMapTileModule.cs new file mode 100644 index 0000000..4d64236 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IMapTileModule.cs | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using OpenMetaverse; | ||
29 | using OpenSim.Framework; | ||
30 | |||
31 | namespace OpenSim.Region.Framework.Interfaces | ||
32 | { | ||
33 | public interface IMapTileModule | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// Upload a new maptile | ||
37 | /// </summary> | ||
38 | void UploadMapTile(IScene scene); | ||
39 | } | ||
40 | } | ||