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.cs61
1 files changed, 30 insertions, 31 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 8e3f558..b052178 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -60,8 +60,8 @@ namespace OpenSim
60 public bool m_sandbox; 60 public bool m_sandbox;
61 public bool user_accounts; 61 public bool user_accounts;
62 public bool m_gridLocalAsset; 62 public bool m_gridLocalAsset;
63 protected bool m_useConfigFile; 63
64 public string m_configFileName; 64 protected string m_storageDLL = "OpenSim.DataStore.NullStorage.dll";
65 65
66 protected List<UDPServer> m_udpServers = new List<UDPServer>(); 66 protected List<UDPServer> m_udpServers = new List<UDPServer>();
67 protected List<RegionInfo> m_regionData = new List<RegionInfo>(); 67 protected List<RegionInfo> m_regionData = new List<RegionInfo>();
@@ -74,31 +74,30 @@ namespace OpenSim
74 : base() 74 : base()
75 { 75 {
76 IConfigSource startupSource = configSource; 76 IConfigSource startupSource = configSource;
77 string iniFile = startupSource.Configs["Startup"].GetString("inifile", "NA"); 77 string iniFile = startupSource.Configs["Startup"].GetString("inifile", "OpenSim.ini");
78 if (iniFile != "NA") 78
79 //check for .INI file (either default or name passed in command line)
80 string iniFilePath = Path.Combine(Util.configDir(), iniFile);
81 if (File.Exists(iniFilePath))
79 { 82 {
80 //a INI file is set to be used for startup settings 83 startupSource = new IniConfigSource(iniFilePath);
81 string iniFilePath = Path.Combine(Util.configDir(), iniFile); 84
82 if (File.Exists(iniFilePath)) 85 //enable following line, if we want the original config source(normally commandline args) merged with ini file settings.
83 { 86 //in this case we have it so that if both sources have the same named setting, the command line value will overwrite the ini file value.
84 startupSource = new IniConfigSource(iniFilePath); 87 //(as if someone has bothered to enter a command line arg, we should take notice of it)
85 88 startupSource.Merge(configSource);
86 //enable following line, if we want the original config source(normally commandline args) merged with ini file settings.
87 //in this case we have it so that if both sources have the same named setting, the command line value will overwrite the ini file value.
88 //(as if someone has bothered to enter a command line arg, we should take notice of it)
89 //startupSource.Merge(configSource);
90 }
91 } 89 }
90
92 ReadConfigSettings(startupSource); 91 ReadConfigSettings(startupSource);
93 } 92 }
94 93
95 protected void ReadConfigSettings(IConfigSource configSource) 94 protected void ReadConfigSettings(IConfigSource configSource)
96 { 95 {
97 m_useConfigFile = configSource.Configs["Startup"].GetBoolean("configfile", false);
98 m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false); 96 m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false);
99 m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics"); 97 m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics");
100 m_configFileName = configSource.Configs["Startup"].GetString("config", "simconfig.xml");
101 m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false); 98 m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false);
99
100 m_storageDLL = configSource.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
102 } 101 }
103 102
104 /// <summary> 103 /// <summary>
@@ -110,7 +109,7 @@ namespace OpenSim
110 { 109 {
111 Directory.CreateDirectory(Util.logDir()); 110 Directory.CreateDirectory(Util.logDir());
112 } 111 }
113 112
114 m_log = new LogBase(Path.Combine(Util.logDir(), m_logFilename), "Region", this, m_silent); 113 m_log = new LogBase(Path.Combine(Util.logDir(), m_logFilename), "Region", this, m_silent);
115 MainLog.Instance = m_log; 114 MainLog.Instance = m_log;
116 115
@@ -131,12 +130,12 @@ namespace OpenSim
131 } 130 }
132 131
133 string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); 132 string regionConfigPath = Path.Combine(Util.configDir(), "Regions");
134 133
135 if (!Directory.Exists(regionConfigPath)) 134 if (!Directory.Exists(regionConfigPath))
136 { 135 {
137 Directory.CreateDirectory(regionConfigPath); 136 Directory.CreateDirectory(regionConfigPath);
138 } 137 }
139 138
140 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 139 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
141 140
142 if (configFiles.Length == 0) 141 if (configFiles.Length == 0)
@@ -175,7 +174,7 @@ namespace OpenSim
175 174
176 protected override StorageManager CreateStorageManager(RegionInfo regionInfo) 175 protected override StorageManager CreateStorageManager(RegionInfo regionInfo)
177 { 176 {
178 return new StorageManager("OpenSim.DataStore.NullStorage.dll", regionInfo.DataStore, regionInfo.RegionName); 177 return new StorageManager(m_storageDLL, regionInfo.DataStore, regionInfo.RegionName);
179 } 178 }
180 179
181 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager) 180 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager)
@@ -287,7 +286,7 @@ namespace OpenSim
287 286
288 case "terrain": 287 case "terrain":
289 string result = ""; 288 string result = "";
290 foreach(Scene scene in m_localScenes) 289 foreach (Scene scene in m_localScenes)
291 { 290 {
292 if (!scene.Terrain.RunTerrainCmd(cmdparams, ref result, scene.RegionInfo.RegionName)) 291 if (!scene.Terrain.RunTerrainCmd(cmdparams, ref result, scene.RegionInfo.RegionName))
293 { 292 {
@@ -296,21 +295,21 @@ namespace OpenSim
296 } 295 }
297 break; 296 break;
298 case "script": 297 case "script":
299 foreach(Scene scene in m_localScenes ) 298 foreach (Scene scene in m_localScenes)
300 { 299 {
301 scene.SendCommandToScripts(cmdparams); 300 scene.SendCommandToScripts(cmdparams);
302 } 301 }
303 break; 302 break;
304 303
305 case "backup": 304 case "backup":
306 foreach(Scene scene in m_localScenes ) 305 foreach (Scene scene in m_localScenes)
307 { 306 {
308 scene.Backup(); 307 scene.Backup();
309 } 308 }
310 break; 309 break;
311 310
312 case "alert": 311 case "alert":
313 foreach(Scene scene in m_localScenes) 312 foreach (Scene scene in m_localScenes)
314 { 313 {
315 scene.HandleAlertCommand(cmdparams); 314 scene.HandleAlertCommand(cmdparams);
316 } 315 }
@@ -344,19 +343,19 @@ namespace OpenSim
344 for (int i = 0; i < m_localScenes.Count; i++) 343 for (int i = 0; i < m_localScenes.Count; i++)
345 { 344 {
346 Scene scene = m_localScenes[i]; 345 Scene scene = m_localScenes[i];
347 foreach (Entity entity in scene.Entities.Values ) 346 foreach (Entity entity in scene.Entities.Values)
348 { 347 {
349 if ( entity is ScenePresence ) 348 if (entity is ScenePresence)
350 { 349 {
351 ScenePresence scenePrescence = entity as ScenePresence; 350 ScenePresence scenePrescence = entity as ScenePresence;
352 m_log.Error( 351 m_log.Error(
353 String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", 352 String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}",
354 scenePrescence.Firstname, 353 scenePrescence.Firstname,
355 scenePrescence.Lastname, 354 scenePrescence.Lastname,
356 scenePrescence.UUID, 355 scenePrescence.UUID,
357 scenePrescence.ControllingClient.AgentId, 356 scenePrescence.ControllingClient.AgentId,
358 "Unknown", 357 "Unknown",
359 "Unknown", 358 "Unknown",
360 scene.RegionInfo.RegionName)); 359 scene.RegionInfo.RegionName));
361 } 360 }
362 } 361 }