aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Base')
-rw-r--r--OpenSim/Server/Base/HttpServerBase.cs41
-rw-r--r--OpenSim/Server/Base/Properties/AssemblyInfo.cs2
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs34
-rw-r--r--OpenSim/Server/Base/ServicesServerBase.cs48
4 files changed, 71 insertions, 54 deletions
diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs
index eed2645..a18cdc1 100644
--- a/OpenSim/Server/Base/HttpServerBase.cs
+++ b/OpenSim/Server/Base/HttpServerBase.cs
@@ -56,15 +56,16 @@ namespace OpenSim.Server.Base
56 56
57 if (networkConfig == null) 57 if (networkConfig == null)
58 { 58 {
59 System.Console.WriteLine("Section 'Network' not found, server can't start"); 59 System.Console.WriteLine("ERROR: Section [Network] not found, server can't start");
60 Thread.CurrentThread.Abort(); 60 Environment.Exit(1);
61 } 61 }
62 62
63 uint port = (uint)networkConfig.GetInt("port", 0); 63 uint port = (uint)networkConfig.GetInt("port", 0);
64 64
65 if (port == 0) 65 if (port == 0)
66 { 66 {
67 Thread.CurrentThread.Abort(); 67 System.Console.WriteLine("ERROR: No 'port' entry found in [Network]. Server can't start");
68 Environment.Exit(1);
68 } 69 }
69 70
70 bool ssl_main = networkConfig.GetBoolean("https_main",false); 71 bool ssl_main = networkConfig.GetBoolean("https_main",false);
@@ -84,23 +85,24 @@ namespace OpenSim.Server.Base
84 // Then, check for https settings and ADD a server to 85 // Then, check for https settings and ADD a server to
85 // m_Servers 86 // m_Servers
86 // 87 //
87 if ( !ssl_main ) 88 if (!ssl_main)
88 { 89 {
89 httpServer = new BaseHttpServer(port); 90 httpServer = new BaseHttpServer(port);
90 } 91 }
91 else 92 else
92 { 93 {
93 string cert_path = networkConfig.GetString("cert_path",String.Empty); 94 string cert_path = networkConfig.GetString("cert_path",String.Empty);
94 if ( cert_path == String.Empty ) 95 if (cert_path == String.Empty)
95 { 96 {
96 System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); 97 System.Console.WriteLine("ERROR: Path to X509 certificate is missing, server can't start.");
97 Thread.CurrentThread.Abort(); 98 Environment.Exit(1);
98 } 99 }
100
99 string cert_pass = networkConfig.GetString("cert_pass",String.Empty); 101 string cert_pass = networkConfig.GetString("cert_pass",String.Empty);
100 if ( cert_pass == String.Empty ) 102 if (cert_pass == String.Empty)
101 { 103 {
102 System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); 104 System.Console.WriteLine("ERROR: Password for X509 certificate is missing, server can't start.");
103 Thread.CurrentThread.Abort(); 105 Environment.Exit(1);
104 } 106 }
105 107
106 httpServer = new BaseHttpServer(port, ssl_main, cert_path, cert_pass); 108 httpServer = new BaseHttpServer(port, ssl_main, cert_path, cert_pass);
@@ -110,10 +112,24 @@ namespace OpenSim.Server.Base
110 MainServer.Instance = httpServer; 112 MainServer.Instance = httpServer;
111 113
112 // If https_listener = true, then add an ssl listener on the https_port... 114 // If https_listener = true, then add an ssl listener on the https_port...
113 if ( ssl_listener == true ) { 115 if (ssl_listener == true)
114 116 {
115 uint https_port = (uint)networkConfig.GetInt("https_port", 0); 117 uint https_port = (uint)networkConfig.GetInt("https_port", 0);
116 118
119<<<<<<< HEAD
120 string cert_path = networkConfig.GetString("cert_path",String.Empty);
121 if (cert_path == String.Empty)
122 {
123 System.Console.WriteLine("ERROR: Path to X509 certificate is missing, server can't start.");
124 Environment.Exit(1);
125 }
126
127 string cert_pass = networkConfig.GetString("cert_pass",String.Empty);
128 if (cert_pass == String.Empty)
129 {
130 System.Console.WriteLine("ERROR: Password for X509 certificate is missing, server can't start.");
131 Environment.Exit(1);
132=======
117 m_log.WarnFormat("[SSL]: External flag is {0}", ssl_external); 133 m_log.WarnFormat("[SSL]: External flag is {0}", ssl_external);
118 if (!ssl_external) 134 if (!ssl_external)
119 { 135 {
@@ -136,6 +152,7 @@ namespace OpenSim.Server.Base
136 { 152 {
137 m_log.WarnFormat("[SSL]: SSL port is active but no SSL is used because external SSL was requested."); 153 m_log.WarnFormat("[SSL]: SSL port is active but no SSL is used because external SSL was requested.");
138 MainServer.AddHttpServer(new BaseHttpServer(https_port)); 154 MainServer.AddHttpServer(new BaseHttpServer(https_port));
155>>>>>>> avn/ubitvar
139 } 156 }
140 } 157 }
141 } 158 }
diff --git a/OpenSim/Server/Base/Properties/AssemblyInfo.cs b/OpenSim/Server/Base/Properties/AssemblyInfo.cs
index 67340c7..e819a2b 100644
--- a/OpenSim/Server/Base/Properties/AssemblyInfo.cs
+++ b/OpenSim/Server/Base/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32[assembly: AssemblyVersion("0.8.0.*")] 32[assembly: AssemblyVersion("0.8.2.*")]
33 33
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 08ba50d..18a4266 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -41,7 +41,7 @@ using OpenSim.Framework.Servers.HttpServer;
41using OpenSim.Framework.Servers; 41using OpenSim.Framework.Servers;
42 42
43 43
44[assembly:AddinRoot("Robust", "0.1")] 44[assembly:AddinRoot("Robust", OpenSim.VersionInfo.VersionNumber)]
45namespace OpenSim.Server.Base 45namespace OpenSim.Server.Base
46{ 46{
47 [TypeExtensionPoint(Path="/Robust/Connector", Name="RobustConnector")] 47 [TypeExtensionPoint(Path="/Robust/Connector", Name="RobustConnector")]
@@ -89,9 +89,9 @@ namespace OpenSim.Server.Base
89 Config = config; 89 Config = config;
90 90
91 Registry = new AddinRegistry(registryPath, "."); 91 Registry = new AddinRegistry(registryPath, ".");
92 suppress_console_output_(true); 92 //suppress_console_output_(true);
93 AddinManager.Initialize(registryPath); 93 AddinManager.Initialize(registryPath);
94 suppress_console_output_(false); 94 //suppress_console_output_(false);
95 AddinManager.Registry.Update(); 95 AddinManager.Registry.Update();
96 CommandManager commandmanager = new CommandManager(Registry); 96 CommandManager commandmanager = new CommandManager(Registry);
97 AddinManager.AddExtensionNodeHandler("/Robust/Connector", OnExtensionChanged); 97 AddinManager.AddExtensionNodeHandler("/Robust/Connector", OnExtensionChanged);
@@ -196,17 +196,19 @@ namespace OpenSim.Server.Base
196 196
197 public static byte[] SerializeResult(XmlSerializer xs, object data) 197 public static byte[] SerializeResult(XmlSerializer xs, object data)
198 { 198 {
199 MemoryStream ms = new MemoryStream(); 199 using (MemoryStream ms = new MemoryStream())
200 XmlTextWriter xw = new XmlTextWriter(ms, Util.UTF8); 200 using (XmlTextWriter xw = new XmlTextWriter(ms, Util.UTF8))
201 xw.Formatting = Formatting.Indented; 201 {
202 xs.Serialize(xw, data); 202 xw.Formatting = Formatting.Indented;
203 xw.Flush(); 203 xs.Serialize(xw, data);
204 xw.Flush();
204 205
205 ms.Seek(0, SeekOrigin.Begin); 206 ms.Seek(0, SeekOrigin.Begin);
206 byte[] ret = ms.GetBuffer(); 207 byte[] ret = ms.GetBuffer();
207 Array.Resize(ref ret, (int)ms.Length); 208 Array.Resize(ref ret, (int)ms.Length);
208 209
209 return ret; 210 return ret;
211 }
210 } 212 }
211 213
212 /// <summary> 214 /// <summary>
@@ -266,7 +268,7 @@ namespace OpenSim.Server.Base
266 && pluginType.ToString() != pluginType.Namespace + "." + className) 268 && pluginType.ToString() != pluginType.Namespace + "." + className)
267 continue; 269 continue;
268 270
269 Type typeInterface = pluginType.GetInterface(interfaceName, true); 271 Type typeInterface = pluginType.GetInterface(interfaceName);
270 272
271 if (typeInterface != null) 273 if (typeInterface != null)
272 { 274 {
@@ -280,11 +282,11 @@ namespace OpenSim.Server.Base
280 { 282 {
281 if (!(e is System.MissingMethodException)) 283 if (!(e is System.MissingMethodException))
282 { 284 {
283 m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}, {3}", 285 m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}",
284 interfaceName, 286 interfaceName,
285 dllName, 287 dllName,
286 e.InnerException == null ? e.Message : e.InnerException.Message, 288 e.InnerException == null ? e.Message : e.InnerException.Message),
287 e.StackTrace); 289 e);
288 } 290 }
289 m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1} args.Length {2}", dllName, e.Message, args.Length); 291 m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1} args.Length {2}", dllName, e.Message, args.Length);
290 return null; 292 return null;
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index 667cef8..1f2c54d 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -49,9 +49,7 @@ namespace OpenSim.Server.Base
49 { 49 {
50 // Logger 50 // Logger
51 // 51 //
52 private static readonly ILog m_log = 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 LogManager.GetLogger(
54 MethodBase.GetCurrentMethod().DeclaringType);
55 53
56 // Command line args 54 // Command line args
57 // 55 //
@@ -72,11 +70,9 @@ namespace OpenSim.Server.Base
72 public ServicesServerBase(string prompt, string[] args) : base() 70 public ServicesServerBase(string prompt, string[] args) : base()
73 { 71 {
74 // Save raw arguments 72 // Save raw arguments
75 //
76 m_Arguments = args; 73 m_Arguments = args;
77 74
78 // Read command line 75 // Read command line
79 //
80 ArgvConfigSource argvConfig = new ArgvConfigSource(args); 76 ArgvConfigSource argvConfig = new ArgvConfigSource(args);
81 77
82 argvConfig.AddSwitch("Startup", "console", "c"); 78 argvConfig.AddSwitch("Startup", "console", "c");
@@ -86,8 +82,9 @@ namespace OpenSim.Server.Base
86 argvConfig.AddSwitch("Startup", "logconfig", "g"); 82 argvConfig.AddSwitch("Startup", "logconfig", "g");
87 83
88 // Automagically create the ini file name 84 // Automagically create the ini file name
89 // 85 string fileName = "";
90 string fileName = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location); 86 if (Assembly.GetEntryAssembly() != null)
87 fileName = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location);
91 string iniFile = fileName + ".ini"; 88 string iniFile = fileName + ".ini";
92 string logConfig = null; 89 string logConfig = null;
93 90
@@ -95,19 +92,17 @@ namespace OpenSim.Server.Base
95 if (startupConfig != null) 92 if (startupConfig != null)
96 { 93 {
97 // Check if a file name was given on the command line 94 // Check if a file name was given on the command line
98 //
99 iniFile = startupConfig.GetString("inifile", iniFile); 95 iniFile = startupConfig.GetString("inifile", iniFile);
100 // 96
101 // Check if a prompt was given on the command line 97 // Check if a prompt was given on the command line
102 prompt = startupConfig.GetString("prompt", prompt); 98 prompt = startupConfig.GetString("prompt", prompt);
103 // 99
104 // Check for a Log4Net config file on the command line 100 // Check for a Log4Net config file on the command line
105 logConfig =startupConfig.GetString("logconfig",logConfig); 101 logConfig =startupConfig.GetString("logconfig", logConfig);
106 } 102 }
107 103
108 // Find out of the file name is a URI and remote load it 104 // Find out of the file name is a URI and remote load it if possible.
109 // if it's possible. Load it as a local file otherwise. 105 // Load it as a local file otherwise.
110 //
111 Uri configUri; 106 Uri configUri;
112 107
113 try 108 try
@@ -129,13 +124,16 @@ namespace OpenSim.Server.Base
129 Environment.Exit(1); 124 Environment.Exit(1);
130 } 125 }
131 126
132 // Merge the configuration from the command line into the 127 // Merge OpSys env vars
133 // loaded file 128 m_log.Info("[CONFIG]: Loading environment variables for Config");
134 // 129 Util.MergeEnvironmentToConfig(Config);
130
131 // Merge the configuration from the command line into the loaded file
135 Config.Merge(argvConfig); 132 Config.Merge(argvConfig);
136 133
134 Config.ReplaceKeyValues();
135
137 // Refresh the startupConfig post merge 136 // Refresh the startupConfig post merge
138 //
139 if (Config.Configs["Startup"] != null) 137 if (Config.Configs["Startup"] != null)
140 { 138 {
141 startupConfig = Config.Configs["Startup"]; 139 startupConfig = Config.Configs["Startup"];
@@ -145,13 +143,10 @@ namespace OpenSim.Server.Base
145 143
146 prompt = startupConfig.GetString("Prompt", prompt); 144 prompt = startupConfig.GetString("Prompt", prompt);
147 145
148 // Allow derived classes to load config before the console is 146 // Allow derived classes to load config before the console is opened.
149 // opened.
150 //
151 ReadConfig(); 147 ReadConfig();
152 148
153 // Create main console 149 // Create main console
154 //
155 string consoleType = "local"; 150 string consoleType = "local";
156 if (startupConfig != null) 151 if (startupConfig != null)
157 consoleType = startupConfig.GetString("console", consoleType); 152 consoleType = startupConfig.GetString("console", consoleType);
@@ -165,9 +160,13 @@ namespace OpenSim.Server.Base
165 MainConsole.Instance = new RemoteConsole(prompt); 160 MainConsole.Instance = new RemoteConsole(prompt);
166 ((RemoteConsole)MainConsole.Instance).ReadConfig(Config); 161 ((RemoteConsole)MainConsole.Instance).ReadConfig(Config);
167 } 162 }
168 else 163 else if (consoleType == "mock")
164 {
165 MainConsole.Instance = new MockConsole();
166 }
167 else if (consoleType == "local")
169 { 168 {
170 MainConsole.Instance = new LocalConsole(prompt); 169 MainConsole.Instance = new LocalConsole(prompt, startupConfig);
171 } 170 }
172 171
173 m_console = MainConsole.Instance; 172 m_console = MainConsole.Instance;
@@ -195,7 +194,6 @@ namespace OpenSim.Server.Base
195 194
196 // Allow derived classes to perform initialization that 195 // Allow derived classes to perform initialization that
197 // needs to be done after the console has opened 196 // needs to be done after the console has opened
198 //
199 Initialise(); 197 Initialise();
200 } 198 }
201 199