From 2da8a7c12818f7944ce2cc2b2cb324439e48daa2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 20 Jul 2007 14:16:12 +0000 Subject: [PATCH] * Fixed an config issue (log not initialized in RegionInfo config) * Added LineInfo stacktrace parser to LogBase (not used yet though) --- OpenSim/Framework/Console/LogBase.cs | 35 +++++++++++++++++++ .../General/Types/NetworkServersInfo.cs | 5 +++ OpenSim/Region/Application/OpenSimMain.cs | 1 + .../ClientStack/RegionApplicationBase.cs | 3 +- OpenSim/Region/Examples/SimpleApp/Program.cs | 5 +++ 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs index 7d38c3a6dc..60c77fe04a 100644 --- a/OpenSim/Framework/Console/LogBase.cs +++ b/OpenSim/Framework/Console/LogBase.cs @@ -28,6 +28,7 @@ using System; using System.IO; using System.Net; +using System.Collections.Generic; namespace OpenSim.Framework.Console { @@ -417,5 +418,39 @@ namespace OpenSim.Framework.Console string[] cmdparams = (string[])tempstrarray; RunCmd(cmd, cmdparams); } + + public string LineInfo + { + get + { + string result = String.Empty; + + string stacktrace = Environment.StackTrace; + List lines = new List(stacktrace.Split(new string[] { "at " }, StringSplitOptions.None)); + + if (lines.Count > 4) + { + lines.RemoveRange(0, 4); + + string tmpLine = lines[0]; + + int inIndex = tmpLine.IndexOf(" in "); + + if (inIndex > -1) + { + result = tmpLine.Substring(0, inIndex); + + int lineIndex = tmpLine.IndexOf(":line "); + + if (lineIndex > -1) + { + lineIndex += 6; + result += ", line " + tmpLine.Substring(lineIndex, (tmpLine.Length - lineIndex) - 5); + } + } + } + return result; + } + } } } diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index 7f21d45f92..c40746bb6b 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs @@ -59,6 +59,11 @@ namespace OpenSim.Framework.Types configMember.performConfigurationRetrieve(); } + public NetworkServersInfo( ) + { + + } + public void loadConfigurationOptions() { diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 3c11b90f07..6b7026c11e 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -151,6 +151,7 @@ namespace OpenSim protected override void Initialize() { + m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", "network_servers_information.xml"); m_httpServerPort = m_networkServersInfo.HttpListenerPort; m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); } diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 8de9bde3c1..4a1fd99b64 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -67,10 +67,9 @@ namespace OpenSim.Region.ClientStack { ClientView.TerrainManager = new TerrainManager(new SecondLife()); - m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", "network_servers_information.xml"); Initialize(); - + ScenePresence.LoadTextureFile("avatar-texture.dat"); m_httpServer = new BaseHttpServer( m_httpServerPort ); diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 82dba0e845..5c16d6b716 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -34,6 +34,9 @@ namespace SimpleApp StartLog(); + m_networkServersInfo = new NetworkServersInfo( ); + + LocalAssetServer assetServer = new LocalAssetServer(); assetServer.SetServerInfo("http://localhost:8003/", ""); @@ -46,6 +49,8 @@ namespace SimpleApp m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer); + m_log.Notice(m_log.LineInfo); + ScenePresence.PhysicsEngineFlying = true; IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000);