aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base/ServerUtils.cs
diff options
context:
space:
mode:
authorBlueWall2012-12-11 17:03:42 -0500
committerBlueWall2012-12-11 17:03:42 -0500
commitb1849e7fde2c3d0e543c8855fd4a1fd85f23fe30 (patch)
tree80970225b78b8c605c29112e004a989af2185172 /OpenSim/Server/Base/ServerUtils.cs
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-b1849e7fde2c3d0e543c8855fd4a1fd85f23fe30.zip
opensim-SC_OLD-b1849e7fde2c3d0e543c8855fd4a1fd85f23fe30.tar.gz
opensim-SC_OLD-b1849e7fde2c3d0e543c8855fd4a1fd85f23fe30.tar.bz2
opensim-SC_OLD-b1849e7fde2c3d0e543c8855fd4a1fd85f23fe30.tar.xz
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.
Diffstat (limited to 'OpenSim/Server/Base/ServerUtils.cs')
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs27
1 files changed, 27 insertions, 0 deletions
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
89 Config = config; 89 Config = config;
90 90
91 Registry = new AddinRegistry(registryPath, "."); 91 Registry = new AddinRegistry(registryPath, ".");
92 suppress_console_output_(true);
92 AddinManager.Initialize(registryPath); 93 AddinManager.Initialize(registryPath);
94 suppress_console_output_(false);
93 AddinManager.Registry.Update(); 95 AddinManager.Registry.Update();
94 CommandManager commandmanager = new CommandManager(Registry); 96 CommandManager commandmanager = new CommandManager(Registry);
95 AddinManager.AddExtensionNodeHandler("/Robust/Connector", OnExtensionChanged); 97 AddinManager.AddExtensionNodeHandler("/Robust/Connector", OnExtensionChanged);
96 } 98 }
97 99
100 private static TextWriter prev_console_;
101 // Temporarily masking the errors reported on start
102 // This is caused by a non-managed dll in the ./bin dir
103 // when the registry is initialized. The dll belongs to
104 // libomv, which has a hard-coded path to "." for pinvoke
105 // to load the openjpeg dll
106 //
107 // Will look for a way to fix, but for now this keeps the
108 // confusion to a minimum. this was copied from our region
109 // plugin loader, we have been doing this in there for a long time.
110 //
111 public void suppress_console_output_(bool save)
112 {
113 if (save)
114 {
115 prev_console_ = System.Console.Out;
116 System.Console.SetOut(new StreamWriter(Stream.Null));
117 }
118 else
119 {
120 if (prev_console_ != null)
121 System.Console.SetOut(prev_console_);
122 }
123 }
124
98 private void OnExtensionChanged(object s, ExtensionNodeEventArgs args) 125 private void OnExtensionChanged(object s, ExtensionNodeEventArgs args)
99 { 126 {
100 IRobustConnector connector = (IRobustConnector)args.ExtensionObject; 127 IRobustConnector connector = (IRobustConnector)args.ExtensionObject;