* Fixed an config issue (log not initialized in RegionInfo config)

* Added LineInfo stacktrace parser to LogBase (not used yet though)
afrisby
lbsa71 2007-07-20 14:16:12 +00:00
parent 765ff13f22
commit 2da8a7c128
5 changed files with 47 additions and 2 deletions

View File

@ -28,6 +28,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Collections.Generic;
namespace OpenSim.Framework.Console namespace OpenSim.Framework.Console
{ {
@ -417,5 +418,39 @@ namespace OpenSim.Framework.Console
string[] cmdparams = (string[])tempstrarray; string[] cmdparams = (string[])tempstrarray;
RunCmd(cmd, cmdparams); RunCmd(cmd, cmdparams);
} }
public string LineInfo
{
get
{
string result = String.Empty;
string stacktrace = Environment.StackTrace;
List<string> lines = new List<string>(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;
}
}
} }
} }

View File

@ -59,6 +59,11 @@ namespace OpenSim.Framework.Types
configMember.performConfigurationRetrieve(); configMember.performConfigurationRetrieve();
} }
public NetworkServersInfo( )
{
}
public void loadConfigurationOptions() public void loadConfigurationOptions()
{ {

View File

@ -151,6 +151,7 @@ namespace OpenSim
protected override void Initialize() protected override void Initialize()
{ {
m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", "network_servers_information.xml");
m_httpServerPort = m_networkServersInfo.HttpListenerPort; m_httpServerPort = m_networkServersInfo.HttpListenerPort;
m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
} }

View File

@ -67,7 +67,6 @@ namespace OpenSim.Region.ClientStack
{ {
ClientView.TerrainManager = new TerrainManager(new SecondLife()); ClientView.TerrainManager = new TerrainManager(new SecondLife());
m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", "network_servers_information.xml");
Initialize(); Initialize();

View File

@ -34,6 +34,9 @@ namespace SimpleApp
StartLog(); StartLog();
m_networkServersInfo = new NetworkServersInfo( );
LocalAssetServer assetServer = new LocalAssetServer(); LocalAssetServer assetServer = new LocalAssetServer();
assetServer.SetServerInfo("http://localhost:8003/", ""); assetServer.SetServerInfo("http://localhost:8003/", "");
@ -46,6 +49,8 @@ namespace SimpleApp
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer); m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer);
m_log.Notice(m_log.LineInfo);
ScenePresence.PhysicsEngineFlying = true; ScenePresence.PhysicsEngineFlying = true;
IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000);