aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimMain.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSimMain.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs68
1 files changed, 35 insertions, 33 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index b938227..7245482 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -31,21 +31,17 @@ using System.Collections.Generic;
31using System.IO; 31using System.IO;
32using System.Text; 32using System.Text;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework;
34using OpenSim.Framework.Communications.Cache; 35using OpenSim.Framework.Communications.Cache;
35using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
36using OpenSim.Framework.Interfaces;
37using OpenSim.Framework.Servers; 37using OpenSim.Framework.Servers;
38using OpenSim.Framework;
39using OpenSim.Framework;
40using OpenSim.Region.ClientStack; 38using OpenSim.Region.ClientStack;
41using OpenSim.Region.Communications.Local; 39using OpenSim.Region.Communications.Local;
42using OpenSim.Region.Communications.OGS1; 40using OpenSim.Region.Communications.OGS1;
43using OpenSim.Region.Environment; 41using OpenSim.Region.Environment;
42using OpenSim.Region.Environment.Interfaces;
44using OpenSim.Region.Environment.Scenes; 43using OpenSim.Region.Environment.Scenes;
45using OpenSim.Region.Physics.Manager; 44using OpenSim.Region.Physics.Manager;
46using OpenSim.Framework;
47using System.Globalization;
48using RegionInfo = OpenSim.Framework.RegionInfo;
49 45
50namespace OpenSim 46namespace OpenSim
51{ 47{
@@ -114,7 +110,6 @@ namespace OpenSim
114 } 110 }
115 else 111 else
116 { 112 {
117
118 // no default config files, so set default values, and save it 113 // no default config files, so set default values, and save it
119 SetDefaultConfig(); 114 SetDefaultConfig();
120 115
@@ -125,7 +120,6 @@ namespace OpenSim
125 } 120 }
126 121
127 ReadConfigSettings(); 122 ReadConfigSettings();
128
129 } 123 }
130 124
131 protected void SetDefaultConfig() 125 protected void SetDefaultConfig()
@@ -148,7 +142,6 @@ namespace OpenSim
148 config.Set("script_engine", "DotNetEngine"); 142 config.Set("script_engine", "DotNetEngine");
149 143
150 config.Set("asset_database", "sqlite"); 144 config.Set("asset_database", "sqlite");
151
152 } 145 }
153 146
154 if (m_config.Configs["StandAlone"] == null) 147 if (m_config.Configs["StandAlone"] == null)
@@ -217,7 +210,8 @@ namespace OpenSim
217 standaloneConfig.GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll"); 210 standaloneConfig.GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
218 m_standaloneUserPlugin = 211 m_standaloneUserPlugin =
219 standaloneConfig.GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll"); 212 standaloneConfig.GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
220 m_standaloneAssetPlugin = standaloneConfig.GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll"); 213 m_standaloneAssetPlugin =
214 standaloneConfig.GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll");
221 215
222 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); 216 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
223 } 217 }
@@ -230,7 +224,6 @@ namespace OpenSim
230 /// </summary> 224 /// </summary>
231 public override void StartUp() 225 public override void StartUp()
232 { 226 {
233
234 if (!Directory.Exists(Util.logDir())) 227 if (!Directory.Exists(Util.logDir()))
235 { 228 {
236 Directory.CreateDirectory(Util.logDir()); 229 Directory.CreateDirectory(Util.logDir());
@@ -248,22 +241,28 @@ namespace OpenSim
248 LocalInventoryService inventoryService = new LocalInventoryService(); 241 LocalInventoryService inventoryService = new LocalInventoryService();
249 inventoryService.AddPlugin(m_standaloneInventoryPlugin); 242 inventoryService.AddPlugin(m_standaloneInventoryPlugin);
250 243
251 LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); 244 LocalUserServices userService =
245 new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX,
246 m_networkServersInfo.DefaultHomeLocY, inventoryService);
252 userService.AddPlugin(m_standaloneUserPlugin); 247 userService.AddPlugin(m_standaloneUserPlugin);
253 248
254 LocalBackEndServices backendService = new LocalBackEndServices(); 249 LocalBackEndServices backendService = new LocalBackEndServices();
255 250
256 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService, m_dumpAssetsToFile); 251 CommunicationsLocal localComms =
252 new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService,
253 inventoryService, backendService, backendService, m_dumpAssetsToFile);
257 m_commsManager = localComms; 254 m_commsManager = localComms;
258 255
259 m_loginService = new LocalLoginService(userService, m_standaloneWelcomeMessage, localComms, m_networkServersInfo, m_standaloneAuthenticate); 256 m_loginService =
257 new LocalLoginService(userService, m_standaloneWelcomeMessage, localComms, m_networkServersInfo,
258 m_standaloneAuthenticate);
260 m_loginService.OnLoginToRegion += backendService.AddNewSession; 259 m_loginService.OnLoginToRegion += backendService.AddNewSession;
261 260
262 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); 261 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
263 262
264 if (m_standaloneAuthenticate) 263 if (m_standaloneAuthenticate)
265 { 264 {
266 this.CreateAccount = localComms.doCreate; 265 CreateAccount = localComms.doCreate;
267 } 266 }
268 } 267 }
269 else 268 else
@@ -308,7 +307,7 @@ namespace OpenSim
308 // Start UDP servers 307 // Start UDP servers
309 for (int i = 0; i < m_udpServers.Count; i++) 308 for (int i = 0; i < m_udpServers.Count; i++)
310 { 309 {
311 this.m_udpServers[i].ServerListener(); 310 m_udpServers[i].ServerListener();
312 } 311 }
313 312
314 //Run Startup Commands 313 //Run Startup Commands
@@ -321,7 +320,8 @@ namespace OpenSim
321 MainLog.Instance.Verbose("STARTUP", "No startup command script specified. Moving on..."); 320 MainLog.Instance.Verbose("STARTUP", "No startup command script specified. Moving on...");
322 } 321 }
323 322
324 MainLog.Instance.Status("STARTUP", "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)"); 323 MainLog.Instance.Status("STARTUP",
324 "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
325 } 325 }
326 326
327 public UDPServer CreateRegion(RegionInfo regionInfo) 327 public UDPServer CreateRegion(RegionInfo regionInfo)
@@ -365,9 +365,12 @@ namespace OpenSim
365 return new StorageManager(m_storageDLL, regionInfo.DataStore, regionInfo.RegionName); 365 return new StorageManager(m_storageDLL, regionInfo.DataStore, regionInfo.RegionName);
366 } 366 }
367 367
368 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager) 368 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
369 AgentCircuitManager circuitManager)
369 { 370 {
370 return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, m_moduleLoader, m_dumpAssetsToFile); 371 return
372 new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer,
373 m_moduleLoader, m_dumpAssetsToFile);
371 } 374 }
372 375
373 protected override void Initialize() 376 protected override void Initialize()
@@ -436,7 +439,6 @@ namespace OpenSim
436 439
437 protected void ConnectToRemoteGridServer() 440 protected void ConnectToRemoteGridServer()
438 { 441 {
439
440 } 442 }
441 443
442 #endregion 444 #endregion
@@ -464,6 +466,7 @@ namespace OpenSim
464 } 466 }
465 467
466 #region Console Commands 468 #region Console Commands
469
467 /// <summary> 470 /// <summary>
468 /// 471 ///
469 /// </summary> 472 /// </summary>
@@ -649,11 +652,10 @@ namespace OpenSim
649 case "change-region": 652 case "change-region":
650 if (cmdparams.Length > 0) 653 if (cmdparams.Length > 0)
651 { 654 {
652 string regionName = this.CombineParams(cmdparams, 0); 655 string regionName = CombineParams(cmdparams, 0);
653 656
654 if (m_sceneManager.TrySetCurrentScene(regionName)) 657 if (m_sceneManager.TrySetCurrentScene(regionName))
655 { 658 {
656
657 } 659 }
658 else 660 else
659 { 661 {
@@ -663,11 +665,13 @@ namespace OpenSim
663 665
664 if (m_sceneManager.CurrentScene == null) 666 if (m_sceneManager.CurrentScene == null)
665 { 667 {
666 MainLog.Instance.Verbose("Currently at Root level. To change region please use 'change-region <regioname>'"); 668 MainLog.Instance.Verbose(
669 "Currently at Root level. To change region please use 'change-region <regioname>'");
667 } 670 }
668 else 671 else
669 { 672 {
670 MainLog.Instance.Verbose("Current Region: " + m_sceneManager.CurrentScene.RegionInfo.RegionName + ". To change region please use 'change-region <regioname>'"); 673 MainLog.Instance.Verbose("Current Region: " + m_sceneManager.CurrentScene.RegionInfo.RegionName +
674 ". To change region please use 'change-region <regioname>'");
671 } 675 }
672 676
673 break; 677 break;
@@ -676,7 +680,6 @@ namespace OpenSim
676 m_log.Error("Unknown command"); 680 m_log.Error("Unknown command");
677 break; 681 break;
678 } 682 }
679
680 } 683 }
681 684
682 public void Debug(string[] args) 685 public void Debug(string[] args)
@@ -695,8 +698,7 @@ namespace OpenSim
695 { 698 {
696 m_log.Error("packet debug should be 0..2"); 699 m_log.Error("packet debug should be 0..2");
697 } 700 }
698 System.Console.WriteLine("New packet debug: " + newDebug.ToString()); 701 Console.WriteLine("New packet debug: " + newDebug.ToString());
699
700 } 702 }
701 703
702 break; 704 break;
@@ -704,7 +706,6 @@ namespace OpenSim
704 m_log.Error("Unknown debug"); 706 m_log.Error("Unknown debug");
705 break; 707 break;
706 } 708 }
707
708 } 709 }
709 710
710 /// <summary> 711 /// <summary>
@@ -720,7 +721,9 @@ namespace OpenSim
720 m_log.Error("That is " + (DateTime.Now - m_startuptime).ToString()); 721 m_log.Error("That is " + (DateTime.Now - m_startuptime).ToString());
721 break; 722 break;
722 case "users": 723 case "users":
723 m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP", "World")); 724 m_log.Error(
725 String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname",
726 "Agent ID", "Session ID", "Circuit", "IP", "World"));
724 727
725 foreach (ScenePresence presence in m_sceneManager.GetCurrentSceneAvatars()) 728 foreach (ScenePresence presence in m_sceneManager.GetCurrentSceneAvatars())
726 { 729 {
@@ -750,7 +753,7 @@ namespace OpenSim
750 break; 753 break;
751 case "modules": 754 case "modules":
752 m_log.Error("The currently loaded shared modules are:"); 755 m_log.Error("The currently loaded shared modules are:");
753 foreach (OpenSim.Region.Environment.Interfaces.IRegionModule module in m_moduleLoader.GetLoadedSharedModules ) 756 foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)
754 { 757 {
755 m_log.Error("Shared Module: " + module.Name); 758 m_log.Error("Shared Module: " + module.Name);
756 } 759 }
@@ -768,8 +771,7 @@ namespace OpenSim
768 result = result.TrimEnd(' '); 771 result = result.TrimEnd(' ');
769 return result; 772 return result;
770 } 773 }
774
771 #endregion 775 #endregion
772 } 776 }
773 777} \ No newline at end of file
774
775}