aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs197
1 files changed, 133 insertions, 64 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 5af8194..fcc8717 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -26,12 +26,14 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Threading;
29using System.Collections; 30using System.Collections;
30using System.Collections.Generic; 31using System.Collections.Generic;
31using System.Diagnostics; 32using System.Diagnostics;
32using System.IO; 33using System.IO;
33using System.Linq; 34using System.Linq;
34using System.Reflection; 35using System.Reflection;
36using System.Runtime;
35using System.Text; 37using System.Text;
36using System.Text.RegularExpressions; 38using System.Text.RegularExpressions;
37using System.Timers; 39using System.Timers;
@@ -74,7 +76,7 @@ namespace OpenSim
74 76
75 private string m_timedScript = "disabled"; 77 private string m_timedScript = "disabled";
76 private int m_timeInterval = 1200; 78 private int m_timeInterval = 1200;
77 private Timer m_scriptTimer; 79 private System.Timers.Timer m_scriptTimer;
78 80
79 public OpenSim(IConfigSource configSource) : base(configSource) 81 public OpenSim(IConfigSource configSource) : base(configSource)
80 { 82 {
@@ -114,8 +116,8 @@ namespace OpenSim
114 if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod)) 116 if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod))
115 Util.FireAndForgetMethod = asyncCallMethod; 117 Util.FireAndForgetMethod = asyncCallMethod;
116 118
117 stpMinThreads = startupConfig.GetInt("MinPoolThreads", 15); 119 stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 );
118 stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 300); 120 stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 25);
119 m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) "); 121 m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) ");
120 } 122 }
121 123
@@ -123,8 +125,27 @@ namespace OpenSim
123 Util.InitThreadPool(stpMinThreads, stpMaxThreads); 125 Util.InitThreadPool(stpMinThreads, stpMaxThreads);
124 126
125 m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod); 127 m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod);
128
129 m_log.InfoFormat("[OPENSIM MAIN] Running GC in {0} mode", GCSettings.IsServerGC ? "server":"workstation");
126 } 130 }
127 131
132#if (_MONO)
133 private static Mono.Unix.UnixSignal[] signals;
134
135
136 private Thread signal_thread = new Thread (delegate ()
137 {
138 while (true)
139 {
140 // Wait for a signal to be delivered
141 int index = Mono.Unix.UnixSignal.WaitAny (signals, -1);
142
143 //Mono.Unix.Native.Signum signal = signals [index].Signum;
144 MainConsole.Instance.RunCommand("shutdown");
145 }
146 });
147#endif
148
128 /// <summary> 149 /// <summary>
129 /// Performs initialisation of the scene, such as loading configuration from disk. 150 /// Performs initialisation of the scene, such as loading configuration from disk.
130 /// </summary> 151 /// </summary>
@@ -134,6 +155,27 @@ namespace OpenSim
134 m_log.Info("========================= STARTING OPENSIM ========================="); 155 m_log.Info("========================= STARTING OPENSIM =========================");
135 m_log.Info("===================================================================="); 156 m_log.Info("====================================================================");
136 157
158#if (_MONO)
159 if(!Util.IsWindows())
160 {
161 try
162 {
163 // linux mac os specifics
164 signals = new Mono.Unix.UnixSignal[]
165 {
166 new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM)
167 };
168 signal_thread.IsBackground = true;
169 signal_thread.Start();
170 }
171 catch (Exception e)
172 {
173 m_log.Info("Could not set up UNIX signal handlers. SIGTERM will not");
174 m_log.InfoFormat("shut down gracefully: {0}", e.Message);
175 m_log.Debug("Exception was: ", e);
176 }
177 }
178#endif
137 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); 179 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
138 // http://msdn.microsoft.com/en-us/library/bb384202.aspx 180 // http://msdn.microsoft.com/en-us/library/bb384202.aspx
139 //GCSettings.LatencyMode = GCLatencyMode.Batch; 181 //GCSettings.LatencyMode = GCLatencyMode.Batch;
@@ -172,10 +214,12 @@ namespace OpenSim
172 MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this)); 214 MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this));
173 if (userStatsURI != String.Empty) 215 if (userStatsURI != String.Empty)
174 MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this)); 216 MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this));
217 MainServer.Instance.AddStreamHandler(new OpenSim.SimRobotsHandler());
175 218
176 if (managedStatsURI != String.Empty) 219 if (managedStatsURI != String.Empty)
177 { 220 {
178 string urlBase = String.Format("/{0}/", managedStatsURI); 221 string urlBase = String.Format("/{0}/", managedStatsURI);
222 StatsManager.StatsPassword = managedStatsPassword;
179 MainServer.Instance.AddHTTPHandler(urlBase, StatsManager.HandleStatsRequest); 223 MainServer.Instance.AddHTTPHandler(urlBase, StatsManager.HandleStatsRequest);
180 m_log.InfoFormat("[OPENSIM] Enabling remote managed stats fetch. URL = {0}", urlBase); 224 m_log.InfoFormat("[OPENSIM] Enabling remote managed stats fetch. URL = {0}", urlBase);
181 } 225 }
@@ -217,7 +261,7 @@ namespace OpenSim
217 // Start timer script (run a script every xx seconds) 261 // Start timer script (run a script every xx seconds)
218 if (m_timedScript != "disabled") 262 if (m_timedScript != "disabled")
219 { 263 {
220 m_scriptTimer = new Timer(); 264 m_scriptTimer = new System.Timers.Timer();
221 m_scriptTimer.Enabled = true; 265 m_scriptTimer.Enabled = true;
222 m_scriptTimer.Interval = m_timeInterval*1000; 266 m_scriptTimer.Interval = m_timeInterval*1000;
223 m_scriptTimer.Elapsed += RunAutoTimerScript; 267 m_scriptTimer.Elapsed += RunAutoTimerScript;
@@ -238,55 +282,65 @@ namespace OpenSim
238 282
239 m_console.Commands.AddCommand("General", false, "change region", 283 m_console.Commands.AddCommand("General", false, "change region",
240 "change region <region name>", 284 "change region <region name>",
241 "Change current console region", 285 "Change current console region",
242 ChangeSelectedRegion); 286 ChangeSelectedRegion);
243 287
244 m_console.Commands.AddCommand("Archiving", false, "save xml", 288 m_console.Commands.AddCommand("Archiving", false, "save xml",
245 "save xml", 289 "save xml [<file name>]",
246 "Save a region's data in XML format", 290 "Save a region's data in XML format",
247 SaveXml); 291 SaveXml);
248 292
249 m_console.Commands.AddCommand("Archiving", false, "save xml2", 293 m_console.Commands.AddCommand("Archiving", false, "save xml2",
250 "save xml2", 294 "save xml2 [<file name>]",
251 "Save a region's data in XML2 format", 295 "Save a region's data in XML2 format",
252 SaveXml2); 296 SaveXml2);
253 297
254 m_console.Commands.AddCommand("Archiving", false, "load xml", 298 m_console.Commands.AddCommand("Archiving", false, "load xml",
255 "load xml [-newIDs [<x> <y> <z>]]", 299 "load xml [<file name> [-newUID [<x> <y> <z>]]]",
256 "Load a region's data from XML format", 300 "Load a region's data from XML format",
257 LoadXml); 301 LoadXml);
258 302
259 m_console.Commands.AddCommand("Archiving", false, "load xml2", 303 m_console.Commands.AddCommand("Archiving", false, "load xml2",
260 "load xml2", 304 "load xml2 [<file name>]",
261 "Load a region's data from XML2 format", 305 "Load a region's data from XML2 format",
262 LoadXml2); 306 LoadXml2);
263 307
264 m_console.Commands.AddCommand("Archiving", false, "save prims xml2", 308 m_console.Commands.AddCommand("Archiving", false, "save prims xml2",
265 "save prims xml2 [<prim name> <file name>]", 309 "save prims xml2 [<prim name> <file name>]",
266 "Save named prim to XML2", 310 "Save named prim to XML2",
267 SavePrimsXml2); 311 SavePrimsXml2);
268 312
269 m_console.Commands.AddCommand("Archiving", false, "load oar", 313 m_console.Commands.AddCommand("Archiving", false, "load oar",
270 "load oar [--merge] [--skip-assets]" 314 "load oar [-m|--merge] [-s|--skip-assets]"
271 + " [--default-user \"User Name\"]" 315 + " [--default-user \"User Name\"]"
272 + " [--force-terrain] [--force-parcels]" 316 + " [--force-terrain] [--force-parcels]"
273 + " [--no-objects]" 317 + " [--no-objects]"
274 + " [--rotation degrees] [--rotation-center \"<x,y,z>\"]" 318 + " [--rotation degrees]"
275 + " [--displacement \"<x,y,z>\"]" 319 + " [--bounding-origin \"<x,y,z>\"]"
320 + " [--bounding-size \"<x,y,z>\"]"
321 + " [--displacement \"<x,y,z>\"]"
322 + " [-d|--debug]"
276 + " [<OAR path>]", 323 + " [<OAR path>]",
277 "Load a region's data from an OAR archive.", 324 "Load a region's data from an OAR archive.",
278 "--merge will merge the OAR with the existing scene (suppresses terrain and parcel info loading).\n" 325 "--merge will merge the OAR with the existing scene (suppresses terrain and parcel info loading).\n"
326 + "--skip-assets will load the OAR but ignore the assets it contains.\n"
279 + "--default-user will use this user for any objects with an owner whose UUID is not found in the grid.\n" 327 + "--default-user will use this user for any objects with an owner whose UUID is not found in the grid.\n"
280 + "--displacement will add this value to the position of every object loaded.\n"
281 + "--force-terrain forces the loading of terrain from the oar (undoes suppression done by --merge).\n" 328 + "--force-terrain forces the loading of terrain from the oar (undoes suppression done by --merge).\n"
282 + "--force-parcels forces the loading of parcels from the oar (undoes suppression done by --merge).\n" 329 + "--force-parcels forces the loading of parcels from the oar (undoes suppression done by --merge).\n"
283 + "--no-objects suppresses the addition of any objects (good for loading only the terrain).\n" 330 + "--no-objects suppresses the addition of any objects (good for loading only the terrain).\n"
284 + "--rotation specified rotation to be applied to the oar. Specified in degrees.\n" 331 + "--rotation specified rotation to be applied to the oar. Specified in degrees.\n"
285 + "--rotation-center Location (relative to original OAR) to apply rotation. Default is <128,128,0>.\n" 332 + "--bounding-origin will only place objects that after displacement and rotation fall within the bounding cube who's position starts at <x,y,z>. Defaults to <0,0,0>.\n"
286 + "--skip-assets will load the OAR but ignore the assets it contains.\n\n" 333 + "--bounding-size specifies the size of the bounding cube. The default is the size of the destination region and cannot be larger than this.\n"
334 + "--displacement will add this value to the position of every object loaded.\n"
335 + "--debug forces the archiver to display messages about where each object is being placed.\n\n"
287 + "The path can be either a filesystem location or a URI.\n" 336 + "The path can be either a filesystem location or a URI.\n"
288 + " If this is not given then the command looks for an OAR named region.oar in the current directory.", 337 + " If this is not given then the command looks for an OAR named region.oar in the current directory."
289 LoadOar); 338 + " [--rotation-center \"<x,y,z>\"] used to be an option, now it does nothing and will be removed soon."
339 + "When an OAR is being loaded, operations are applied in this order:\n"
340 + "1: Rotation (around the incoming OARs region center)\n"
341 + "2: Cropping (a bounding cube with origin and size)\n"
342 + "3: Displacement (setting offset coordinates within the destination region)",
343 LoadOar); ;
290 344
291 m_console.Commands.AddCommand("Archiving", false, "save oar", 345 m_console.Commands.AddCommand("Archiving", false, "save oar",
292 //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", 346 //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
@@ -307,12 +361,12 @@ namespace OpenSim
307 361
308 m_console.Commands.AddCommand("Objects", false, "edit scale", 362 m_console.Commands.AddCommand("Objects", false, "edit scale",
309 "edit scale <name> <x> <y> <z>", 363 "edit scale <name> <x> <y> <z>",
310 "Change the scale of a named prim", 364 "Change the scale of a named prim",
311 HandleEditScale); 365 HandleEditScale);
312 366
313 m_console.Commands.AddCommand("Objects", false, "rotate scene", 367 m_console.Commands.AddCommand("Objects", false, "rotate scene",
314 "rotate scene <degrees> [centerX, centerY]", 368 "rotate scene <degrees> [centerX, centerY]",
315 "Rotates all scene objects around centerX, centerY (defailt 128, 128) (please back up your region before using)", 369 "Rotates all scene objects around centerX, centerY (default 128, 128) (please back up your region before using)",
316 HandleRotateScene); 370 HandleRotateScene);
317 371
318 m_console.Commands.AddCommand("Objects", false, "scale scene", 372 m_console.Commands.AddCommand("Objects", false, "scale scene",
@@ -334,44 +388,44 @@ namespace OpenSim
334 388
335 m_console.Commands.AddCommand("Users", false, "show users", 389 m_console.Commands.AddCommand("Users", false, "show users",
336 "show users [full]", 390 "show users [full]",
337 "Show user data for users currently on the region", 391 "Show user data for users currently on the region",
338 "Without the 'full' option, only users actually on the region are shown." 392 "Without the 'full' option, only users actually on the region are shown."
339 + " With the 'full' option child agents of users in neighbouring regions are also shown.", 393 + " With the 'full' option child agents of users in neighbouring regions are also shown.",
340 HandleShow); 394 HandleShow);
341 395
342 m_console.Commands.AddCommand("Comms", false, "show connections", 396 m_console.Commands.AddCommand("Comms", false, "show connections",
343 "show connections", 397 "show connections",
344 "Show connection data", 398 "Show connection data",
345 HandleShow); 399 HandleShow);
346 400
347 m_console.Commands.AddCommand("Comms", false, "show circuits", 401 m_console.Commands.AddCommand("Comms", false, "show circuits",
348 "show circuits", 402 "show circuits",
349 "Show agent circuit data", 403 "Show agent circuit data",
350 HandleShow); 404 HandleShow);
351 405
352 m_console.Commands.AddCommand("Comms", false, "show pending-objects", 406 m_console.Commands.AddCommand("Comms", false, "show pending-objects",
353 "show pending-objects", 407 "show pending-objects",
354 "Show # of objects on the pending queues of all scene viewers", 408 "Show # of objects on the pending queues of all scene viewers",
355 HandleShow); 409 HandleShow);
356 410
357 m_console.Commands.AddCommand("General", false, "show modules", 411 m_console.Commands.AddCommand("General", false, "show modules",
358 "show modules", 412 "show modules",
359 "Show module data", 413 "Show module data",
360 HandleShow); 414 HandleShow);
361 415
362 m_console.Commands.AddCommand("Regions", false, "show regions", 416 m_console.Commands.AddCommand("Regions", false, "show regions",
363 "show regions", 417 "show regions",
364 "Show region data", 418 "Show region data",
365 HandleShow); 419 HandleShow);
366 420
367 m_console.Commands.AddCommand("Regions", false, "show ratings", 421 m_console.Commands.AddCommand("Regions", false, "show ratings",
368 "show ratings", 422 "show ratings",
369 "Show rating data", 423 "Show rating data",
370 HandleShow); 424 HandleShow);
371 425
372 m_console.Commands.AddCommand("Objects", false, "backup", 426 m_console.Commands.AddCommand("Objects", false, "backup",
373 "backup", 427 "backup",
374 "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", 428 "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.",
375 RunCommand); 429 RunCommand);
376 430
377 m_console.Commands.AddCommand("Regions", false, "create region", 431 m_console.Commands.AddCommand("Regions", false, "create region",
@@ -385,22 +439,22 @@ namespace OpenSim
385 439
386 m_console.Commands.AddCommand("Regions", false, "restart", 440 m_console.Commands.AddCommand("Regions", false, "restart",
387 "restart", 441 "restart",
388 "Restart the currently selected region(s) in this instance", 442 "Restart the currently selected region(s) in this instance",
389 RunCommand); 443 RunCommand);
390 444
391 m_console.Commands.AddCommand("General", false, "command-script", 445 m_console.Commands.AddCommand("General", false, "command-script",
392 "command-script <script>", 446 "command-script <script>",
393 "Run a command script from file", 447 "Run a command script from file",
394 RunCommand); 448 RunCommand);
395 449
396 m_console.Commands.AddCommand("Regions", false, "remove-region", 450 m_console.Commands.AddCommand("Regions", false, "remove-region",
397 "remove-region <name>", 451 "remove-region <name>",
398 "Remove a region from this simulator", 452 "Remove a region from this simulator",
399 RunCommand); 453 RunCommand);
400 454
401 m_console.Commands.AddCommand("Regions", false, "delete-region", 455 m_console.Commands.AddCommand("Regions", false, "delete-region",
402 "delete-region <name>", 456 "delete-region <name>",
403 "Delete a region from disk", 457 "Delete a region from disk",
404 RunCommand); 458 RunCommand);
405 459
406 m_console.Commands.AddCommand("Estates", false, "estate create", 460 m_console.Commands.AddCommand("Estates", false, "estate create",
@@ -431,7 +485,13 @@ namespace OpenSim
431 { 485 {
432 RunCommandScript(m_shutdownCommandsFile); 486 RunCommandScript(m_shutdownCommandsFile);
433 } 487 }
434 488
489 if (m_timedScript != "disabled")
490 {
491 m_scriptTimer.Dispose();
492 m_timedScript = "disabled";
493 }
494
435 base.ShutdownSpecific(); 495 base.ShutdownSpecific();
436 } 496 }
437 497
@@ -451,7 +511,6 @@ namespace OpenSim
451 private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi) 511 private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi)
452 { 512 {
453 int now = Environment.TickCount & Int32.MaxValue; 513 int now = Environment.TickCount & Int32.MaxValue;
454
455 m_log.ErrorFormat( 514 m_log.ErrorFormat(
456 "[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}", 515 "[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}",
457 twi.Thread.Name, 516 twi.Thread.Name,
@@ -470,7 +529,7 @@ namespace OpenSim
470 private void KickUserCommand(string module, string[] cmdparams) 529 private void KickUserCommand(string module, string[] cmdparams)
471 { 530 {
472 bool force = false; 531 bool force = false;
473 532
474 OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; }); 533 OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; });
475 534
476 List<string> mainParams = options.Parse(cmdparams); 535 List<string> mainParams = options.Parse(cmdparams);
@@ -500,7 +559,7 @@ namespace OpenSim
500 if (alert != null) 559 if (alert != null)
501 presence.ControllingClient.Kick(alert); 560 presence.ControllingClient.Kick(alert);
502 else 561 else
503 presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); 562 presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n");
504 563
505 presence.Scene.CloseAgent(presence.UUID, force); 564 presence.Scene.CloseAgent(presence.UUID, force);
506 break; 565 break;
@@ -567,7 +626,7 @@ namespace OpenSim
567 MainConsole.Instance.Output(usage); 626 MainConsole.Instance.Output(usage);
568 return; 627 return;
569 } 628 }
570 629
571 float angle = (float)(Convert.ToSingle(args[2]) / 180.0 * Math.PI); 630 float angle = (float)(Convert.ToSingle(args[2]) / 180.0 * Math.PI);
572 OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, angle); 631 OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, angle);
573 632
@@ -579,7 +638,7 @@ namespace OpenSim
579 638
580 Vector3 center = new Vector3(centerX, centerY, 0.0f); 639 Vector3 center = new Vector3(centerX, centerY, 0.0f);
581 640
582 SceneManager.ForEachSelectedScene(delegate(Scene scene) 641 SceneManager.ForEachSelectedScene(delegate(Scene scene)
583 { 642 {
584 scene.ForEachSOG(delegate(SceneObjectGroup sog) 643 scene.ForEachSOG(delegate(SceneObjectGroup sog)
585 { 644 {
@@ -731,8 +790,8 @@ namespace OpenSim
731 CreateRegion(regInfo, true, out scene); 790 CreateRegion(regInfo, true, out scene);
732 791
733 if (changed) 792 if (changed)
734 m_estateDataService.StoreEstateSettings(regInfo.EstateSettings); 793 m_estateDataService.StoreEstateSettings(regInfo.EstateSettings);
735 794
736 scene.Start(); 795 scene.Start();
737 } 796 }
738 797
@@ -835,8 +894,8 @@ namespace OpenSim
835 protected override void HandleRestartRegion(RegionInfo whichRegion) 894 protected override void HandleRestartRegion(RegionInfo whichRegion)
836 { 895 {
837 base.HandleRestartRegion(whichRegion); 896 base.HandleRestartRegion(whichRegion);
838 897
839 // Where we are restarting multiple scenes at once, a previous call to RefreshPrompt may have set the 898 // Where we are restarting multiple scenes at once, a previous call to RefreshPrompt may have set the
840 // m_console.ConsoleScene to null (indicating all scenes). 899 // m_console.ConsoleScene to null (indicating all scenes).
841 if (m_console.ConsoleScene != null && whichRegion.RegionName == ((Scene)m_console.ConsoleScene).Name) 900 if (m_console.ConsoleScene != null && whichRegion.RegionName == ((Scene)m_console.ConsoleScene).Name)
842 SceneManager.TrySetCurrentScene(whichRegion.RegionName); 901 SceneManager.TrySetCurrentScene(whichRegion.RegionName);
@@ -869,7 +928,7 @@ namespace OpenSim
869 { 928 {
870 agents = SceneManager.GetCurrentSceneAvatars(); 929 agents = SceneManager.GetCurrentSceneAvatars();
871 } 930 }
872 931
873 MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count)); 932 MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count));
874 933
875 MainConsole.Instance.Output( 934 MainConsole.Instance.Output(
@@ -915,7 +974,7 @@ namespace OpenSim
915 974
916 case "modules": 975 case "modules":
917 SceneManager.ForEachSelectedScene( 976 SceneManager.ForEachSelectedScene(
918 scene => 977 scene =>
919 { 978 {
920 MainConsole.Instance.OutputFormat("Loaded region modules in {0} are:", scene.Name); 979 MainConsole.Instance.OutputFormat("Loaded region modules in {0} are:", scene.Name);
921 980
@@ -951,16 +1010,16 @@ namespace OpenSim
951 cdt.AddColumn("Ready?", 6); 1010 cdt.AddColumn("Ready?", 6);
952 cdt.AddColumn("Estate", ConsoleDisplayUtil.EstateNameSize); 1011 cdt.AddColumn("Estate", ConsoleDisplayUtil.EstateNameSize);
953 SceneManager.ForEachScene( 1012 SceneManager.ForEachScene(
954 scene => 1013 scene =>
955 { 1014 {
956 RegionInfo ri = scene.RegionInfo; 1015 RegionInfo ri = scene.RegionInfo;
957 cdt.AddRow( 1016 cdt.AddRow(
958 ri.RegionName, 1017 ri.RegionName,
959 ri.RegionID, 1018 ri.RegionID,
960 string.Format("{0},{1}", ri.RegionLocX, ri.RegionLocY), 1019 string.Format("{0},{1}", ri.RegionLocX, ri.RegionLocY),
961 string.Format("{0}x{1}", ri.RegionSizeX, ri.RegionSizeY), 1020 string.Format("{0}x{1}", ri.RegionSizeX, ri.RegionSizeY),
962 ri.InternalEndPoint.Port, 1021 ri.InternalEndPoint.Port,
963 scene.Ready ? "Yes" : "No", 1022 scene.Ready ? "Yes" : "No",
964 ri.EstateSettings.EstateName); 1023 ri.EstateSettings.EstateName);
965 } 1024 }
966 ); 1025 );
@@ -1028,15 +1087,25 @@ namespace OpenSim
1028 cdt.AddColumn("Circuit code", 12); 1087 cdt.AddColumn("Circuit code", 12);
1029 cdt.AddColumn("Endpoint", 23); 1088 cdt.AddColumn("Endpoint", 23);
1030 cdt.AddColumn("Active?", 7); 1089 cdt.AddColumn("Active?", 7);
1090 cdt.AddColumn("ChildAgent?", 7);
1091 cdt.AddColumn("ping(ms)", 8);
1031 1092
1032 SceneManager.ForEachScene( 1093 SceneManager.ForEachScene(
1033 s => s.ForEachClient( 1094 s => s.ForEachClient(
1034 c => cdt.AddRow( 1095 c =>
1035 s.Name, 1096 {
1036 c.Name, 1097 bool child = false;
1037 c.CircuitCode.ToString(), 1098 if(c.SceneAgent != null && c.SceneAgent.IsChildAgent)
1038 c.RemoteEndPoint.ToString(), 1099 child = true;
1039 c.IsActive.ToString()))); 1100 cdt.AddRow(
1101 s.Name,
1102 c.Name,
1103 c.CircuitCode.ToString(),
1104 c.RemoteEndPoint.ToString(),
1105 c.IsActive.ToString(),
1106 child.ToString(),
1107 c.PingTimeMS);
1108 }));
1040 1109
1041 MainConsole.Instance.Output(cdt.ToString()); 1110 MainConsole.Instance.Output(cdt.ToString());
1042 } 1111 }
@@ -1048,7 +1117,7 @@ namespace OpenSim
1048 /// <param name="cmdparams"></param> 1117 /// <param name="cmdparams"></param>
1049 protected void SavePrimsXml2(string module, string[] cmdparams) 1118 protected void SavePrimsXml2(string module, string[] cmdparams)
1050 { 1119 {
1051 if (cmdparams.Length > 5) 1120 if (cmdparams.Length > 4)
1052 { 1121 {
1053 SceneManager.SaveNamedPrimsToXml2(cmdparams[3], cmdparams[4]); 1122 SceneManager.SaveNamedPrimsToXml2(cmdparams[3], cmdparams[4]);
1054 } 1123 }
@@ -1067,7 +1136,7 @@ namespace OpenSim
1067 { 1136 {
1068 MainConsole.Instance.Output("PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); 1137 MainConsole.Instance.Output("PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason.");
1069 1138
1070 if (cmdparams.Length > 0) 1139 if (cmdparams.Length > 2)
1071 { 1140 {
1072 SceneManager.SaveCurrentSceneToXml(cmdparams[2]); 1141 SceneManager.SaveCurrentSceneToXml(cmdparams[2]);
1073 } 1142 }