diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSimMain.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index a8f4bd4..7f13281 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -50,14 +50,14 @@ using OpenSim.Region.Physics.Manager; | |||
50 | namespace OpenSim | 50 | namespace OpenSim |
51 | { | 51 | { |
52 | public class OpenSimMain : RegionApplicationBase | 52 | public class OpenSimMain : RegionApplicationBase |
53 | { | 53 | { |
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Holds a human readable build version for this server. | 57 | /// Holds a human readable build version for this server. |
58 | /// </summary> | 58 | /// </summary> |
59 | protected string buildVersion; | 59 | protected string buildVersion; |
60 | 60 | ||
61 | protected string proxyUrl; | 61 | protected string proxyUrl; |
62 | protected int proxyOffset = 0; | 62 | protected int proxyOffset = 0; |
63 | 63 | ||
@@ -90,42 +90,42 @@ namespace OpenSim | |||
90 | private string m_standaloneUserSource; | 90 | private string m_standaloneUserSource; |
91 | 91 | ||
92 | protected string m_assetStorage = "local"; | 92 | protected string m_assetStorage = "local"; |
93 | 93 | ||
94 | public ConsoleCommand CreateAccount = null; | 94 | public ConsoleCommand CreateAccount = null; |
95 | protected bool m_dumpAssetsToFile; | 95 | protected bool m_dumpAssetsToFile; |
96 | 96 | ||
97 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 97 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
98 | 98 | ||
99 | protected IConfigSource m_finalConfig = null; | 99 | protected IConfigSource m_finalConfig = null; |
100 | 100 | ||
101 | protected IniConfigSource m_config; | 101 | protected IniConfigSource m_config; |
102 | 102 | ||
103 | public IniConfigSource ConfigSource | 103 | public IniConfigSource ConfigSource |
104 | { | 104 | { |
105 | get { return m_config; } | 105 | get { return m_config; } |
106 | set { m_config = value; } | 106 | set { m_config = value; } |
107 | } | 107 | } |
108 | 108 | ||
109 | public List<IClientNetworkServer> ClientServers | 109 | public List<IClientNetworkServer> ClientServers |
110 | { | 110 | { |
111 | get { return m_clientServers; } | 111 | get { return m_clientServers; } |
112 | } | 112 | } |
113 | 113 | ||
114 | public List<RegionInfo> RegionData | 114 | public List<RegionInfo> RegionData |
115 | { | 115 | { |
116 | get { return m_regionData; } | 116 | get { return m_regionData; } |
117 | } | 117 | } |
118 | 118 | ||
119 | public new BaseHttpServer HttpServer | 119 | public new BaseHttpServer HttpServer |
120 | { | 120 | { |
121 | get { return m_httpServer; } | 121 | get { return m_httpServer; } |
122 | } | 122 | } |
123 | 123 | ||
124 | public new uint HttpServerPort | 124 | public new uint HttpServerPort |
125 | { | 125 | { |
126 | get { return m_httpServerPort; } | 126 | get { return m_httpServerPort; } |
127 | } | 127 | } |
128 | 128 | ||
129 | protected ModuleLoader m_moduleLoader; | 129 | protected ModuleLoader m_moduleLoader; |
130 | 130 | ||
131 | public ModuleLoader ModuleLoader | 131 | public ModuleLoader ModuleLoader |
@@ -146,10 +146,10 @@ namespace OpenSim | |||
146 | 146 | ||
147 | if (Directory.Exists("addin-db-001")) | 147 | if (Directory.Exists("addin-db-001")) |
148 | Directory.Delete("addin-db-001", true); | 148 | Directory.Delete("addin-db-001", true); |
149 | 149 | ||
150 | 150 | ||
151 | m_log.Info("[OPENSIM MAIN]: PLEASE IGNORE THE SCANNING ERRORS BELOW. These are the result of a temporary problem with our plugins manager."); | 151 | m_log.Info("[OPENSIM MAIN]: PLEASE IGNORE THE SCANNING ERRORS BELOW. These are the result of a temporary problem with our plugins manager."); |
152 | 152 | ||
153 | AddinManager.Initialize("."); | 153 | AddinManager.Initialize("."); |
154 | AddinManager.Registry.Update(null); | 154 | AddinManager.Registry.Update(null); |
155 | 155 | ||
@@ -270,13 +270,13 @@ namespace OpenSim | |||
270 | m_sandbox = !startupConfig.GetBoolean("gridmode", false); | 270 | m_sandbox = !startupConfig.GetBoolean("gridmode", false); |
271 | m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); | 271 | m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); |
272 | m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher"); | 272 | m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher"); |
273 | 273 | ||
274 | m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); | 274 | m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); |
275 | 275 | ||
276 | m_see_into_region_from_neighbor = startupConfig.GetBoolean("see_into_this_sim_from_neighbor", true); | 276 | m_see_into_region_from_neighbor = startupConfig.GetBoolean("see_into_this_sim_from_neighbor", true); |
277 | 277 | ||
278 | m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.Data.SQLite.dll"); | 278 | m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.Data.SQLite.dll"); |
279 | if (m_storageDll == "OpenSim.DataStore.MonoSqlite.dll") | 279 | if (m_storageDll == "OpenSim.DataStore.MonoSqlite.dll") |
280 | { | 280 | { |
281 | m_storageDll = "OpenSim.Data.SQLite.dll"; | 281 | m_storageDll = "OpenSim.Data.SQLite.dll"; |
282 | Console.WriteLine("WARNING: OpenSim.DataStore.MonoSqlite.dll is deprecated. Set storage_plugin to OpenSim.Data.SQLite.dll."); | 282 | Console.WriteLine("WARNING: OpenSim.DataStore.MonoSqlite.dll is deprecated. Set storage_plugin to OpenSim.Data.SQLite.dll."); |
@@ -311,10 +311,10 @@ namespace OpenSim | |||
311 | 311 | ||
312 | m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); | 312 | m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); |
313 | } | 313 | } |
314 | 314 | ||
315 | 315 | ||
316 | m_networkServersInfo.loadFromConfiguration(m_config); | 316 | m_networkServersInfo.loadFromConfiguration(m_config); |
317 | 317 | ||
318 | } | 318 | } |
319 | 319 | ||
320 | private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false); | 320 | private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false); |
@@ -331,19 +331,19 @@ namespace OpenSim | |||
331 | m_log.Info("========================= STARTING OPENSIM ========================="); | 331 | m_log.Info("========================= STARTING OPENSIM ========================="); |
332 | m_log.Info("===================================================================="); | 332 | m_log.Info("===================================================================="); |
333 | m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", m_sandbox ? "sandbox" : "grid"); | 333 | m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", m_sandbox ? "sandbox" : "grid"); |
334 | 334 | ||
335 | InternalStartUp(); | 335 | InternalStartUp(); |
336 | 336 | ||
337 | // We are done with startup | 337 | // We are done with startup |
338 | m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", | 338 | m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", |
339 | m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); | 339 | m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); |
340 | 340 | ||
341 | WorldHasComeToAnEnd.WaitOne(); | 341 | WorldHasComeToAnEnd.WaitOne(); |
342 | m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye."); | 342 | m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye."); |
343 | 343 | ||
344 | Environment.Exit(0); | 344 | Environment.Exit(0); |
345 | } | 345 | } |
346 | 346 | ||
347 | /// <summary> | 347 | /// <summary> |
348 | /// Print the version information available to the library. This include a subversion number if the root | 348 | /// Print the version information available to the library. This include a subversion number if the root |
349 | /// .svn/entries file is present. | 349 | /// .svn/entries file is present. |
@@ -392,9 +392,9 @@ namespace OpenSim | |||
392 | protected void InternalStartUp() | 392 | protected void InternalStartUp() |
393 | { | 393 | { |
394 | printAvailableVersionInformation(); | 394 | printAvailableVersionInformation(); |
395 | 395 | ||
396 | m_stats = StatsManager.StartCollectingSimExtraStats(); | 396 | m_stats = StatsManager.StartCollectingSimExtraStats(); |
397 | 397 | ||
398 | // Do baseclass startup sequence: OpenSim.Region.ClientStack.RegionApplicationBase.StartUp | 398 | // Do baseclass startup sequence: OpenSim.Region.ClientStack.RegionApplicationBase.StartUp |
399 | // TerrainManager, StorageManager, HTTP Server | 399 | // TerrainManager, StorageManager, HTTP Server |
400 | // This base will call abstract Initialize | 400 | // This base will call abstract Initialize |
@@ -425,7 +425,7 @@ namespace OpenSim | |||
425 | 425 | ||
426 | // set up XMLRPC handler for client's initial login request message | 426 | // set up XMLRPC handler for client's initial login request message |
427 | m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); | 427 | m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); |
428 | 428 | ||
429 | // provides the web form login | 429 | // provides the web form login |
430 | m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); | 430 | m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); |
431 | 431 | ||
@@ -524,12 +524,12 @@ namespace OpenSim | |||
524 | regionInfo.originRegionID = regionInfo.RegionID; | 524 | regionInfo.originRegionID = regionInfo.RegionID; |
525 | 525 | ||
526 | // set initial ServerURI | 526 | // set initial ServerURI |
527 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName | 527 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName |
528 | + ":" + regionInfo.InternalEndPoint.Port.ToString(); | 528 | + ":" + regionInfo.InternalEndPoint.Port.ToString(); |
529 | |||
530 | regionInfo.HttpPort = m_httpServerPort; | ||
531 | 529 | ||
532 | if ((proxyUrl.Length > 0) && (portadd_flag)) | 530 | regionInfo.HttpPort = m_httpServerPort; |
531 | |||
532 | if ((proxyUrl.Length > 0) && (portadd_flag)) | ||
533 | { | 533 | { |
534 | // set proxy url to RegionInfo | 534 | // set proxy url to RegionInfo |
535 | regionInfo.proxyUrl = proxyUrl; | 535 | regionInfo.proxyUrl = proxyUrl; |
@@ -574,9 +574,9 @@ namespace OpenSim | |||
574 | scene.SetModuleInterfaces(); | 574 | scene.SetModuleInterfaces(); |
575 | 575 | ||
576 | //moved these here as the terrain texture has to be created after the modules are initialized | 576 | //moved these here as the terrain texture has to be created after the modules are initialized |
577 | // and has to happen before the region is registered with the grid. | 577 | // and has to happen before the region is registered with the grid. |
578 | scene.CreateTerrainTexture(true); | 578 | scene.CreateTerrainTexture(true); |
579 | 579 | ||
580 | try | 580 | try |
581 | { | 581 | { |
582 | scene.RegisterRegionWithGrid(); | 582 | scene.RegisterRegionWithGrid(); |
@@ -584,18 +584,18 @@ namespace OpenSim | |||
584 | catch (Exception e) | 584 | catch (Exception e) |
585 | { | 585 | { |
586 | m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e); | 586 | m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e); |
587 | 587 | ||
588 | // Carrying on now causes a lot of confusion down the line - we need to get the user's attention | 588 | // Carrying on now causes a lot of confusion down the line - we need to get the user's attention |
589 | System.Environment.Exit(1); | 589 | System.Environment.Exit(1); |
590 | } | 590 | } |
591 | 591 | ||
592 | // We need to do this after we've initialized the scripting engines. | 592 | // We need to do this after we've initialized the scripting engines. |
593 | scene.StartScripts(); | 593 | scene.StartScripts(); |
594 | 594 | ||
595 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 595 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
596 | scene.LandChannel.PerformParcelPrimCountUpdate(); | 596 | scene.LandChannel.PerformParcelPrimCountUpdate(); |
597 | 597 | ||
598 | m_sceneManager.Add(scene); | 598 | m_sceneManager.Add(scene); |
599 | 599 | ||
600 | m_clientServers.Add(clientServer); | 600 | m_clientServers.Add(clientServer); |
601 | m_regionData.Add(regionInfo); | 601 | m_regionData.Add(regionInfo); |
@@ -625,7 +625,7 @@ namespace OpenSim | |||
625 | new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, | 625 | new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, |
626 | storageManager, m_httpServer, | 626 | storageManager, m_httpServer, |
627 | m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor, m_config); | 627 | m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor, m_config); |
628 | 628 | ||
629 | } | 629 | } |
630 | 630 | ||
631 | public void handleRestartRegion(RegionInfo whichRegion) | 631 | public void handleRestartRegion(RegionInfo whichRegion) |
@@ -650,7 +650,7 @@ namespace OpenSim | |||
650 | m_clientServers.RemoveAt(clientServerElement); | 650 | m_clientServers.RemoveAt(clientServerElement); |
651 | } | 651 | } |
652 | 652 | ||
653 | //Removing the region from the sim's database of regions.. | 653 | //Removing the region from the sim's database of regions.. |
654 | int RegionHandleElement = -1; | 654 | int RegionHandleElement = -1; |
655 | for (int i = 0; i < m_regionData.Count; i++) | 655 | for (int i = 0; i < m_regionData.Count; i++) |
656 | { | 656 | { |
@@ -676,7 +676,7 @@ namespace OpenSim | |||
676 | 676 | ||
677 | /// <summary> | 677 | /// <summary> |
678 | /// Handler to supply the current status of this sim | 678 | /// Handler to supply the current status of this sim |
679 | /// | 679 | /// |
680 | /// Currently this is always OK if the simulator is still listening for connections on its HTTP service | 680 | /// Currently this is always OK if the simulator is still listening for connections on its HTTP service |
681 | /// </summary> | 681 | /// </summary> |
682 | protected class SimStatusHandler : IStreamedRequestHandler | 682 | protected class SimStatusHandler : IStreamedRequestHandler |
@@ -709,9 +709,9 @@ namespace OpenSim | |||
709 | /// </summary> | 709 | /// </summary> |
710 | public override void Shutdown() | 710 | public override void Shutdown() |
711 | { | 711 | { |
712 | if (proxyUrl.Length > 0) | 712 | if (proxyUrl.Length > 0) |
713 | { | 713 | { |
714 | Util.XmlRpcCommand(proxyUrl, "Stop"); | 714 | Util.XmlRpcCommand(proxyUrl, "Stop"); |
715 | } | 715 | } |
716 | 716 | ||
717 | m_log.Info("[SHUTDOWN]: Closing all threads"); | 717 | m_log.Info("[SHUTDOWN]: Closing all threads"); |
@@ -721,9 +721,9 @@ namespace OpenSim | |||
721 | m_log.Info("[SHUTDOWN]: Closing console and terminating"); | 721 | m_log.Info("[SHUTDOWN]: Closing console and terminating"); |
722 | 722 | ||
723 | m_sceneManager.Close(); | 723 | m_sceneManager.Close(); |
724 | 724 | ||
725 | WorldHasComeToAnEnd.Set(); | 725 | WorldHasComeToAnEnd.Set(); |
726 | 726 | ||
727 | base.Shutdown(); | 727 | base.Shutdown(); |
728 | } | 728 | } |
729 | 729 | ||