Application.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using OpenSim.UserServer;
  5. using OpenSim.Framework.Console;
  6. namespace OpenSim
  7. {
  8. public class Application
  9. {
  10. [STAThread]
  11. public static void Main(string[] args)
  12. {
  13. Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
  14. Console.WriteLine("Starting...\n");
  15. bool sandBoxMode = false;
  16. bool startLoginServer = false;
  17. string physicsEngine = "basicphysics";
  18. bool allowFlying = false;
  19. bool userAccounts = false;
  20. bool gridLocalAsset = false;
  21. bool useConfigFile = false;
  22. bool noverbose = false;
  23. string configFile = "simconfig.xml";
  24. for (int i = 0; i < args.Length; i++)
  25. {
  26. if (args[i] == "-sandbox")
  27. {
  28. sandBoxMode = true;
  29. }
  30. if (args[i] == "-loginserver")
  31. {
  32. startLoginServer = true;
  33. }
  34. if (args[i] == "-accounts")
  35. {
  36. userAccounts = true;
  37. }
  38. if (args[i] == "-realphysx")
  39. {
  40. physicsEngine = "RealPhysX";
  41. allowFlying = true;
  42. }
  43. if (args[i] == "-ode")
  44. {
  45. physicsEngine = "OpenDynamicsEngine";
  46. allowFlying = true;
  47. }
  48. if (args[i] == "-localasset")
  49. {
  50. gridLocalAsset = true;
  51. }
  52. if (args[i] == "-configfile")
  53. {
  54. useConfigFile = true;
  55. }
  56. if (args[i] == "-noverbose")
  57. {
  58. noverbose = true;
  59. }
  60. if (args[i] == "-config")
  61. {
  62. try
  63. {
  64. i++;
  65. configFile = args[i];
  66. }
  67. catch (Exception e)
  68. {
  69. Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")");
  70. }
  71. }
  72. }
  73. OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, noverbose, configFile);
  74. // OpenSimRoot.Instance.Application = sim;
  75. sim.m_sandbox = sandBoxMode;
  76. sim.user_accounts = userAccounts;
  77. sim.gridLocalAsset = gridLocalAsset;
  78. OpenSim.world.Avatar.PhysicsEngineFlying = allowFlying;
  79. sim.StartUp();
  80. while (true)
  81. {
  82. OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt();
  83. }
  84. }
  85. }
  86. }