diff options
author | Diva Canto | 2010-01-24 14:30:48 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-24 14:30:48 -0800 |
commit | 48b03c2c61a422c3ac9843892a2ae93b29a9f7b8 (patch) | |
tree | ce3aae8c5bb0ee0c1748e4355cd616ea84b5b344 /OpenSim/Region/CoreModules/ServiceConnectorsOut | |
parent | Change a member of the friendslist module to better reflect the client side (diff) | |
download | opensim-SC-48b03c2c61a422c3ac9843892a2ae93b29a9f7b8.zip opensim-SC-48b03c2c61a422c3ac9843892a2ae93b29a9f7b8.tar.gz opensim-SC-48b03c2c61a422c3ac9843892a2ae93b29a9f7b8.tar.bz2 opensim-SC-48b03c2c61a422c3ac9843892a2ae93b29a9f7b8.tar.xz |
Integrated the hyperlinking with the GridService.
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | 74 |
1 files changed, 12 insertions, 62 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index 07f3cdc..67eae87 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | |||
@@ -48,7 +48,7 @@ using Nini.Config; | |||
48 | 48 | ||
49 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | 49 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid |
50 | { | 50 | { |
51 | public class HGGridConnector : ISharedRegionModule, IGridService, IHypergridService | 51 | public class HGGridConnector : ISharedRegionModule, IGridService |
52 | { | 52 | { |
53 | private static readonly ILog m_log = | 53 | private static readonly ILog m_log = |
54 | LogManager.GetLogger( | 54 | LogManager.GetLogger( |
@@ -61,8 +61,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
61 | private Dictionary<ulong, Scene> m_LocalScenes = new Dictionary<ulong, Scene>(); | 61 | private Dictionary<ulong, Scene> m_LocalScenes = new Dictionary<ulong, Scene>(); |
62 | 62 | ||
63 | private IGridService m_GridServiceConnector; | 63 | private IGridService m_GridServiceConnector; |
64 | private IHypergridService m_HypergridService; | ||
65 | |||
66 | 64 | ||
67 | #region ISharedRegionModule | 65 | #region ISharedRegionModule |
68 | 66 | ||
@@ -119,16 +117,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
119 | Object[] args = new Object[] { source }; | 117 | Object[] args = new Object[] { source }; |
120 | m_GridServiceConnector = ServerUtils.LoadPlugin<IGridService>(module, args); | 118 | m_GridServiceConnector = ServerUtils.LoadPlugin<IGridService>(module, args); |
121 | 119 | ||
122 | string hypergrid = gridConfig.GetString("HypergridService", string.Empty); | ||
123 | if (hypergrid == String.Empty) | ||
124 | { | ||
125 | m_log.Error("[HGGRID CONNECTOR]: No HypergridService named in section GridService"); | ||
126 | throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); | ||
127 | } | ||
128 | m_HypergridService = ServerUtils.LoadPlugin<IHypergridService>(hypergrid, args); | ||
129 | |||
130 | if (m_GridServiceConnector == null || m_HypergridService == null) | ||
131 | throw new Exception("Unable to proceed. HGGrid services could not be loaded."); | ||
132 | } | 120 | } |
133 | 121 | ||
134 | public void PostInitialise() | 122 | public void PostInitialise() |
@@ -148,7 +136,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
148 | 136 | ||
149 | m_LocalScenes[scene.RegionInfo.RegionHandle] = scene; | 137 | m_LocalScenes[scene.RegionInfo.RegionHandle] = scene; |
150 | scene.RegisterModuleInterface<IGridService>(this); | 138 | scene.RegisterModuleInterface<IGridService>(this); |
151 | scene.RegisterModuleInterface<IHypergridService>(this); | ||
152 | 139 | ||
153 | ((ISharedRegionModule)m_GridServiceConnector).AddRegion(scene); | 140 | ((ISharedRegionModule)m_GridServiceConnector).AddRegion(scene); |
154 | 141 | ||
@@ -160,7 +147,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
160 | { | 147 | { |
161 | m_LocalScenes.Remove(scene.RegionInfo.RegionHandle); | 148 | m_LocalScenes.Remove(scene.RegionInfo.RegionHandle); |
162 | scene.UnregisterModuleInterface<IGridService>(this); | 149 | scene.UnregisterModuleInterface<IGridService>(this); |
163 | scene.UnregisterModuleInterface<IHypergridService>(this); | ||
164 | ((ISharedRegionModule)m_GridServiceConnector).RemoveRegion(scene); | 150 | ((ISharedRegionModule)m_GridServiceConnector).RemoveRegion(scene); |
165 | } | 151 | } |
166 | } | 152 | } |
@@ -201,13 +187,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
201 | 187 | ||
202 | public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) | 188 | public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) |
203 | { | 189 | { |
204 | GridRegion region = m_GridServiceConnector.GetRegionByUUID(scopeID, regionID); | 190 | return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID); |
205 | if (region != null) | 191 | //if (region != null) |
206 | return region; | 192 | // return region; |
207 | 193 | ||
208 | region = m_HypergridService.GetRegionByUUID(regionID); | 194 | //region = m_HypergridService.GetRegionByUUID(regionID); |
209 | 195 | ||
210 | return region; | 196 | //return region; |
211 | } | 197 | } |
212 | 198 | ||
213 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) | 199 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
@@ -216,10 +202,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
216 | int snapY = (int) (y / Constants.RegionSize) * (int)Constants.RegionSize; | 202 | int snapY = (int) (y / Constants.RegionSize) * (int)Constants.RegionSize; |
217 | 203 | ||
218 | GridRegion region = m_GridServiceConnector.GetRegionByPosition(scopeID, x, y); | 204 | GridRegion region = m_GridServiceConnector.GetRegionByPosition(scopeID, x, y); |
219 | if (region != null) | 205 | //if (region != null) |
220 | return region; | 206 | // return region; |
221 | 207 | ||
222 | region = m_HypergridService.GetRegionByPosition(snapX, snapY); | 208 | //region = m_HypergridService.GetRegionByPosition(snapX, snapY); |
223 | 209 | ||
224 | return region; | 210 | return region; |
225 | } | 211 | } |
@@ -231,7 +217,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
231 | if (region != null) | 217 | if (region != null) |
232 | return region; | 218 | return region; |
233 | 219 | ||
234 | region = m_HypergridService.GetRegionByName(regionName); | 220 | //region = m_HypergridService.GetRegionByName(regionName); |
235 | 221 | ||
236 | return region; | 222 | return region; |
237 | } | 223 | } |
@@ -241,27 +227,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
241 | if (name == string.Empty) | 227 | if (name == string.Empty) |
242 | return new List<GridRegion>(); | 228 | return new List<GridRegion>(); |
243 | 229 | ||
244 | List<GridRegion> rinfos = m_GridServiceConnector.GetRegionsByName(scopeID, name, maxNumber); | 230 | return m_GridServiceConnector.GetRegionsByName(scopeID, name, maxNumber); |
245 | |||
246 | rinfos.AddRange(m_HypergridService.GetRegionsByName(name)); | ||
247 | if (rinfos.Count > maxNumber) | ||
248 | rinfos.RemoveRange(maxNumber - 1, rinfos.Count - maxNumber); | ||
249 | |||
250 | return rinfos; | ||
251 | } | 231 | } |
252 | 232 | ||
253 | public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) | 233 | public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) |
254 | { | 234 | { |
255 | int snapXmin = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize; | 235 | return m_GridServiceConnector.GetRegionRange(scopeID, xmin, xmax, ymin, ymax); |
256 | int snapXmax = (int)(xmax / Constants.RegionSize) * (int)Constants.RegionSize; | ||
257 | int snapYmin = (int)(ymin / Constants.RegionSize) * (int)Constants.RegionSize; | ||
258 | int snapYmax = (int)(ymax / Constants.RegionSize) * (int)Constants.RegionSize; | ||
259 | |||
260 | List<GridRegion> rinfos = m_GridServiceConnector.GetRegionRange(scopeID, xmin, xmax, ymin, ymax); | ||
261 | |||
262 | rinfos.AddRange(m_HypergridService.GetRegionRange(snapXmin, snapXmax, snapYmin, snapYmax)); | ||
263 | |||
264 | return rinfos; | ||
265 | } | 236 | } |
266 | 237 | ||
267 | public List<GridRegion> GetDefaultRegions(UUID scopeID) | 238 | public List<GridRegion> GetDefaultRegions(UUID scopeID) |
@@ -281,27 +252,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
281 | 252 | ||
282 | #endregion | 253 | #endregion |
283 | 254 | ||
284 | #region IHypergridService | ||
285 | |||
286 | public bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason) | ||
287 | { | ||
288 | return m_HypergridService.LinkRegion(regionDescriptor, out regionID, out regionHandle, out imageURL, out reason); | ||
289 | } | ||
290 | |||
291 | public GridRegion GetHyperlinkRegion(GridRegion gateway, UUID regionID) | ||
292 | { | ||
293 | if (m_LocalScenes.ContainsKey(gateway.RegionHandle)) | ||
294 | return gateway; | ||
295 | |||
296 | return m_HypergridService.GetHyperlinkRegion(gateway, regionID); | ||
297 | } | ||
298 | |||
299 | public GridRegion GetRegionByUUID(UUID regionID) { return null; } | ||
300 | public GridRegion GetRegionByPosition(int x, int y) { return null; } | ||
301 | public GridRegion GetRegionByName(string name) { return null; } | ||
302 | public List<GridRegion> GetRegionsByName(string name) { return null; } | ||
303 | public List<GridRegion> GetRegionRange(int xmin, int xmax, int ymin, int ymax) { return null; } | ||
304 | 255 | ||
305 | #endregion | ||
306 | } | 256 | } |
307 | } | 257 | } |