From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001
From: onefang
Date: Sun, 19 May 2019 21:24:15 +1000
Subject: Dump OpenSim 0.9.0.1 into it's own branch.
---
OpenSim/Server/Base/CommandManager.cs | 90 +++++------
OpenSim/Server/Base/HttpServerBase.cs | 35 +++--
OpenSim/Server/Base/Properties/AssemblyInfo.cs | 10 +-
OpenSim/Server/Base/ProtocolVersions.cs | 14 +-
OpenSim/Server/Base/ServerUtils.cs | 179 ++++++++++++++--------
OpenSim/Server/Base/ServicesServerBase.cs | 202 +++++++++++++++++++++----
6 files changed, 367 insertions(+), 163 deletions(-)
(limited to 'OpenSim/Server/Base')
diff --git a/OpenSim/Server/Base/CommandManager.cs b/OpenSim/Server/Base/CommandManager.cs
index bd18485..b6e2903 100644
--- a/OpenSim/Server/Base/CommandManager.cs
+++ b/OpenSim/Server/Base/CommandManager.cs
@@ -41,117 +41,117 @@ namespace OpenSim.Server.Base
{
///
/// Command manager -
- /// Wrapper for OpenSim.Framework.PluginManager to allow
+ /// Wrapper for OpenSim.Framework.PluginManager to allow
/// us to add commands to the console to perform operations
/// on our repos and plugins
///
- public class CommandManager
- {
- public AddinRegistry PluginRegistry;
- protected PluginManager PluginManager;
+ public class CommandManager
+ {
+ public AddinRegistry PluginRegistry;
+ protected PluginManager PluginManager;
- public CommandManager(AddinRegistry registry)
+ public CommandManager(AddinRegistry registry)
{
- PluginRegistry = registry;
- PluginManager = new PluginManager(PluginRegistry);
- AddManagementCommands();
- }
-
- private void AddManagementCommands()
- {
- // add plugin
- MainConsole.Instance.Commands.AddCommand("Plugin", true,
+ PluginRegistry = registry;
+ PluginManager = new PluginManager(PluginRegistry);
+ AddManagementCommands();
+ }
+
+ private void AddManagementCommands()
+ {
+ // add plugin
+ MainConsole.Instance.Commands.AddCommand("Plugin", true,
"plugin add", "plugin add \"plugin index\"",
- "Install plugin from repository.",
+ "Install plugin from repository.",
HandleConsoleInstallPlugin);
- // remove plugin
+ // remove plugin
MainConsole.Instance.Commands.AddCommand("Plugin", true,
"plugin remove", "plugin remove \"plugin index\"",
- "Remove plugin from repository",
+ "Remove plugin from repository",
HandleConsoleUnInstallPlugin);
- // list installed plugins
+ // list installed plugins
MainConsole.Instance.Commands.AddCommand("Plugin", true,
- "plugin list installed",
- "plugin list installed","List install plugins",
+ "plugin list installed",
+ "plugin list installed","List install plugins",
HandleConsoleListInstalledPlugin);
- // list plugins available from registered repositories
+ // list plugins available from registered repositories
MainConsole.Instance.Commands.AddCommand("Plugin", true,
"plugin list available",
- "plugin list available","List available plugins",
+ "plugin list available","List available plugins",
HandleConsoleListAvailablePlugin);
- // List available updates
+ // List available updates
MainConsole.Instance.Commands.AddCommand("Plugin", true,
"plugin updates", "plugin updates","List availble updates",
HandleConsoleListUpdates);
- // Update plugin
+ // Update plugin
MainConsole.Instance.Commands.AddCommand("Plugin", true,
"plugin update", "plugin update \"plugin index\"","Update the plugin",
HandleConsoleUpdatePlugin);
- // Add repository
+ // Add repository
MainConsole.Instance.Commands.AddCommand("Repository", true,
"repo add", "repo add \"url\"","Add repository",
HandleConsoleAddRepo);
- // Refresh repo
+ // Refresh repo
MainConsole.Instance.Commands.AddCommand("Repository", true,
"repo refresh", "repo refresh \"url\"", "Sync with a registered repository",
HandleConsoleGetRepo);
- // Remove repository from registry
+ // Remove repository from registry
MainConsole.Instance.Commands.AddCommand("Repository", true,
"repo remove",
- "repo remove \"[url | index]\"",
- "Remove repository from registry",
+ "repo remove \"[url | index]\"",
+ "Remove repository from registry",
HandleConsoleRemoveRepo);
- // Enable repo
+ // Enable repo
MainConsole.Instance.Commands.AddCommand("Repository", true,
"repo enable", "repo enable \"[url | index]\"",
- "Enable registered repository",
+ "Enable registered repository",
HandleConsoleEnableRepo);
- // Disable repo
+ // Disable repo
MainConsole.Instance.Commands.AddCommand("Repository", true,
"repo disable", "repo disable\"[url | index]\"",
- "Disable registered repository",
+ "Disable registered repository",
HandleConsoleDisableRepo);
- // List registered repositories
+ // List registered repositories
MainConsole.Instance.Commands.AddCommand("Repository", true,
"repo list", "repo list",
- "List registered repositories",
+ "List registered repositories",
HandleConsoleListRepos);
- // *
+ // *
MainConsole.Instance.Commands.AddCommand("Plugin", true,
"plugin info", "plugin info \"plugin index\"","Show detailed information for plugin",
HandleConsoleShowAddinInfo);
- // Plugin disable
+ // Plugin disable
MainConsole.Instance.Commands.AddCommand("Plugin", true,
"plugin disable", "plugin disable \"plugin index\"",
- "Disable a plugin",
+ "Disable a plugin",
HandleConsoleDisablePlugin);
- // Enable plugin
+ // Enable plugin
MainConsole.Instance.Commands.AddCommand("Plugin", true,
"plugin enable", "plugin enable \"plugin index\"",
- "Enable the selected plugin plugin",
+ "Enable the selected plugin plugin",
HandleConsoleEnablePlugin);
}
-
+
#region console handlers
// Handle our console commands
//
// Install plugin from registered repository
///
/// Handles the console install plugin command. Attempts to install the selected plugin
- /// and
+ /// and
///
///
/// Module.
@@ -323,7 +323,7 @@ namespace OpenSim.Server.Base
{
if (cmd.Length >= 3)
{
-
+
Dictionary result = new Dictionary();
int ndx = Convert.ToInt16(cmd[2]);
@@ -355,5 +355,5 @@ namespace OpenSim.Server.Base
return;
}
#endregion
- }
+ }
}
\ No newline at end of file
diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs
index 44ef124..3357250 100644
--- a/OpenSim/Server/Base/HttpServerBase.cs
+++ b/OpenSim/Server/Base/HttpServerBase.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Server.Base
{
public class HttpServerBase : ServicesServerBase
{
-// private static readonly ILog m_Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private uint m_consolePort;
@@ -70,6 +70,7 @@ namespace OpenSim.Server.Base
bool ssl_main = networkConfig.GetBoolean("https_main",false);
bool ssl_listener = networkConfig.GetBoolean("https_listener",false);
+ bool ssl_external = networkConfig.GetBoolean("https_external",false);
m_consolePort = (uint)networkConfig.GetInt("ConsolePort", 0);
@@ -111,25 +112,33 @@ namespace OpenSim.Server.Base
MainServer.Instance = httpServer;
// If https_listener = true, then add an ssl listener on the https_port...
- if (ssl_listener == true)
+ if (ssl_listener == true)
{
uint https_port = (uint)networkConfig.GetInt("https_port", 0);
- string cert_path = networkConfig.GetString("cert_path",String.Empty);
- if (cert_path == String.Empty)
+ m_log.WarnFormat("[SSL]: External flag is {0}", ssl_external);
+ if (!ssl_external)
{
- System.Console.WriteLine("ERROR: Path to X509 certificate is missing, server can't start.");
- Environment.Exit(1);
+ string cert_path = networkConfig.GetString("cert_path",String.Empty);
+ if ( cert_path == String.Empty )
+ {
+ System.Console.WriteLine("Path to X509 certificate is missing, server can't start.");
+ Thread.CurrentThread.Abort();
+ }
+ string cert_pass = networkConfig.GetString("cert_pass",String.Empty);
+ if ( cert_pass == String.Empty )
+ {
+ System.Console.WriteLine("Password for X509 certificate is missing, server can't start.");
+ Thread.CurrentThread.Abort();
+ }
+
+ MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass));
}
-
- string cert_pass = networkConfig.GetString("cert_pass",String.Empty);
- if (cert_pass == String.Empty)
+ else
{
- System.Console.WriteLine("ERROR: Password for X509 certificate is missing, server can't start.");
- Environment.Exit(1);
+ m_log.WarnFormat("[SSL]: SSL port is active but no SSL is used because external SSL was requested.");
+ MainServer.AddHttpServer(new BaseHttpServer(https_port));
}
-
- MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass));
}
}
diff --git a/OpenSim/Server/Base/Properties/AssemblyInfo.cs b/OpenSim/Server/Base/Properties/AssemblyInfo.cs
index 3c634a7..4be0f25 100644
--- a/OpenSim/Server/Base/Properties/AssemblyInfo.cs
+++ b/OpenSim/Server/Base/Properties/AssemblyInfo.cs
@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSim.Server.Base")]
@@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -25,9 +25,9 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-[assembly: AssemblyVersion("0.8.3.*")]
+[assembly: AssemblyVersion(OpenSim.VersionInfo.AssemblyVersionNumber)]
diff --git a/OpenSim/Server/Base/ProtocolVersions.cs b/OpenSim/Server/Base/ProtocolVersions.cs
index 5c2278c..27eed4c 100644
--- a/OpenSim/Server/Base/ProtocolVersions.cs
+++ b/OpenSim/Server/Base/ProtocolVersions.cs
@@ -31,20 +31,20 @@ namespace OpenSim.Server.Base
{
///
/// This is the external protocol versions. It is separate from the OpenSimulator project version.
- ///
+ ///
/// These version numbers should be increased by 1 every time a code
- /// change in the Service.Connectors and Server.Handlers, espectively,
+ /// change in the Service.Connectors and Server.Handlers, espectively,
/// makes the previous OpenSimulator revision incompatible
- /// with the new revision.
- ///
+ /// with the new revision.
+ ///
/// Changes which are compatible with an older revision (e.g. older revisions experience degraded functionality
/// but not outright failure) do not need a version number increment.
- ///
+ ///
/// Having this version number allows the grid service to reject connections from regions running a version
- /// of the code that is too old.
+ /// of the code that is too old.
///
///
-
+
// The range of acceptable servers for client-side connectors
public readonly static int ClientProtocolVersionMin = 1;
public readonly static int ClientProtocolVersionMax = 1;
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 18a4266..cc506bc 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -39,7 +39,7 @@ using OpenMetaverse;
using Mono.Addins;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Framework.Servers;
-
+using OpenMetaverse.StructuredData; // LitJson is hidden on this
[assembly:AddinRoot("Robust", OpenSim.VersionInfo.VersionNumber)]
namespace OpenSim.Server.Base
@@ -104,7 +104,7 @@ namespace OpenSim.Server.Base
// libomv, which has a hard-coded path to "." for pinvoke
// to load the openjpeg dll
//
- // Will look for a way to fix, but for now this keeps the
+ // Will look for a way to fix, but for now this keeps the
// confusion to a minimum. this was copied from our region
// plugin loader, we have been doing this in there for a long time.
//
@@ -183,7 +183,7 @@ namespace OpenSim.Server.Base
if(port != 0)
server = MainServer.GetHttpServer(port);
- else
+ else
server = MainServer.Instance;
return server;
@@ -222,19 +222,19 @@ namespace OpenSim.Server.Base
// This is good to debug configuration problems
//if (dllName == string.Empty)
// Util.PrintCallStack();
-
+
string className = String.Empty;
// The path for a dynamic plugin will contain ":" on Windows
string[] parts = dllName.Split (new char[] {':'});
- if (parts [0].Length > 1)
+ if (parts [0].Length > 1)
{
dllName = parts [0];
if (parts.Length > 1)
className = parts[1];
- }
- else
+ }
+ else
{
// This is Windows - we must replace the ":" in the path
dllName = String.Format ("{0}:{1}", parts [0], parts [1]);
@@ -242,6 +242,18 @@ namespace OpenSim.Server.Base
className = parts[2];
}
+ // Handle extra string arguments in a more generic way
+ if (dllName.Contains("@"))
+ {
+ string[] dllNameParts = dllName.Split(new char[] {'@'});
+ dllName = dllNameParts[dllNameParts.Length - 1];
+ List