diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
3 files changed, 8 insertions, 110 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index d786c80..db3f900 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -53,11 +53,8 @@ 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 | <<<<<<< HEAD | 56 | |
57 | public class MapImageServiceModule : IMapImageUploadModule, ISharedRegionModule | 57 | public class MapImageServiceModule : IMapImageUploadModule, ISharedRegionModule |
58 | ======= | ||
59 | public class MapImageServiceModule : ISharedRegionModule, IMapImageUploadModule | ||
60 | >>>>>>> avn/ubitvar | ||
61 | { | 58 | { |
62 | private static readonly ILog m_log = | 59 | private static readonly ILog m_log = |
63 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 60 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -97,13 +94,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
97 | if (config == null) | 94 | if (config == null) |
98 | return; | 95 | return; |
99 | 96 | ||
100 | <<<<<<< HEAD | ||
101 | int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime")); | ||
102 | |||
103 | // if refresh is less than zero, disable the module | ||
104 | ======= | ||
105 | int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime", "-1")); | 97 | int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime", "-1")); |
106 | >>>>>>> avn/ubitvar | ||
107 | if (refreshminutes < 0) | 98 | if (refreshminutes < 0) |
108 | { | 99 | { |
109 | m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Negative refresh time given in config. Module disabled."); | 100 | m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Negative refresh time given in config. Module disabled."); |
@@ -136,19 +127,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
136 | m_refreshTimer.Interval = m_refreshtime; | 127 | m_refreshTimer.Interval = m_refreshtime; |
137 | m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); | 128 | m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); |
138 | 129 | ||
139 | <<<<<<< HEAD | ||
140 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", | ||
141 | ======= | ||
142 | if (m_refreshtime > 0) | ||
143 | { | ||
144 | m_refreshTimer.Enabled = true; | ||
145 | m_refreshTimer.AutoReset = true; | ||
146 | m_refreshTimer.Interval = m_refreshtime; | ||
147 | m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); | ||
148 | } | ||
149 | 130 | ||
150 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", | 131 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", |
151 | >>>>>>> avn/ubitvar | ||
152 | refreshminutes, service); | 132 | refreshminutes, service); |
153 | } | 133 | } |
154 | else | 134 | else |
@@ -174,10 +154,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
174 | // v2 Map generation on startup is now handled by scene to allow bmp to be shared with | 154 | // v2 Map generation on startup is now handled by scene to allow bmp to be shared with |
175 | // v1 service and not generate map tiles twice as was previous behavior | 155 | // v1 service and not generate map tiles twice as was previous behavior |
176 | //scene.EventManager.OnRegionReadyStatusChange += s => { if (s.Ready) UploadMapTile(s); }; | 156 | //scene.EventManager.OnRegionReadyStatusChange += s => { if (s.Ready) UploadMapTile(s); }; |
177 | <<<<<<< HEAD | ||
178 | 157 | ||
179 | ======= | ||
180 | >>>>>>> avn/ubitvar | ||
181 | scene.RegisterModuleInterface<IMapImageUploadModule>(this); | 158 | scene.RegisterModuleInterface<IMapImageUploadModule>(this); |
182 | } | 159 | } |
183 | 160 | ||
@@ -235,15 +212,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
235 | // If the region/maptile is legacy sized, just upload the one tile like it has always been done | 212 | // If the region/maptile is legacy sized, just upload the one tile like it has always been done |
236 | if (mapTile.Width == Constants.RegionSize && mapTile.Height == Constants.RegionSize) | 213 | if (mapTile.Width == Constants.RegionSize && mapTile.Height == Constants.RegionSize) |
237 | { | 214 | { |
238 | <<<<<<< HEAD | 215 | ConvertAndUploadMaptile(scene, mapTile, |
239 | ConvertAndUploadMaptile(mapTile, | ||
240 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, | 216 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, |
241 | scene.RegionInfo.RegionName); | 217 | scene.RegionInfo.RegionName); |
242 | ======= | ||
243 | ConvertAndUploadMaptile(mapTile, scene, | ||
244 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, | ||
245 | scene.RegionInfo.RegionName); | ||
246 | >>>>>>> avn/ubitvar | ||
247 | } | 218 | } |
248 | else | 219 | else |
249 | { | 220 | { |
@@ -263,17 +234,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
263 | (int)Constants.RegionSize, (int)Constants.RegionSize); | 234 | (int)Constants.RegionSize, (int)Constants.RegionSize); |
264 | using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) | 235 | using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) |
265 | { | 236 | { |
266 | <<<<<<< HEAD | 237 | ConvertAndUploadMaptile(scene, subMapTile, |
267 | ConvertAndUploadMaptile(subMapTile, | ||
268 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), | 238 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), |
269 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), | 239 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), |
270 | scene.Name); | 240 | scene.Name); |
271 | ======= | ||
272 | ConvertAndUploadMaptile(subMapTile, scene, | ||
273 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), | ||
274 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), | ||
275 | scene.Name); | ||
276 | >>>>>>> avn/ubitvar | ||
277 | } | 241 | } |
278 | } | 242 | } |
279 | } | 243 | } |
@@ -285,11 +249,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
285 | ///</summary> | 249 | ///</summary> |
286 | public void UploadMapTile(IScene scene) | 250 | public void UploadMapTile(IScene scene) |
287 | { | 251 | { |
288 | <<<<<<< HEAD | ||
289 | ======= | ||
290 | m_log.DebugFormat("{0}: upload maptile for {1}", LogHeader, scene.RegionInfo.RegionName); | 252 | m_log.DebugFormat("{0}: upload maptile for {1}", LogHeader, scene.RegionInfo.RegionName); |
291 | 253 | ||
292 | >>>>>>> avn/ubitvar | ||
293 | // Create a JPG map tile and upload it to the AddMapTile API | 254 | // Create a JPG map tile and upload it to the AddMapTile API |
294 | IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>(); | 255 | IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>(); |
295 | if (tileGenerator == null) | 256 | if (tileGenerator == null) |
@@ -300,23 +261,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
300 | 261 | ||
301 | using (Bitmap mapTile = tileGenerator.CreateMapTile()) | 262 | using (Bitmap mapTile = tileGenerator.CreateMapTile()) |
302 | { | 263 | { |
303 | <<<<<<< HEAD | ||
304 | if (mapTile != null) | ||
305 | { | ||
306 | UploadMapTile(scene, mapTile); | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | m_log.WarnFormat("{0} Tile image generation failed", LogHeader); | ||
311 | } | ||
312 | } | ||
313 | } | ||
314 | |||
315 | private void ConvertAndUploadMaptile(Image tileImage, uint locX, uint locY, string regionName) | ||
316 | { | ||
317 | byte[] jpgData = Utils.EmptyBytes; | ||
318 | |||
319 | ======= | ||
320 | // XXX: The MapImageModule will return a null if the user has chosen not to create map tiles and there | 264 | // XXX: The MapImageModule will return a null if the user has chosen not to create map tiles and there |
321 | // is no static map tile. | 265 | // is no static map tile. |
322 | if (mapTile == null) | 266 | if (mapTile == null) |
@@ -326,11 +270,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
326 | } | 270 | } |
327 | } | 271 | } |
328 | 272 | ||
329 | private void ConvertAndUploadMaptile(Image tileImage, IScene scene, uint locX, uint locY, string regionName) | 273 | private void ConvertAndUploadMaptile(IScene scene, Image tileImage, uint locX, uint locY, string regionName) |
330 | { | 274 | { |
331 | byte[] jpgData = Utils.EmptyBytes; | 275 | byte[] jpgData = Utils.EmptyBytes; |
332 | 276 | ||
333 | >>>>>>> avn/ubitvar | ||
334 | using (MemoryStream stream = new MemoryStream()) | 277 | using (MemoryStream stream = new MemoryStream()) |
335 | { | 278 | { |
336 | tileImage.Save(stream, ImageFormat.Jpeg); | 279 | tileImage.Save(stream, ImageFormat.Jpeg); |
@@ -339,11 +282,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
339 | if (jpgData != Utils.EmptyBytes) | 282 | if (jpgData != Utils.EmptyBytes) |
340 | { | 283 | { |
341 | string reason = string.Empty; | 284 | string reason = string.Empty; |
342 | <<<<<<< HEAD | ||
343 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, out reason)) | ||
344 | ======= | ||
345 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, scene.RegionInfo.ScopeID, out reason)) | 285 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, scene.RegionInfo.ScopeID, out reason)) |
346 | >>>>>>> avn/ubitvar | ||
347 | { | 286 | { |
348 | m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, | 287 | m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, |
349 | regionName, locX, locY, reason); | 288 | regionName, locX, locY, reason); |
@@ -351,11 +290,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
351 | } | 290 | } |
352 | else | 291 | else |
353 | { | 292 | { |
354 | <<<<<<< HEAD | ||
355 | m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, regionName); | 293 | m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, regionName); |
356 | ======= | ||
357 | m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, scene.RegionInfo.RegionName); | ||
358 | >>>>>>> avn/ubitvar | ||
359 | } | 294 | } |
360 | } | 295 | } |
361 | } | 296 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 50238a5..9d4c282 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -269,11 +269,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
269 | return true; | 269 | return true; |
270 | } | 270 | } |
271 | 271 | ||
272 | <<<<<<< HEAD | 272 | |
273 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason) | 273 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason) |
274 | ======= | ||
275 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, out string version, out string reason) | ||
276 | >>>>>>> avn/ubitvar | ||
277 | { | 274 | { |
278 | reason = "Communications failure"; | 275 | reason = "Communications failure"; |
279 | version = ServiceVersion; | 276 | version = ServiceVersion; |
@@ -302,29 +299,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
302 | 299 | ||
303 | } | 300 | } |
304 | 301 | ||
305 | <<<<<<< HEAD | ||
306 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, features, out reason); | ||
307 | ======= | ||
308 | |||
309 | // not really need on a grid running var regions sims | ||
310 | |||
311 | uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; | ||
312 | |||
313 | float theirVersionNumber = 0f; | ||
314 | string[] versionComponents = theirversion.Split(new char[] { '/' }); | ||
315 | if (versionComponents.Length >= 2) | ||
316 | float.TryParse(versionComponents[1], out theirVersionNumber); | ||
317 | 302 | ||
318 | // Var regions here, and the requesting simulator is in an older version. | 303 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, features, out reason); |
319 | // We will forbide this, because it crashes the viewers | ||
320 | if (theirVersionNumber < 0.3f && size > 256) | ||
321 | { | ||
322 | reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; | ||
323 | m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); | ||
324 | return false; | ||
325 | } | ||
326 | return m_scenes[destination.RegionID].QueryAccess(agentID, position, out reason); | ||
327 | >>>>>>> avn/ubitvar | ||
328 | } | 304 | } |
329 | 305 | ||
330 | //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); | 306 | //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 7044d92..12ffc01 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -206,11 +206,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
206 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 206 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
207 | } | 207 | } |
208 | 208 | ||
209 | <<<<<<< HEAD | 209 | |
210 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason) | 210 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason) |
211 | ======= | ||
212 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason) | ||
213 | >>>>>>> avn/ubitvar | ||
214 | { | 211 | { |
215 | reason = "Communications failure"; | 212 | reason = "Communications failure"; |
216 | version = "Unknown"; | 213 | version = "Unknown"; |
@@ -219,22 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
219 | return false; | 216 | return false; |
220 | 217 | ||
221 | // Try local first | 218 | // Try local first |
222 | <<<<<<< HEAD | ||
223 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason)) | 219 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason)) |
224 | ======= | ||
225 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason)) | ||
226 | return true; | ||
227 | >>>>>>> avn/ubitvar | ||
228 | return true; | 220 | return true; |
229 | 221 | ||
230 | // else do the remote thing | 222 | // else do the remote thing |
231 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) | 223 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
232 | <<<<<<< HEAD | ||
233 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason); | 224 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason); |
234 | ======= | ||
235 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason); | ||
236 | |||
237 | >>>>>>> avn/ubitvar | ||
238 | 225 | ||
239 | return false; | 226 | return false; |
240 | } | 227 | } |