aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/Application.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/Application.cs')
-rw-r--r--OpenSim/Region/Application/Application.cs117
1 files changed, 116 insertions, 1 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 7721cdf..b860cf6 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -105,7 +105,7 @@ namespace OpenSim
105 105
106 // Check if the system is compatible with OpenSimulator. 106 // Check if the system is compatible with OpenSimulator.
107 // Ensures that the minimum system requirements are met 107 // Ensures that the minimum system requirements are met
108 m_log.Info("Performing compatibility checks... "); 108 m_log.Info("Performing compatibility checks... \n");
109 string supported = String.Empty; 109 string supported = String.Empty;
110 if (Util.IsEnvironmentSupported(ref supported)) 110 if (Util.IsEnvironmentSupported(ref supported))
111 { 111 {
@@ -120,6 +120,113 @@ namespace OpenSim
120 Culture.SetCurrentCulture(); 120 Culture.SetCurrentCulture();
121 121
122 122
123 // Validate that the user has the most basic configuration done
124 // If not, offer to do the most basic configuration for them warning them along the way of the importance of
125 // reading these files.
126 /*
127 m_log.Info("Checking for reguired configuration...\n");
128
129 bool OpenSim_Ini = (File.Exists(Path.Combine(Util.configDir(), "OpenSim.ini")))
130 || (File.Exists(Path.Combine(Util.configDir(), "opensim.ini")))
131 || (File.Exists(Path.Combine(Util.configDir(), "openSim.ini")))
132 || (File.Exists(Path.Combine(Util.configDir(), "Opensim.ini")));
133
134 bool StanaloneCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini"));
135 bool StanaloneCommon_lowercased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "standalonecommon.ini"));
136 bool GridCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "GridCommon.ini"));
137 bool GridCommon_lowerCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "gridcommon.ini"));
138
139 if ((OpenSim_Ini)
140 && (
141 (StanaloneCommon_ProperCased
142 || StanaloneCommon_lowercased
143 || GridCommon_ProperCased
144 || GridCommon_lowerCased
145 )))
146 {
147 m_log.Info("Required Configuration Files Found\n");
148 }
149 else
150 {
151 MainConsole.Instance = new LocalConsole("Region");
152 string resp = MainConsole.Instance.CmdPrompt(
153 "\n\n*************Required Configuration files not found.*************\n\n OpenSimulator will not run without these files.\n\nRemember, these file names are Case Sensitive in Linux and Proper Cased.\n1. ./OpenSim.ini\nand\n2. ./config-include/StandaloneCommon.ini \nor\n3. ./config-include/GridCommon.ini\n\nAlso, you will want to examine these files in great detail because only the basic system will load by default. OpenSimulator can do a LOT more if you spend a little time going through these files.\n\n" + ": " + "Do you want to copy the most basic Defaults from standalone?",
154 "yes");
155 if (resp == "yes")
156 {
157
158 if (!(OpenSim_Ini))
159 {
160 try
161 {
162 File.Copy(Path.Combine(Util.configDir(), "OpenSim.ini.example"),
163 Path.Combine(Util.configDir(), "OpenSim.ini"));
164 } catch (UnauthorizedAccessException)
165 {
166 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, Make sure OpenSim has have the required permissions\n");
167 } catch (ArgumentException)
168 {
169 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, The current directory is invalid.\n");
170 } catch (System.IO.PathTooLongException)
171 {
172 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the Path to these files is too long.\n");
173 } catch (System.IO.DirectoryNotFoundException)
174 {
175 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the current directory is reporting as not found.\n");
176 } catch (System.IO.FileNotFoundException)
177 {
178 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
179 } catch (System.IO.IOException)
180 {
181 // Destination file exists already or a hard drive failure... .. so we can just drop this one
182 //MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
183 } catch (System.NotSupportedException)
184 {
185 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, The current directory is invalid.\n");
186 }
187
188 }
189 if (!(StanaloneCommon_ProperCased || StanaloneCommon_lowercased))
190 {
191 try
192 {
193 File.Copy(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini.example"),
194 Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini"));
195 }
196 catch (UnauthorizedAccessException)
197 {
198 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, Make sure OpenSim has the required permissions\n");
199 }
200 catch (ArgumentException)
201 {
202 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, The current directory is invalid.\n");
203 }
204 catch (System.IO.PathTooLongException)
205 {
206 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the Path to these files is too long.\n");
207 }
208 catch (System.IO.DirectoryNotFoundException)
209 {
210 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the current directory is reporting as not found.\n");
211 }
212 catch (System.IO.FileNotFoundException)
213 {
214 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the example is not found, please make sure that the example files exist.\n");
215 }
216 catch (System.IO.IOException)
217 {
218 // Destination file exists already or a hard drive failure... .. so we can just drop this one
219 //MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
220 }
221 catch (System.NotSupportedException)
222 {
223 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, The current directory is invalid.\n");
224 }
225 }
226 }
227 MainConsole.Instance = null;
228 }
229 */
123 configSource.Alias.AddAlias("On", true); 230 configSource.Alias.AddAlias("On", true);
124 configSource.Alias.AddAlias("Off", false); 231 configSource.Alias.AddAlias("Off", false);
125 configSource.Alias.AddAlias("True", true); 232 configSource.Alias.AddAlias("True", true);
@@ -145,6 +252,8 @@ namespace OpenSim
145 // load Crash directory config 252 // load Crash directory config
146 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); 253 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
147 254
255
256
148 if (background) 257 if (background)
149 { 258 {
150 m_sim = new OpenSimBackground(configSource); 259 m_sim = new OpenSimBackground(configSource);
@@ -152,8 +261,14 @@ namespace OpenSim
152 } 261 }
153 else 262 else
154 { 263 {
264
265
266
267
155 m_sim = new OpenSim(configSource); 268 m_sim = new OpenSim(configSource);
156 269
270
271
157 m_sim.Startup(); 272 m_sim.Startup();
158 273
159 while (true) 274 while (true)