aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut
diff options
context:
space:
mode:
authorUbitUmarov2016-09-10 12:43:48 +0100
committerUbitUmarov2016-09-10 12:43:48 +0100
commitb9380c033db89a82efe846c06ef83e3b89e3b494 (patch)
treef1b69f3f324b5ecd94a970ee27c0ca6a088aaed2 /OpenSim/Region/CoreModules/ServiceConnectorsOut
parentmantis 8021: fix show regionsinview help text (diff)
downloadopensim-SC_OLD-b9380c033db89a82efe846c06ef83e3b89e3b494.zip
opensim-SC_OLD-b9380c033db89a82efe846c06ef83e3b89e3b494.tar.gz
opensim-SC_OLD-b9380c033db89a82efe846c06ef83e3b89e3b494.tar.bz2
opensim-SC_OLD-b9380c033db89a82efe846c06ef83e3b89e3b494.tar.xz
move region comands out of LocalGridServiceConnector where they do not belong
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs73
1 files changed, 0 insertions, 73 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index 563773a..70733fc 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -138,15 +138,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
138 138
139 public void PostInitialise() 139 public void PostInitialise()
140 { 140 {
141 // FIXME: We will still add this command even if we aren't enabled since RemoteGridServiceConnector
142 // will have instantiated us directly.
143 MainConsole.Instance.Commands.AddCommand("Regions", false, "show neighbours",
144 "show neighbours",
145 "Shows the local region neighbours", HandleShowNeighboursCommand);
146
147 MainConsole.Instance.Commands.AddCommand("Regions", false, "show regionsinview",
148 "show regionsinview",
149 "Shows regions that can be seen from a region", HandleShowRegionsInViewCommand);
150 } 141 }
151 142
152 public void Close() 143 public void Close()
@@ -304,69 +295,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
304 295
305 #endregion 296 #endregion
306 297
307 public void HandleShowNeighboursCommand(string module, string[] cmdparams)
308 {
309 if(!m_Enabled || m_scenes.Count == 0)
310 return;
311
312 System.Text.StringBuilder caps = new System.Text.StringBuilder();
313
314 List<Scene> scenes;
315 lock (m_scenes)
316 scenes = new List<Scene>(m_scenes);
317
318 foreach (Scene s in scenes)
319 {
320 RegionInfo sr = s.RegionInfo;
321 caps.AppendFormat("*** Neighbours of {0} ({1}) ***\n", sr.RegionName, sr.RegionID);
322 List<GridRegion> regions = GetNeighbours(sr.ScopeID, sr.RegionID);
323 foreach (GridRegion r in regions)
324 caps.AppendFormat(" {0} @ {1}-{2}\n", r.RegionName, Util.WorldToRegionLoc((uint)r.RegionLocX), Util.WorldToRegionLoc((uint)r.RegionLocY));
325 }
326
327 MainConsole.Instance.Output(caps.ToString());
328
329 }
330
331 public void HandleShowRegionsInViewCommand(string module, string[] cmdparams)
332 {
333 if(!m_Enabled || m_scenes.Count == 0)
334 return;
335
336 System.Text.StringBuilder caps = new System.Text.StringBuilder();
337
338 List<Scene> scenes;
339 lock (m_scenes)
340 scenes = new List<Scene>(m_scenes);
341
342 foreach (Scene s in scenes)
343 {
344 int maxview = (int)s.MaxRegionViewDistance;
345 RegionInfo sr = s.RegionInfo;
346 caps.AppendFormat("*** Regions that can be seen from {0} ({1}) (MaxRegionViewDistance {2}m) ***\n", sr.RegionName, sr.RegionID, maxview);
347 int startX = (int)sr.WorldLocX;
348 int endX = startX + (int)sr.RegionSizeX;
349 int startY = (int)sr.WorldLocY;
350 int endY = startY + (int)sr.RegionSizeY;
351 startX -= maxview;
352 if(startX < 0 )
353 startX = 0;
354 startY -= maxview;
355 if(startY < 0)
356 startY = 0;
357 endX += maxview;
358 endY += maxview;
359
360 List<GridRegion> regions = GetRegionRange(sr.ScopeID, startX, endX, startY, endY);
361 foreach (GridRegion r in regions)
362 {
363 if(r.RegionHandle == sr.RegionHandle)
364 continue;
365 caps.AppendFormat(" {0} @ {1}-{2}\n", r.RegionName, Util.WorldToRegionLoc((uint)r.RegionLocX), Util.WorldToRegionLoc((uint)r.RegionLocY));
366 }
367 }
368
369 MainConsole.Instance.Output(caps.ToString());
370 }
371 } 298 }
372} 299}