From b1849e7fde2c3d0e543c8855fd4a1fd85f23fe30 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Tue, 11 Dec 2012 17:03:42 -0500
Subject: Hide some console output when initializing addin repository
We do this in OpenSim.exe to hide output when unmanaged dll are scanned by mono addins. Libomv has hard-coded path to "." for the openjpeg libraries, causing output to the console when they are scanned. We will cover this up for now, then look at getting libomv to look for the libs outside the "." later.
---
OpenSim/Server/Base/ServerUtils.cs | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
(limited to 'OpenSim/Server')
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 31b0446..d06d612 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -89,12 +89,39 @@ namespace OpenSim.Server.Base
Config = config;
Registry = new AddinRegistry(registryPath, ".");
+ suppress_console_output_(true);
AddinManager.Initialize(registryPath);
+ suppress_console_output_(false);
AddinManager.Registry.Update();
CommandManager commandmanager = new CommandManager(Registry);
AddinManager.AddExtensionNodeHandler("/Robust/Connector", OnExtensionChanged);
}
+ private static TextWriter prev_console_;
+ // Temporarily masking the errors reported on start
+ // This is caused by a non-managed dll in the ./bin dir
+ // when the registry is initialized. The dll belongs to
+ // 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
+ // confusion to a minimum. this was copied from our region
+ // plugin loader, we have been doing this in there for a long time.
+ //
+ public void suppress_console_output_(bool save)
+ {
+ if (save)
+ {
+ prev_console_ = System.Console.Out;
+ System.Console.SetOut(new StreamWriter(Stream.Null));
+ }
+ else
+ {
+ if (prev_console_ != null)
+ System.Console.SetOut(prev_console_);
+ }
+ }
+
private void OnExtensionChanged(object s, ExtensionNodeEventArgs args)
{
IRobustConnector connector = (IRobustConnector)args.ExtensionObject;
--
cgit v1.1
From 5f11b4658ef5a57297c9de89e0dbea4ca497b060 Mon Sep 17 00:00:00 2001
From: BlueWall (James Hughes)
Date: Thu, 13 Dec 2012 13:13:40 -0500
Subject: Fix module pathname handling for Windows
---
OpenSim/Server/Base/ServerUtils.cs | 38 ++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Server')
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index d06d612..d6d3957 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -139,8 +139,7 @@ namespace OpenSim.Server.Base
if (a.AddinFile.Contains(Registry.DefaultAddinsFolder))
{
m_log.InfoFormat("[SERVER]: Adding {0} from registry", a.Name);
- connector.PluginPath = String.Format("{0}/{1}", Registry.DefaultAddinsFolder, a.Name.Replace(',', '.'));
- }
+ connector.PluginPath = System.IO.Path.Combine(Registry.DefaultAddinsFolder,a.Name.Replace(',', '.')); }
else
{
m_log.InfoFormat("[SERVER]: Adding {0} from ./bin", a.Name);
@@ -216,20 +215,27 @@ namespace OpenSim.Server.Base
///
/// The arguments which control which constructor is invoked on the plugin
///
- public static T LoadPlugin(string dllName, Object[] args) where T:class
- {
- // This is good to debug configuration problems
- //if (dllName == string.Empty)
- // Util.PrintCallStack();
-
- string[] parts = dllName.Split(new char[] {':'});
-
- dllName = parts[0];
-
- string className = String.Empty;
-
- if (parts.Length > 1)
- className = parts[1];
+ public static T LoadPlugin (string dllName, Object[] args) where T:class
+ {
+ // 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) {
+ dllName = parts [0];
+ if (parts.Length > 1)
+ className = parts[1];
+ } else {
+ // This is Windows - we must replace the ":" in the path
+ dllName = String.Format ("{0}:{1}", parts [0], parts [1]);
+ if (parts.Length > 2)
+ className = parts[2];
+ }
return LoadPlugin(dllName, className, args);
}
--
cgit v1.1
From 6f002733b1079e8b7bd9ea7a3750348c9bac88ea Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Thu, 13 Dec 2012 13:38:57 -0500
Subject: Fix formatting
---
OpenSim/Server/Base/ServerUtils.cs | 45 ++++++++++++++++++++------------------
1 file changed, 24 insertions(+), 21 deletions(-)
(limited to 'OpenSim/Server')
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index d6d3957..3f208bf 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -139,7 +139,7 @@ namespace OpenSim.Server.Base
if (a.AddinFile.Contains(Registry.DefaultAddinsFolder))
{
m_log.InfoFormat("[SERVER]: Adding {0} from registry", a.Name);
- connector.PluginPath = System.IO.Path.Combine(Registry.DefaultAddinsFolder,a.Name.Replace(',', '.')); }
+ connector.PluginPath = System.IO.Path.Combine(Registry.DefaultAddinsFolder,a.Name.Replace(',', '.')); }
else
{
m_log.InfoFormat("[SERVER]: Adding {0} from ./bin", a.Name);
@@ -216,26 +216,29 @@ namespace OpenSim.Server.Base
/// The arguments which control which constructor is invoked on the plugin
///
public static T LoadPlugin (string dllName, Object[] args) where T:class
- {
- // 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) {
- dllName = parts [0];
- if (parts.Length > 1)
- className = parts[1];
- } else {
- // This is Windows - we must replace the ":" in the path
- dllName = String.Format ("{0}:{1}", parts [0], parts [1]);
- if (parts.Length > 2)
- className = parts[2];
- }
+ {
+ // 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)
+ {
+ dllName = parts [0];
+ if (parts.Length > 1)
+ className = parts[1];
+ }
+ else
+ {
+ // This is Windows - we must replace the ":" in the path
+ dllName = String.Format ("{0}:{1}", parts [0], parts [1]);
+ if (parts.Length > 2)
+ className = parts[2];
+ }
return LoadPlugin(dllName, className, args);
}
--
cgit v1.1