Thank you very much, Kinoc for : Moved the Listener loop try/catch to a better position.

Uses the IRC nick as the default when user location cannot be determined.
ThreadPoolClientBranch
Charles Krinke 2008-02-02 00:47:28 +00:00
parent ea74f97e9b
commit a9b69f3880
1 changed files with 17 additions and 8 deletions

View File

@ -54,6 +54,7 @@ namespace OpenSim.Region.Environment.Modules
private string m_last_new_user = null;
private string m_last_leaving_user = null;
private string m_defaultzone = null;
internal object m_syncInit = new object();
internal object m_syncLogout = new object();
private Thread m_irc_connector=null;
@ -78,6 +79,13 @@ namespace OpenSim.Region.Environment.Modules
catch (Exception)
{
}
try
{
m_defaultzone = config.Configs["IRC"].GetString("nick","Sim");
}
catch (Exception)
{
}
if (!m_scenes.Contains(scene))
{
@ -302,7 +310,8 @@ namespace OpenSim.Region.Environment.Modules
});
if (sourceRegion != null) return sourceRegion;
}
return "Sim";
if (m_defaultzone == null) { m_defaultzone = "Sim"; }
return m_defaultzone;
}
}
@ -515,7 +524,7 @@ namespace OpenSim.Region.Environment.Modules
}
catch (Exception ex)
{
m_log.Error("IRC", "PingRun exception trap:" + ex.ToString());
m_log.Error("IRC", "PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace);
}
}
}
@ -525,10 +534,10 @@ namespace OpenSim.Region.Environment.Modules
string inputLine;
LLVector3 pos = new LLVector3(128, 128, 20);
while (true)
{
while ((m_connected == true) && ((inputLine = m_reader.ReadLine()) != null))
{
try
{
while ((m_connected == true) && ((inputLine = m_reader.ReadLine()) != null))
{
// Console.WriteLine(inputLine);
if (inputLine.Contains(m_channel))
@ -566,6 +575,7 @@ namespace OpenSim.Region.Environment.Modules
}
Thread.Sleep(150);
}
}
catch (IOException)
{
m_log.Error("IRC", "ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)");
@ -573,8 +583,7 @@ namespace OpenSim.Region.Environment.Modules
}
catch (Exception ex)
{
m_log.Error("IRC", "ListenerRun exception trap:" + ex.ToString());
}
m_log.Error("IRC", "ListenerRun exception trap:" + ex.ToString()+"\n"+ex.StackTrace);
}
}
}
@ -600,7 +609,7 @@ namespace OpenSim.Region.Environment.Modules
}
catch (Exception ex) // IRC gate should not crash Sim
{
m_log.Error("IRC", "BroadcastSim Exception Trap:" + ex.ToString());
m_log.Error("IRC", "BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace);
}