aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2014-08-23 19:38:08 +0200
committerMelanie Thielker2014-08-23 19:38:08 +0200
commit1fc5dadc604daebd4aeaf6954ac64f45fdfc7a2f (patch)
tree1898e9eee54d9cfbddea03b50d1b2c7c577a07cc /OpenSim/Region
parentFix a null ref that will cause an exception if a grid region doesnt' specify ... (diff)
downloadopensim-SC-1fc5dadc604daebd4aeaf6954ac64f45fdfc7a2f.zip
opensim-SC-1fc5dadc604daebd4aeaf6954ac64f45fdfc7a2f.tar.gz
opensim-SC-1fc5dadc604daebd4aeaf6954ac64f45fdfc7a2f.tar.bz2
opensim-SC-1fc5dadc604daebd4aeaf6954ac64f45fdfc7a2f.tar.xz
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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IMapTileModule.cs40
2 files changed, 44 insertions, 2 deletions
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
28using OpenMetaverse;
29using OpenSim.Framework;
30
31namespace 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}