aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Hypergrid
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Hypergrid')
-rw-r--r--OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs43
1 files changed, 32 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
index e37cb59..6143c87 100644
--- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
@@ -37,30 +37,51 @@ using OpenSim.Region.Framework.Scenes;
37 37
38namespace OpenSim.Region.CoreModules.Hypergrid 38namespace OpenSim.Region.CoreModules.Hypergrid
39{ 39{
40 public class HGWorldMapModule : WorldMapModule, IRegionModule 40 public class HGWorldMapModule : WorldMapModule
41 { 41 {
42 private static readonly ILog m_log = 42 private static readonly ILog m_log =
43 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 #region IRegionModule Members 45 #region INonSharedRegionModule Members
46 46
47 public override void Initialise(Scene scene, IConfigSource config) 47 public override void Initialise(IConfigSource config)
48 { 48 {
49 IConfig startupConfig = config.Configs["Startup"]; 49 IConfig startupConfig = config.Configs["Startup"];
50 if (startupConfig.GetString("WorldMapModule", "WorldMap") == "HGWorldMap") 50 if (startupConfig.GetString("WorldMapModule", "WorldMap") == "HGWorldMap")
51 m_Enabled = true; 51 m_Enabled = true;
52 }
52 53
54 public override void AddRegion(Scene scene)
55 {
53 if (!m_Enabled) 56 if (!m_Enabled)
54 return; 57 return;
58
55 m_log.Info("[HGMap] Initializing..."); 59 m_log.Info("[HGMap] Initializing...");
56 m_scene = scene; 60 lock (scene)
61 {
62 m_scene = scene;
57 63
58 m_scene.RegisterModuleInterface<IWorldMapModule>(this); 64 m_scene.RegisterModuleInterface<IWorldMapModule>(this);
65
66 m_scene.AddCommand(
67 this, "export-map",
68 "export-map [<path>]",
69 "Save an image of the world map", HandleExportWorldMapConsoleCommand);
70 }
71 }
59 72
60 m_scene.AddCommand( 73 public override void RemoveRegion(Scene scene)
61 this, "export-map", 74 {
62 "export-map [<path>]", 75 if (!m_Enabled)
63 "Save an image of the world map", HandleExportWorldMapConsoleCommand); 76 return;
77
78 lock (m_scene)
79 {
80 m_Enabled = false;
81 m_scene.UnregisterModuleInterface<IWorldMapModule>(this);
82 // TODO: m_scene.RemoveCommand(this, "export-map");
83 m_scene = null;
84 }
64 } 85 }
65 86
66 public override string Name 87 public override string Name
@@ -158,5 +179,5 @@ namespace OpenSim.Region.CoreModules.Hypergrid
158 } 179 }
159 } 180 }
160 } 181 }
161 } 182 }
162} 183}