diff options
author | Melanie | 2013-08-01 01:23:24 +0100 |
---|---|---|
committer | Melanie | 2013-08-01 01:23:24 +0100 |
commit | 21f5e670303ee978c747567e674e5ebe256ad2c7 (patch) | |
tree | 19c3740cbb8bf78d038e64b2fb66ea837cc8f724 /OpenSim/Region/CoreModules/Hypergrid | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Include missing reference that probably stops windows build from commit 12995... (diff) | |
download | opensim-SC_OLD-21f5e670303ee978c747567e674e5ebe256ad2c7.zip opensim-SC_OLD-21f5e670303ee978c747567e674e5ebe256ad2c7.tar.gz opensim-SC_OLD-21f5e670303ee978c747567e674e5ebe256ad2c7.tar.bz2 opensim-SC_OLD-21f5e670303ee978c747567e674e5ebe256ad2c7.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Hypergrid')
-rw-r--r-- | OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs | 64 |
1 files changed, 61 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs index 7b11658..f196973 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs | |||
@@ -31,6 +31,7 @@ using System.Reflection; | |||
31 | using log4net; | 31 | using log4net; |
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenMetaverse.StructuredData; | ||
34 | using Mono.Addins; | 35 | using Mono.Addins; |
35 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
36 | using OpenSim.Region.CoreModules.World.WorldMap; | 37 | using OpenSim.Region.CoreModules.World.WorldMap; |
@@ -48,20 +49,63 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
48 | // Remember the map area that each client has been exposed to in this region | 49 | // Remember the map area that each client has been exposed to in this region |
49 | private Dictionary<UUID, List<MapBlockData>> m_SeenMapBlocks = new Dictionary<UUID, List<MapBlockData>>(); | 50 | private Dictionary<UUID, List<MapBlockData>> m_SeenMapBlocks = new Dictionary<UUID, List<MapBlockData>>(); |
50 | 51 | ||
52 | private string m_MapImageServerURL = string.Empty; | ||
53 | |||
54 | private IUserManagement m_UserManagement; | ||
55 | |||
51 | #region INonSharedRegionModule Members | 56 | #region INonSharedRegionModule Members |
52 | 57 | ||
53 | public override void Initialise(IConfigSource config) | 58 | public override void Initialise(IConfigSource source) |
54 | { | 59 | { |
55 | if (Util.GetConfigVarFromSections<string>( | 60 | if (Util.GetConfigVarFromSections<string>( |
56 | config, "WorldMapModule", new string[] { "Map", "Startup" }, "WorldMap") == "HGWorldMap") | 61 | source, "WorldMapModule", new string[] { "Map", "Startup" }, "WorldMap") == "HGWorldMap") |
62 | { | ||
57 | m_Enabled = true; | 63 | m_Enabled = true; |
64 | |||
65 | m_MapImageServerURL = Util.GetConfigVarFromSections<string>(source, "MapTileURL", new string[] {"LoginService", "HGWorldMap", "SimulatorFeatures"}); | ||
66 | |||
67 | if (!string.IsNullOrEmpty(m_MapImageServerURL)) | ||
68 | { | ||
69 | m_MapImageServerURL = m_MapImageServerURL.Trim(); | ||
70 | if (!m_MapImageServerURL.EndsWith("/")) | ||
71 | m_MapImageServerURL = m_MapImageServerURL + "/"; | ||
72 | } | ||
73 | |||
74 | |||
75 | } | ||
58 | } | 76 | } |
59 | 77 | ||
60 | public override void AddRegion(Scene scene) | 78 | public override void AddRegion(Scene scene) |
61 | { | 79 | { |
80 | if (!m_Enabled) | ||
81 | return; | ||
82 | |||
62 | base.AddRegion(scene); | 83 | base.AddRegion(scene); |
63 | 84 | ||
64 | scene.EventManager.OnClientClosed += new EventManager.ClientClosed(EventManager_OnClientClosed); | 85 | scene.EventManager.OnClientClosed += EventManager_OnClientClosed; |
86 | } | ||
87 | |||
88 | public override void RegionLoaded(Scene scene) | ||
89 | { | ||
90 | if (!m_Enabled) | ||
91 | return; | ||
92 | |||
93 | base.RegionLoaded(scene); | ||
94 | ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface<ISimulatorFeaturesModule>(); | ||
95 | |||
96 | if (featuresModule != null) | ||
97 | featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest; | ||
98 | |||
99 | m_UserManagement = m_scene.RequestModuleInterface<IUserManagement>(); | ||
100 | |||
101 | } | ||
102 | |||
103 | public override void RemoveRegion(Scene scene) | ||
104 | { | ||
105 | if (!m_Enabled) | ||
106 | return; | ||
107 | |||
108 | scene.EventManager.OnClientClosed -= EventManager_OnClientClosed; | ||
65 | } | 109 | } |
66 | 110 | ||
67 | public override string Name | 111 | public override string Name |
@@ -115,6 +159,20 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
115 | return mapBlocks; | 159 | return mapBlocks; |
116 | } | 160 | } |
117 | 161 | ||
162 | private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features) | ||
163 | { | ||
164 | if (m_UserManagement != null && !string.IsNullOrEmpty(m_MapImageServerURL) && !m_UserManagement.IsLocalGridUser(agentID)) | ||
165 | { | ||
166 | OSD extras = new OSDMap(); | ||
167 | if (features.ContainsKey("OpenSimExtras")) | ||
168 | extras = features["OpenSimExtras"]; | ||
169 | else | ||
170 | features["OpenSimExtras"] = extras; | ||
171 | |||
172 | ((OSDMap)extras)["map-server-url"] = m_MapImageServerURL; | ||
173 | |||
174 | } | ||
175 | } | ||
118 | } | 176 | } |
119 | 177 | ||
120 | class MapArea | 178 | class MapArea |