OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
OpenSim.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using System;
29 using System.Collections;
30 using System.Collections.Generic;
31 using System.Diagnostics;
32 using System.IO;
33 using System.Linq;
34 using System.Reflection;
35 using System.Text;
36 using System.Text.RegularExpressions;
37 using System.Timers;
38 using log4net;
39 using NDesk.Options;
40 using Nini.Config;
41 using OpenMetaverse;
42 using OpenSim.Framework;
43 using OpenSim.Framework.Console;
44 using OpenSim.Framework.Servers;
45 using OpenSim.Framework.Monitoring;
46 using OpenSim.Region.Framework.Interfaces;
47 using OpenSim.Region.Framework.Scenes;
48 using OpenSim.Services.Interfaces;
49 
50 namespace OpenSim
51 {
55  public class OpenSim : OpenSimBase
56  {
57  private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
58 
59  protected string m_startupCommandsFile;
60  protected string m_shutdownCommandsFile;
61  protected bool m_gui = false;
62  protected string m_consoleType = "local";
63  protected uint m_consolePort = 0;
64 
68  private string m_consolePrompt;
69 
73  private Regex m_consolePromptRegex = new Regex(@"([^\\])\\(\w)", RegexOptions.Compiled);
74 
75  private string m_timedScript = "disabled";
76  private int m_timeInterval = 1200;
77  private Timer m_scriptTimer;
78 
79  public OpenSim(IConfigSource configSource) : base(configSource)
80  {
81  }
82 
83  protected override void ReadExtraConfigSettings()
84  {
85  base.ReadExtraConfigSettings();
86 
87  IConfig startupConfig = Config.Configs["Startup"];
88  IConfig networkConfig = Config.Configs["Network"];
89 
90  int stpMinThreads = 2;
91  int stpMaxThreads = 15;
92 
93  if (startupConfig != null)
94  {
95  m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "startup_commands.txt");
96  m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "shutdown_commands.txt");
97 
98  if (startupConfig.GetString("console", String.Empty) == String.Empty)
99  m_gui = startupConfig.GetBoolean("gui", false);
100  else
101  m_consoleType= startupConfig.GetString("console", String.Empty);
102 
103  if (networkConfig != null)
104  m_consolePort = (uint)networkConfig.GetInt("console_port", 0);
105 
106  m_timedScript = startupConfig.GetString("timer_Script", "disabled");
107  if (m_timedScript != "disabled")
108  {
109  m_timeInterval = startupConfig.GetInt("timer_Interval", 1200);
110  }
111 
112  string asyncCallMethodStr = startupConfig.GetString("async_call_method", String.Empty);
113  FireAndForgetMethod asyncCallMethod;
114  if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod))
115  Util.FireAndForgetMethod = asyncCallMethod;
116 
117  stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 );
118  stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 25);
119  m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) ");
120  }
121 
122  if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool)
123  Util.InitThreadPool(stpMinThreads, stpMaxThreads);
124 
125  m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod);
126  }
127 
131  protected override void StartupSpecific()
132  {
133  m_log.Info("====================================================================");
134  m_log.Info("========================= STARTING OPENSIM =========================");
135  m_log.Info("====================================================================");
136 
137  //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
138  // http://msdn.microsoft.com/en-us/library/bb384202.aspx
139  //GCSettings.LatencyMode = GCLatencyMode.Batch;
140  //m_log.InfoFormat("[OPENSIM MAIN]: GC Latency Mode: {0}", GCSettings.LatencyMode.ToString());
141 
142  if (m_gui) // Driven by external GUI
143  {
144  m_console = new CommandConsole("Region");
145  }
146  else
147  {
148  switch (m_consoleType)
149  {
150  case "basic":
151  m_console = new CommandConsole("Region");
152  break;
153  case "rest":
154  m_console = new RemoteConsole("Region");
155  ((RemoteConsole)m_console).ReadConfig(Config);
156  break;
157  default:
158  m_console = new LocalConsole("Region", Config.Configs["Startup"]);
159  break;
160  }
161  }
162 
163  MainConsole.Instance = m_console;
164 
165  LogEnvironmentInformation();
166  RegisterCommonAppenders(Config.Configs["Startup"]);
167  RegisterConsoleCommands();
168 
169  base.StartupSpecific();
170 
171  MainServer.Instance.AddStreamHandler(new OpenSim.SimStatusHandler());
172  MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this));
173  if (userStatsURI != String.Empty)
174  MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this));
175 
176  if (managedStatsURI != String.Empty)
177  {
178  string urlBase = String.Format("/{0}/", managedStatsURI);
179  MainServer.Instance.AddHTTPHandler(urlBase, StatsManager.HandleStatsRequest);
180  m_log.InfoFormat("[OPENSIM] Enabling remote managed stats fetch. URL = {0}", urlBase);
181  }
182 
183  if (m_console is RemoteConsole)
184  {
185  if (m_consolePort == 0)
186  {
187  ((RemoteConsole)m_console).SetServer(m_httpServer);
188  }
189  else
190  {
191  ((RemoteConsole)m_console).SetServer(MainServer.GetHttpServer(m_consolePort));
192  }
193  }
194 
195  // Hook up to the watchdog timer
196  Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
197 
198  PrintFileToConsole("startuplogo.txt");
199 
200  // For now, start at the 'root' level by default
201  if (SceneManager.Scenes.Count == 1) // If there is only one region, select it
202  ChangeSelectedRegion("region",
203  new string[] {"change", "region", SceneManager.Scenes[0].RegionInfo.RegionName});
204  else
205  ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
206 
207  //Run Startup Commands
208  if (String.IsNullOrEmpty(m_startupCommandsFile))
209  {
210  m_log.Info("[STARTUP]: No startup command script specified. Moving on...");
211  }
212  else
213  {
214  RunCommandScript(m_startupCommandsFile);
215  }
216 
217  // Start timer script (run a script every xx seconds)
218  if (m_timedScript != "disabled")
219  {
220  m_scriptTimer = new Timer();
221  m_scriptTimer.Enabled = true;
222  m_scriptTimer.Interval = m_timeInterval*1000;
223  m_scriptTimer.Elapsed += RunAutoTimerScript;
224  }
225  }
226 
230  private void RegisterConsoleCommands()
231  {
232  MainServer.RegisterHttpConsoleCommands(m_console);
233 
234  m_console.Commands.AddCommand("Objects", false, "force update",
235  "force update",
236  "Force the update of all objects on clients",
237  HandleForceUpdate);
238 
239  m_console.Commands.AddCommand("General", false, "change region",
240  "change region <region name>",
241  "Change current console region",
242  ChangeSelectedRegion);
243 
244  m_console.Commands.AddCommand("Archiving", false, "save xml",
245  "save xml",
246  "Save a region's data in XML format",
247  SaveXml);
248 
249  m_console.Commands.AddCommand("Archiving", false, "save xml2",
250  "save xml2",
251  "Save a region's data in XML2 format",
252  SaveXml2);
253 
254  m_console.Commands.AddCommand("Archiving", false, "load xml",
255  "load xml [-newIDs [<x> <y> <z>]]",
256  "Load a region's data from XML format",
257  LoadXml);
258 
259  m_console.Commands.AddCommand("Archiving", false, "load xml2",
260  "load xml2",
261  "Load a region's data from XML2 format",
262  LoadXml2);
263 
264  m_console.Commands.AddCommand("Archiving", false, "save prims xml2",
265  "save prims xml2 [<prim name> <file name>]",
266  "Save named prim to XML2",
267  SavePrimsXml2);
268 
269  m_console.Commands.AddCommand("Archiving", false, "load oar",
270  "load oar [-m|--merge] [-s|--skip-assets]"
271  + " [--default-user \"User Name\"]"
272  + " [--force-terrain] [--force-parcels]"
273  + " [--no-objects]"
274  + " [--rotation degrees]"
275  + " [--bounding-origin \"<x,y,z>\"]"
276  + " [--bounding-size \"<x,y,z>\"]"
277  + " [--displacement \"<x,y,z>\"]"
278  + " [-d|--debug]"
279  + " [<OAR path>]",
280  "Load a region's data from an OAR archive.",
281  "--merge will merge the OAR with the existing scene (suppresses terrain and parcel info loading).\n"
282  + "--skip-assets will load the OAR but ignore the assets it contains.\n"
283  + "--default-user will use this user for any objects with an owner whose UUID is not found in the grid.\n"
284  + "--force-terrain forces the loading of terrain from the oar (undoes suppression done by --merge).\n"
285  + "--force-parcels forces the loading of parcels from the oar (undoes suppression done by --merge).\n"
286  + "--no-objects suppresses the addition of any objects (good for loading only the terrain).\n"
287  + "--rotation specified rotation to be applied to the oar. Specified in degrees.\n"
288  + "--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"
289  + "--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"
290  + "--displacement will add this value to the position of every object loaded.\n"
291  + "--debug forces the archiver to display messages about where each object is being placed.\n\n"
292  + "The path can be either a filesystem location or a URI.\n"
293  + " If this is not given then the command looks for an OAR named region.oar in the current directory."
294  + " [--rotation-center \"<x,y,z>\"] used to be an option, now it does nothing and will be removed soon."
295  + "When an OAR is being loaded, operations are applied in this order:\n"
296  + "1: Rotation (around the incoming OARs region center)\n"
297  + "2: Cropping (a bounding cube with origin and size)\n"
298  + "3: Displacement (setting offset coordinates within the destination region)",
299  LoadOar); ;
300 
301  m_console.Commands.AddCommand("Archiving", false, "save oar",
302  //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
303  "save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [--all] [<OAR path>]",
304  "Save a region's data to an OAR archive.",
305 // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
306  "-h|--home=<url> adds the url of the profile service to the saved user information.\n"
307  + "--noassets stops assets being saved to the OAR.\n"
308  + "--publish saves an OAR stripped of owner and last owner information.\n"
309  + " on reload, the estate owner will be the owner of all objects\n"
310  + " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published\n"
311  + "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR.\n"
312  + " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer\n"
313  + "--all saves all the regions in the simulator, instead of just the current region.\n"
314  + "The OAR path must be a filesystem path."
315  + " If this is not given then the oar is saved to region.oar in the current directory.",
316  SaveOar);
317 
318  m_console.Commands.AddCommand("Objects", false, "edit scale",
319  "edit scale <name> <x> <y> <z>",
320  "Change the scale of a named prim",
321  HandleEditScale);
322 
323  m_console.Commands.AddCommand("Objects", false, "rotate scene",
324  "rotate scene <degrees> [centerX, centerY]",
325  "Rotates all scene objects around centerX, centerY (default 128, 128) (please back up your region before using)",
326  HandleRotateScene);
327 
328  m_console.Commands.AddCommand("Objects", false, "scale scene",
329  "scale scene <factor>",
330  "Scales the scene objects (please back up your region before using)",
331  HandleScaleScene);
332 
333  m_console.Commands.AddCommand("Objects", false, "translate scene",
334  "translate scene xOffset yOffset zOffset",
335  "translates the scene objects (please back up your region before using)",
336  HandleTranslateScene);
337 
338  m_console.Commands.AddCommand("Users", false, "kick user",
339  "kick user <first> <last> [--force] [message]",
340  "Kick a user off the simulator",
341  "The --force option will kick the user without any checks to see whether it's already in the process of closing\n"
342  + "Only use this option if you are sure the avatar is inactive and a normal kick user operation does not removed them",
343  KickUserCommand);
344 
345  m_console.Commands.AddCommand("Users", false, "show users",
346  "show users [full]",
347  "Show user data for users currently on the region",
348  "Without the 'full' option, only users actually on the region are shown."
349  + " With the 'full' option child agents of users in neighbouring regions are also shown.",
350  HandleShow);
351 
352  m_console.Commands.AddCommand("Comms", false, "show connections",
353  "show connections",
354  "Show connection data",
355  HandleShow);
356 
357  m_console.Commands.AddCommand("Comms", false, "show circuits",
358  "show circuits",
359  "Show agent circuit data",
360  HandleShow);
361 
362  m_console.Commands.AddCommand("Comms", false, "show pending-objects",
363  "show pending-objects",
364  "Show # of objects on the pending queues of all scene viewers",
365  HandleShow);
366 
367  m_console.Commands.AddCommand("General", false, "show modules",
368  "show modules",
369  "Show module data",
370  HandleShow);
371 
372  m_console.Commands.AddCommand("Regions", false, "show regions",
373  "show regions",
374  "Show region data",
375  HandleShow);
376 
377  m_console.Commands.AddCommand("Regions", false, "show ratings",
378  "show ratings",
379  "Show rating data",
380  HandleShow);
381 
382  m_console.Commands.AddCommand("Objects", false, "backup",
383  "backup",
384  "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.",
385  RunCommand);
386 
387  m_console.Commands.AddCommand("Regions", false, "create region",
388  "create region [\"region name\"] <region_file.ini>",
389  "Create a new region.",
390  "The settings for \"region name\" are read from <region_file.ini>. Paths specified with <region_file.ini> are relative to your Regions directory, unless an absolute path is given."
391  + " If \"region name\" does not exist in <region_file.ini>, it will be added." + Environment.NewLine
392  + "Without \"region name\", the first region found in <region_file.ini> will be created." + Environment.NewLine
393  + "If <region_file.ini> does not exist, it will be created.",
394  HandleCreateRegion);
395 
396  m_console.Commands.AddCommand("Regions", false, "restart",
397  "restart",
398  "Restart the currently selected region(s) in this instance",
399  RunCommand);
400 
401  m_console.Commands.AddCommand("General", false, "command-script",
402  "command-script <script>",
403  "Run a command script from file",
404  RunCommand);
405 
406  m_console.Commands.AddCommand("Regions", false, "remove-region",
407  "remove-region <name>",
408  "Remove a region from this simulator",
409  RunCommand);
410 
411  m_console.Commands.AddCommand("Regions", false, "delete-region",
412  "delete-region <name>",
413  "Delete a region from disk",
414  RunCommand);
415 
416  m_console.Commands.AddCommand("Estates", false, "estate create",
417  "estate create <owner UUID> <estate name>",
418  "Creates a new estate with the specified name, owned by the specified user."
419  + " Estate name must be unique.",
420  CreateEstateCommand);
421 
422  m_console.Commands.AddCommand("Estates", false, "estate set owner",
423  "estate set owner <estate-id>[ <UUID> | <Firstname> <Lastname> ]",
424  "Sets the owner of the specified estate to the specified UUID or user. ",
425  SetEstateOwnerCommand);
426 
427  m_console.Commands.AddCommand("Estates", false, "estate set name",
428  "estate set name <estate-id> <new name>",
429  "Sets the name of the specified estate to the specified value. New name must be unique.",
430  SetEstateNameCommand);
431 
432  m_console.Commands.AddCommand("Estates", false, "estate link region",
433  "estate link region <estate ID> <region ID>",
434  "Attaches the specified region to the specified estate.",
435  EstateLinkRegionCommand);
436  }
437 
438  protected override void ShutdownSpecific()
439  {
440  if (m_shutdownCommandsFile != String.Empty)
441  {
442  RunCommandScript(m_shutdownCommandsFile);
443  }
444 
445  base.ShutdownSpecific();
446  }
447 
453  private void RunAutoTimerScript(object sender, EventArgs e)
454  {
455  if (m_timedScript != "disabled")
456  {
457  RunCommandScript(m_timedScript);
458  }
459  }
460 
461  private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi)
462  {
463  int now = Environment.TickCount & Int32.MaxValue;
464 
465  m_log.ErrorFormat(
466  "[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}",
467  twi.Thread.Name,
468  twi.Thread.ThreadState,
469  now - twi.LastTick,
470  twi.AlarmMethod != null ? string.Format("Data: {0}", twi.AlarmMethod()) : "");
471  }
472 
473  #region Console Commands
474 
480  private void KickUserCommand(string module, string[] cmdparams)
481  {
482  bool force = false;
483 
484  OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; });
485 
486  List<string> mainParams = options.Parse(cmdparams);
487 
488  if (mainParams.Count < 4)
489  return;
490 
491  string alert = null;
492  if (mainParams.Count > 4)
493  alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4));
494 
495  IList agents = SceneManager.GetCurrentSceneAvatars();
496 
497  foreach (ScenePresence presence in agents)
498  {
500 
501  if (presence.Firstname.ToLower().Equals(mainParams[2].ToLower()) &&
502  presence.Lastname.ToLower().Equals(mainParams[3].ToLower()))
503  {
504  MainConsole.Instance.Output(
505  String.Format(
506  "Kicking user: {0,-16} {1,-16} {2,-37} in region: {3,-16}",
507  presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName));
508 
509  // kick client...
510  if (alert != null)
511  presence.ControllingClient.Kick(alert);
512  else
513  presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n");
514 
515  presence.Scene.CloseAgent(presence.UUID, force);
516  break;
517  }
518  }
519 
520  MainConsole.Instance.Output("");
521  }
522 
527  private static void PrintFileToConsole(string fileName)
528  {
529  if (File.Exists(fileName))
530  {
531  StreamReader readFile = File.OpenText(fileName);
532  string currentLine;
533  while ((currentLine = readFile.ReadLine()) != null)
534  {
535  m_log.Info("[!]" + currentLine);
536  }
537  }
538  }
539 
545  private void HandleForceUpdate(string module, string[] args)
546  {
547  MainConsole.Instance.Output("Updating all clients");
548  SceneManager.ForceCurrentSceneClientUpdate();
549  }
550 
556  private void HandleEditScale(string module, string[] args)
557  {
558  if (args.Length == 6)
559  {
560  SceneManager.HandleEditCommandOnCurrentScene(args);
561  }
562  else
563  {
564  MainConsole.Instance.Output("Argument error: edit scale <prim name> <x> <y> <z>");
565  }
566  }
567 
568  private void HandleRotateScene(string module, string[] args)
569  {
570  string usage = "Usage: rotate scene <angle in degrees> [centerX centerY] (centerX and centerY are optional and default to Constants.RegionSize / 2";
571 
572  float centerX = Constants.RegionSize * 0.5f;
573  float centerY = Constants.RegionSize * 0.5f;
574 
575  if (args.Length < 3 || args.Length == 4)
576  {
577  MainConsole.Instance.Output(usage);
578  return;
579  }
580 
581  float angle = (float)(Convert.ToSingle(args[2]) / 180.0 * Math.PI);
582  OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, angle);
583 
584  if (args.Length > 4)
585  {
586  centerX = Convert.ToSingle(args[3]);
587  centerY = Convert.ToSingle(args[4]);
588  }
589 
590  Vector3 center = new Vector3(centerX, centerY, 0.0f);
591 
592  SceneManager.ForEachSelectedScene(delegate(Scene scene)
593  {
594  scene.ForEachSOG(delegate(SceneObjectGroup sog)
595  {
596  if (!sog.IsAttachment)
597  {
598  sog.RootPart.UpdateRotation(rot * sog.GroupRotation);
599  Vector3 offset = sog.AbsolutePosition - center;
600  offset *= rot;
601  sog.UpdateGroupPosition(center + offset);
602  }
603  });
604  });
605  }
606 
607  private void HandleScaleScene(string module, string[] args)
608  {
609  string usage = "Usage: scale scene <factor>";
610 
611  if (args.Length < 3)
612  {
613  MainConsole.Instance.Output(usage);
614  return;
615  }
616 
617  float factor = (float)(Convert.ToSingle(args[2]));
618 
619  float minZ = float.MaxValue;
620 
621  SceneManager.ForEachSelectedScene(delegate(Scene scene)
622  {
623  scene.ForEachSOG(delegate(SceneObjectGroup sog)
624  {
625  if (!sog.IsAttachment)
626  {
627  if (sog.RootPart.AbsolutePosition.Z < minZ)
628  minZ = sog.RootPart.AbsolutePosition.Z;
629  }
630  });
631  });
632 
633  SceneManager.ForEachSelectedScene(delegate(Scene scene)
634  {
635  scene.ForEachSOG(delegate(SceneObjectGroup sog)
636  {
637  if (!sog.IsAttachment)
638  {
639  Vector3 tmpRootPos = sog.RootPart.AbsolutePosition;
640  tmpRootPos.Z -= minZ;
641  tmpRootPos *= factor;
642  tmpRootPos.Z += minZ;
643 
644  foreach (SceneObjectPart sop in sog.Parts)
645  {
646  if (sop.ParentID != 0)
647  sop.OffsetPosition *= factor;
648  sop.Scale *= factor;
649  }
650 
651  sog.UpdateGroupPosition(tmpRootPos);
652  }
653  });
654  });
655  }
656 
657  private void HandleTranslateScene(string module, string[] args)
658  {
659  string usage = "Usage: translate scene <xOffset, yOffset, zOffset>";
660 
661  if (args.Length < 5)
662  {
663  MainConsole.Instance.Output(usage);
664  return;
665  }
666 
667  float xOFfset = (float)Convert.ToSingle(args[2]);
668  float yOffset = (float)Convert.ToSingle(args[3]);
669  float zOffset = (float)Convert.ToSingle(args[4]);
670 
671  Vector3 offset = new Vector3(xOFfset, yOffset, zOffset);
672 
673  SceneManager.ForEachSelectedScene(delegate(Scene scene)
674  {
675  scene.ForEachSOG(delegate(SceneObjectGroup sog)
676  {
677  if (!sog.IsAttachment)
678  sog.UpdateGroupPosition(sog.AbsolutePosition + offset);
679  });
680  });
681  }
682 
688  private void HandleCreateRegion(string module, string[] cmd)
689  {
690  string regionName = string.Empty;
691  string regionFile = string.Empty;
692 
693  if (cmd.Length == 3)
694  {
695  regionFile = cmd[2];
696  }
697  else if (cmd.Length > 3)
698  {
699  regionName = cmd[2];
700  regionFile = cmd[3];
701  }
702 
703  string extension = Path.GetExtension(regionFile).ToLower();
704  bool isXml = extension.Equals(".xml");
705  bool isIni = extension.Equals(".ini");
706 
707  if (!isXml && !isIni)
708  {
709  MainConsole.Instance.Output("Usage: create region [\"region name\"] <region_file.ini>");
710  return;
711  }
712 
713  if (!Path.IsPathRooted(regionFile))
714  {
715  string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
716  regionFile = Path.Combine(regionsDir, regionFile);
717  }
718 
719  RegionInfo regInfo;
720  if (isXml)
721  {
722  regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source);
723  }
724  else
725  {
726  regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName);
727  }
728 
729  Scene existingScene;
730  if (SceneManager.TryGetScene(regInfo.RegionID, out existingScene))
731  {
732  MainConsole.Instance.OutputFormat(
733  "ERROR: Cannot create region {0} with ID {1}, this ID is already assigned to region {2}",
734  regInfo.RegionName, regInfo.RegionID, existingScene.RegionInfo.RegionName);
735 
736  return;
737  }
738 
739  bool changed = PopulateRegionEstateInfo(regInfo);
740  IScene scene;
741  CreateRegion(regInfo, true, out scene);
742 
743  if (changed)
744  m_estateDataService.StoreEstateSettings(regInfo.EstateSettings);
745 
746  scene.Start();
747  }
748 
754  public void RunCommand(string module, string[] cmdparams)
755  {
756  List<string> args = new List<string>(cmdparams);
757  if (args.Count < 1)
758  return;
759 
760  string command = args[0];
761  args.RemoveAt(0);
762 
763  cmdparams = args.ToArray();
764 
765  switch (command)
766  {
767  case "backup":
768  MainConsole.Instance.Output("Triggering save of pending object updates to persistent store");
769  SceneManager.BackupCurrentScene();
770  break;
771 
772  case "remove-region":
773  string regRemoveName = CombineParams(cmdparams, 0);
774 
775  Scene removeScene;
776  if (SceneManager.TryGetScene(regRemoveName, out removeScene))
777  RemoveRegion(removeScene, false);
778  else
779  MainConsole.Instance.Output("No region with that name");
780  break;
781 
782  case "delete-region":
783  string regDeleteName = CombineParams(cmdparams, 0);
784 
785  Scene killScene;
786  if (SceneManager.TryGetScene(regDeleteName, out killScene))
787  RemoveRegion(killScene, true);
788  else
789  MainConsole.Instance.Output("no region with that name");
790  break;
791 
792  case "restart":
793  SceneManager.RestartCurrentScene();
794  break;
795  }
796  }
797 
802  protected void ChangeSelectedRegion(string module, string[] cmdparams)
803  {
804  if (cmdparams.Length > 2)
805  {
806  string newRegionName = CombineParams(cmdparams, 2);
807 
808  if (!SceneManager.TrySetCurrentScene(newRegionName))
809  MainConsole.Instance.Output(String.Format("Couldn't select region {0}", newRegionName));
810  else
811  RefreshPrompt();
812  }
813  else
814  {
815  MainConsole.Instance.Output("Usage: change region <region name>");
816  }
817  }
818 
822  private void RefreshPrompt()
823  {
824  string regionName = (SceneManager.CurrentScene == null ? "root" : SceneManager.CurrentScene.RegionInfo.RegionName);
825  MainConsole.Instance.Output(String.Format("Currently selected region is {0}", regionName));
826 
827 // m_log.DebugFormat("Original prompt is {0}", m_consolePrompt);
828  string prompt = m_consolePrompt;
829 
830  // Replace "\R" with the region name
831  // Replace "\\" with "\"
832  prompt = m_consolePromptRegex.Replace(prompt, m =>
833  {
834 // m_log.DebugFormat("Matched {0}", m.Groups[2].Value);
835  if (m.Groups[2].Value == "R")
836  return m.Groups[1].Value + regionName;
837  else
838  return m.Groups[0].Value;
839  });
840 
841  m_console.DefaultPrompt = prompt;
842  m_console.ConsoleScene = SceneManager.CurrentScene;
843  }
844 
845  protected override void HandleRestartRegion(RegionInfo whichRegion)
846  {
847  base.HandleRestartRegion(whichRegion);
848 
849  // Where we are restarting multiple scenes at once, a previous call to RefreshPrompt may have set the
850  // m_console.ConsoleScene to null (indicating all scenes).
851  if (m_console.ConsoleScene != null && whichRegion.RegionName == ((Scene)m_console.ConsoleScene).Name)
853 
854  RefreshPrompt();
855  }
856 
857  // see BaseOpenSimServer
863  public override void HandleShow(string mod, string[] cmd)
864  {
865  base.HandleShow(mod, cmd);
866 
867  List<string> args = new List<string>(cmd);
868  args.RemoveAt(0);
869  string[] showParams = args.ToArray();
870 
871  switch (showParams[0])
872  {
873  case "users":
874  IList agents;
875  if (showParams.Length > 1 && showParams[1] == "full")
876  {
877  agents = SceneManager.GetCurrentScenePresences();
878  } else
879  {
880  agents = SceneManager.GetCurrentSceneAvatars();
881  }
882 
883  MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count));
884 
885  MainConsole.Instance.Output(
886  String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname",
887  "Agent ID", "Root/Child", "Region", "Position")
888  );
889 
890  foreach (ScenePresence presence in agents)
891  {
893  string regionName;
894 
895  if (regionInfo == null)
896  {
897  regionName = "Unresolvable";
898  } else
899  {
900  regionName = regionInfo.RegionName;
901  }
902 
903  MainConsole.Instance.Output(
904  String.Format(
905  "{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}",
906  presence.Firstname,
907  presence.Lastname,
908  presence.UUID,
909  presence.IsChildAgent ? "Child" : "Root",
910  regionName,
911  presence.AbsolutePosition.ToString())
912  );
913  }
914 
915  MainConsole.Instance.Output(String.Empty);
916  break;
917 
918  case "connections":
919  HandleShowConnections();
920  break;
921 
922  case "circuits":
923  HandleShowCircuits();
924  break;
925 
926  case "modules":
927  SceneManager.ForEachSelectedScene(
928  scene =>
929  {
930  MainConsole.Instance.OutputFormat("Loaded region modules in {0} are:", scene.Name);
931 
932  List<IRegionModuleBase> sharedModules = new List<IRegionModuleBase>();
933  List<IRegionModuleBase> nonSharedModules = new List<IRegionModuleBase>();
934 
935  foreach (IRegionModuleBase module in scene.RegionModules.Values)
936  {
937  if (module.GetType().GetInterface("ISharedRegionModule") == null)
938  nonSharedModules.Add(module);
939  else
940  sharedModules.Add(module);
941  }
942 
943  foreach (IRegionModuleBase module in sharedModules.OrderBy(m => m.Name))
944  MainConsole.Instance.OutputFormat("New Region Module (Shared): {0}", module.Name);
945 
946  foreach (IRegionModuleBase module in nonSharedModules.OrderBy(m => m.Name))
947  MainConsole.Instance.OutputFormat("New Region Module (Non-Shared): {0}", module.Name);
948  }
949  );
950 
951  MainConsole.Instance.Output("");
952  break;
953 
954  case "regions":
956  cdt.AddColumn("Name", ConsoleDisplayUtil.RegionNameSize);
957  cdt.AddColumn("ID", ConsoleDisplayUtil.UuidSize);
958  cdt.AddColumn("Position", ConsoleDisplayUtil.CoordTupleSize);
959  cdt.AddColumn("Size", 11);
960  cdt.AddColumn("Port", ConsoleDisplayUtil.PortSize);
961  cdt.AddColumn("Ready?", 6);
962  cdt.AddColumn("Estate", ConsoleDisplayUtil.EstateNameSize);
963  SceneManager.ForEachScene(
964  scene =>
965  {
967  cdt.AddRow(
968  ri.RegionName,
969  ri.RegionID,
970  string.Format("{0},{1}", ri.RegionLocX, ri.RegionLocY),
971  string.Format("{0}x{1}", ri.RegionSizeX, ri.RegionSizeY),
972  ri.InternalEndPoint.Port,
973  scene.Ready ? "Yes" : "No",
974  ri.EstateSettings.EstateName);
975  }
976  );
977 
978  MainConsole.Instance.Output(cdt.ToString());
979  break;
980 
981  case "ratings":
982  SceneManager.ForEachScene(
983  delegate(Scene scene)
984  {
985  string rating = "";
986  if (scene.RegionInfo.RegionSettings.Maturity == 1)
987  {
988  rating = "MATURE";
989  }
990  else if (scene.RegionInfo.RegionSettings.Maturity == 2)
991  {
992  rating = "ADULT";
993  }
994  else
995  {
996  rating = "PG";
997  }
998  MainConsole.Instance.Output(String.Format(
999  "Region Name: {0}, Region Rating {1}",
1000  scene.RegionInfo.RegionName,
1001  rating));
1002  });
1003  break;
1004  }
1005  }
1006 
1007  private void HandleShowCircuits()
1008  {
1010  cdt.AddColumn("Region", 20);
1011  cdt.AddColumn("Avatar name", 24);
1012  cdt.AddColumn("Type", 5);
1013  cdt.AddColumn("Code", 10);
1014  cdt.AddColumn("IP", 16);
1015  cdt.AddColumn("Viewer Name", 24);
1016 
1017  SceneManager.ForEachScene(
1018  s =>
1019  {
1020  foreach (AgentCircuitData aCircuit in s.AuthenticateHandler.GetAgentCircuits().Values)
1021  cdt.AddRow(
1022  s.Name,
1023  aCircuit.Name,
1024  aCircuit.child ? "child" : "root",
1025  aCircuit.circuitcode.ToString(),
1026  aCircuit.IPAddress != null ? aCircuit.IPAddress.ToString() : "not set",
1027  Util.GetViewerName(aCircuit));
1028  });
1029 
1030  MainConsole.Instance.Output(cdt.ToString());
1031  }
1032 
1033  private void HandleShowConnections()
1034  {
1036  cdt.AddColumn("Region", 20);
1037  cdt.AddColumn("Avatar name", 24);
1038  cdt.AddColumn("Circuit code", 12);
1039  cdt.AddColumn("Endpoint", 23);
1040  cdt.AddColumn("Active?", 7);
1041  cdt.AddColumn("ChildAgent?", 7);
1042  cdt.AddColumn("ping(ms)", 8);
1043 
1044  SceneManager.ForEachScene(
1045  s => s.ForEachClient(
1046  c =>
1047  {
1048  bool child = false;
1049  if(c.SceneAgent != null && c.SceneAgent.IsChildAgent)
1050  child = true;
1051  cdt.AddRow(
1052  s.Name,
1053  c.Name,
1054  c.CircuitCode.ToString(),
1055  c.RemoteEndPoint.ToString(),
1056  c.IsActive.ToString(),
1057  child.ToString(),
1058  c.PingTimeMS);
1059  }));
1060 
1061  MainConsole.Instance.Output(cdt.ToString());
1062  }
1063 
1069  protected void SavePrimsXml2(string module, string[] cmdparams)
1070  {
1071  if (cmdparams.Length > 5)
1072  {
1073  SceneManager.SaveNamedPrimsToXml2(cmdparams[3], cmdparams[4]);
1074  }
1075  else
1076  {
1077  SceneManager.SaveNamedPrimsToXml2("Primitive", DEFAULT_PRIM_BACKUP_FILENAME);
1078  }
1079  }
1080 
1086  protected void SaveXml(string module, string[] cmdparams)
1087  {
1088  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.");
1089 
1090  if (cmdparams.Length > 0)
1091  {
1092  SceneManager.SaveCurrentSceneToXml(cmdparams[2]);
1093  }
1094  else
1095  {
1096  SceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME);
1097  }
1098  }
1099 
1105  protected void LoadXml(string module, string[] cmdparams)
1106  {
1107  MainConsole.Instance.Output("PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason.");
1108 
1109  Vector3 loadOffset = new Vector3(0, 0, 0);
1110  if (cmdparams.Length > 2)
1111  {
1112  bool generateNewIDS = false;
1113  if (cmdparams.Length > 3)
1114  {
1115  if (cmdparams[3] == "-newUID")
1116  {
1117  generateNewIDS = true;
1118  }
1119  if (cmdparams.Length > 4)
1120  {
1121  loadOffset.X = (float)Convert.ToDecimal(cmdparams[4], Culture.NumberFormatInfo);
1122  if (cmdparams.Length > 5)
1123  {
1124  loadOffset.Y = (float)Convert.ToDecimal(cmdparams[5], Culture.NumberFormatInfo);
1125  }
1126  if (cmdparams.Length > 6)
1127  {
1128  loadOffset.Z = (float)Convert.ToDecimal(cmdparams[6], Culture.NumberFormatInfo);
1129  }
1130  MainConsole.Instance.Output(String.Format("loadOffsets <X,Y,Z> = <{0},{1},{2}>",loadOffset.X,loadOffset.Y,loadOffset.Z));
1131  }
1132  }
1133  SceneManager.LoadCurrentSceneFromXml(cmdparams[2], generateNewIDS, loadOffset);
1134  }
1135  else
1136  {
1137  try
1138  {
1139  SceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset);
1140  }
1141  catch (FileNotFoundException)
1142  {
1143  MainConsole.Instance.Output("Default xml not found. Usage: load-xml <filename>");
1144  }
1145  }
1146  }
1152  protected void SaveXml2(string module, string[] cmdparams)
1153  {
1154  if (cmdparams.Length > 2)
1155  {
1156  SceneManager.SaveCurrentSceneToXml2(cmdparams[2]);
1157  }
1158  else
1159  {
1160  SceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME);
1161  }
1162  }
1163 
1169  protected void LoadXml2(string module, string[] cmdparams)
1170  {
1171  if (cmdparams.Length > 2)
1172  {
1173  try
1174  {
1175  SceneManager.LoadCurrentSceneFromXml2(cmdparams[2]);
1176  }
1177  catch (FileNotFoundException)
1178  {
1179  MainConsole.Instance.Output("Specified xml not found. Usage: load xml2 <filename>");
1180  }
1181  }
1182  else
1183  {
1184  try
1185  {
1186  SceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME);
1187  }
1188  catch (FileNotFoundException)
1189  {
1190  MainConsole.Instance.Output("Default xml not found. Usage: load xml2 <filename>");
1191  }
1192  }
1193  }
1194 
1199  protected void LoadOar(string module, string[] cmdparams)
1200  {
1201  try
1202  {
1203  SceneManager.LoadArchiveToCurrentScene(cmdparams);
1204  }
1205  catch (Exception e)
1206  {
1207  MainConsole.Instance.Output(e.Message);
1208  }
1209  }
1210 
1215  protected void SaveOar(string module, string[] cmdparams)
1216  {
1217  SceneManager.SaveCurrentSceneToArchive(cmdparams);
1218  }
1219 
1220  protected void CreateEstateCommand(string module, string[] args)
1221  {
1222  string response = null;
1223  UUID userID;
1224 
1225  if (args.Length == 2)
1226  {
1227  response = "No user specified.";
1228  }
1229  else if (!UUID.TryParse(args[2], out userID))
1230  {
1231  response = String.Format("{0} is not a valid UUID", args[2]);
1232  }
1233  else if (args.Length == 3)
1234  {
1235  response = "No estate name specified.";
1236  }
1237  else
1238  {
1239  Scene scene = SceneManager.CurrentOrFirstScene;
1240 
1241  // TODO: Is there a better choice here?
1242  UUID scopeID = UUID.Zero;
1243  UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, userID);
1244  if (account == null)
1245  {
1246  response = String.Format("Could not find user {0}", userID);
1247  }
1248  else
1249  {
1250  // concatenate it all to "name"
1251  StringBuilder sb = new StringBuilder(args[3]);
1252  for (int i = 4; i < args.Length; i++)
1253  sb.Append (" " + args[i]);
1254  string estateName = sb.ToString().Trim();
1255 
1256  // send it off for processing.
1257  IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
1258  response = estateModule.CreateEstate(estateName, userID);
1259  if (response == String.Empty)
1260  {
1261  List<int> estates = scene.EstateDataService.GetEstates(estateName);
1262  response = String.Format("Estate {0} created as \"{1}\"", estates.ElementAt(0), estateName);
1263  }
1264  }
1265  }
1266 
1267  // give the user some feedback
1268  if (response != null)
1269  MainConsole.Instance.Output(response);
1270  }
1271 
1272  protected void SetEstateOwnerCommand(string module, string[] args)
1273  {
1274  string response = null;
1275 
1276  Scene scene = SceneManager.CurrentOrFirstScene;
1277  IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
1278 
1279  if (args.Length == 3)
1280  {
1281  response = "No estate specified.";
1282  }
1283  else
1284  {
1285  int estateId;
1286  if (!int.TryParse(args[3], out estateId))
1287  {
1288  response = String.Format("\"{0}\" is not a valid ID for an Estate", args[3]);
1289  }
1290  else
1291  {
1292  if (args.Length == 4)
1293  {
1294  response = "No user specified.";
1295  }
1296  else
1297  {
1298  UserAccount account = null;
1299 
1300  // TODO: Is there a better choice here?
1301  UUID scopeID = UUID.Zero;
1302 
1303  string s1 = args[4];
1304  if (args.Length == 5)
1305  {
1306  // attempt to get account by UUID
1307  UUID u;
1308  if (UUID.TryParse(s1, out u))
1309  {
1310  account = scene.UserAccountService.GetUserAccount(scopeID, u);
1311  if (account == null)
1312  response = String.Format("Could not find user {0}", s1);
1313  }
1314  else
1315  {
1316  response = String.Format("Invalid UUID {0}", s1);
1317  }
1318  }
1319  else
1320  {
1321  // attempt to get account by Firstname, Lastname
1322  string s2 = args[5];
1323  account = scene.UserAccountService.GetUserAccount(scopeID, s1, s2);
1324  if (account == null)
1325  response = String.Format("Could not find user {0} {1}", s1, s2);
1326  }
1327 
1328  // If it's valid, send it off for processing.
1329  if (account != null)
1330  response = estateModule.SetEstateOwner(estateId, account);
1331 
1332  if (response == String.Empty)
1333  {
1334  response = String.Format("Estate owner changed to {0} ({1} {2})", account.PrincipalID, account.FirstName, account.LastName);
1335  }
1336  }
1337  }
1338  }
1339 
1340  // give the user some feedback
1341  if (response != null)
1342  MainConsole.Instance.Output(response);
1343  }
1344 
1345  protected void SetEstateNameCommand(string module, string[] args)
1346  {
1347  string response = null;
1348 
1349  Scene scene = SceneManager.CurrentOrFirstScene;
1350  IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
1351 
1352  if (args.Length == 3)
1353  {
1354  response = "No estate specified.";
1355  }
1356  else
1357  {
1358  int estateId;
1359  if (!int.TryParse(args[3], out estateId))
1360  {
1361  response = String.Format("\"{0}\" is not a valid ID for an Estate", args[3]);
1362  }
1363  else
1364  {
1365  if (args.Length == 4)
1366  {
1367  response = "No name specified.";
1368  }
1369  else
1370  {
1371  // everything after the estate ID is "name"
1372  StringBuilder sb = new StringBuilder(args[4]);
1373  for (int i = 5; i < args.Length; i++)
1374  sb.Append (" " + args[i]);
1375 
1376  string estateName = sb.ToString();
1377 
1378  // send it off for processing.
1379  response = estateModule.SetEstateName(estateId, estateName);
1380 
1381  if (response == String.Empty)
1382  {
1383  response = String.Format("Estate {0} renamed to \"{1}\"", estateId, estateName);
1384  }
1385  }
1386  }
1387  }
1388 
1389  // give the user some feedback
1390  if (response != null)
1391  MainConsole.Instance.Output(response);
1392  }
1393 
1394  private void EstateLinkRegionCommand(string module, string[] args)
1395  {
1396  int estateId =-1;
1397  UUID regionId = UUID.Zero;
1398  Scene scene = null;
1399  string response = null;
1400 
1401  if (args.Length == 3)
1402  {
1403  response = "No estate specified.";
1404  }
1405  else if (!int.TryParse(args [3], out estateId))
1406  {
1407  response = String.Format("\"{0}\" is not a valid ID for an Estate", args [3]);
1408  }
1409  else if (args.Length == 4)
1410  {
1411  response = "No region specified.";
1412  }
1413  else if (!UUID.TryParse(args[4], out regionId))
1414  {
1415  response = String.Format("\"{0}\" is not a valid UUID for a Region", args [4]);
1416  }
1417  else if (!SceneManager.TryGetScene(regionId, out scene))
1418  {
1419  // region may exist, but on a different sim.
1420  response = String.Format("No access to Region \"{0}\"", args [4]);
1421  }
1422 
1423  if (response != null)
1424  {
1425  MainConsole.Instance.Output(response);
1426  return;
1427  }
1428 
1429  // send it off for processing.
1430  IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
1431  response = estateModule.SetRegionEstate(scene.RegionInfo, estateId);
1432  if (response == String.Empty)
1433  {
1434  estateModule.TriggerRegionInfoChange();
1435  estateModule.sendRegionHandshakeToAll();
1436  response = String.Format ("Region {0} is now attached to estate {1}", regionId, estateId);
1437  }
1438 
1439  // give the user some feedback
1440  if (response != null)
1441  MainConsole.Instance.Output (response);
1442  }
1443 
1444  #endregion
1445 
1446  private static string CombineParams(string[] commandParams, int pos)
1447  {
1448  string result = String.Empty;
1449  for (int i = pos; i < commandParams.Length; i++)
1450  {
1451  result += commandParams[i] + " ";
1452  }
1453  result = result.TrimEnd(' ');
1454  return result;
1455  }
1456  }
1457 }
string Name
Agent's full name.
void OutputFormat(string format, params object[] components)
static NumberFormatInfo NumberFormatInfo
Definition: Culture.cs:39
uint circuitcode
Number given to the client when they log-in that they provide as credentials to the UDP server ...
Handler to supply the current status of this sim
Definition: OpenSimBase.cs:802
void SavePrimsXml2(string module, string[] cmdparams)
Use XML2 format to serialize data to a file
Definition: OpenSim.cs:1069
Used to generated a formatted table for the console.
FireAndForgetMethod
The method used by Util.FireAndForget for asynchronously firing events
Definition: Util.cs:92
OpenSim.Framework.RegionInfo RegionInfo
void CreateEstateCommand(string module, string[] args)
Definition: OpenSim.cs:1220
void SaveXml2(string module, string[] cmdparams)
Serialize region data to XML2Format
Definition: OpenSim.cs:1152
uint RegionSizeX
X dimension of the region.
Definition: RegionInfo.cs:161
uint RegionSizeY
X dimension of the region.
Definition: RegionInfo.cs:169
void ChangeSelectedRegion(string module, string[] cmdparams)
Change the currently selected region. The selected region is that operated upon by single region comm...
Definition: OpenSim.cs:802
string m_startupCommandsFile
Definition: OpenSim.cs:59
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
bool child
Root agent, or Child agent
void SetEstateNameCommand(string module, string[] args)
Definition: OpenSim.cs:1345
RegionSettings RegionSettings
Definition: RegionInfo.cs:290
override void HandleRestartRegion(RegionInfo whichRegion)
Definition: OpenSim.cs:845
Handler to supply the current extended status of this sim Sends the statistical data in a json serial...
Definition: OpenSimBase.cs:822
System.Timers.Timer Timer
void SaveXml(string module, string[] cmdparams)
Use XML format to serialize data to a file
Definition: OpenSim.cs:1086
Handler to supply the current extended status of this sim to a user configured URI Sends the statisti...
Definition: OpenSimBase.cs:850
override void ReadExtraConfigSettings()
Definition: OpenSim.cs:83
override void ShutdownSpecific()
Should be overriden and referenced by descendents if they need to perform extra shutdown processing ...
Definition: OpenSim.cs:438
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
override void HandleShow(string mod, string[] cmd)
Many commands list objects for debugging. Some of the types are listed here
Definition: OpenSim.cs:863
void LoadOar(string module, string[] cmdparams)
Load a whole region from an opensimulator archive.
Definition: OpenSim.cs:1199
static ICommandConsole Instance
Definition: MainConsole.cs:35
void LoadXml2(string module, string[] cmdparams)
Load region data from Xml2Format
Definition: OpenSim.cs:1169
Manager for adding, closing and restarting scenes.
Definition: SceneManager.cs:44
void SaveOar(string module, string[] cmdparams)
Save a region to a file, including all the assets needed to restore it.
Definition: OpenSim.cs:1215
void Output(string text, string level)
void RunCommand(string module, string[] cmdparams)
Runs commands issued by the server console from the operator
Definition: OpenSim.cs:754
Interactive OpenSim region server
Definition: OpenSim.cs:55
override void StartupSpecific()
Performs initialisation of the scene, such as loading configuration from disk.
Definition: OpenSim.cs:131
string m_shutdownCommandsFile
Definition: OpenSim.cs:60
void SetEstateOwnerCommand(string module, string[] args)
Definition: OpenSim.cs:1272
Common OpenSimulator simulator code
Definition: OpenSimBase.cs:58
uint ParentID
The parent ID of this part.
void LoadXml(string module, string[] cmdparams)
Loads data and region objects from XML format.
Definition: OpenSim.cs:1105
A console that uses cursor control and color
Definition: LocalConsole.cs:44
A console that processes commands internally
OpenSim(IConfigSource configSource)
Definition: OpenSim.cs:79
bool IsAttachment
Is this scene object acting as an attachment?
bool TryGetScene(string regionName, out Scene scene)