completing move to refactored multi-channel capable IRCBridgeModule

0.6.0-stable
Dr Scofield 2008-11-03 17:17:57 +00:00
parent 69ae33db1a
commit add42f5e9b
3 changed files with 30 additions and 30 deletions

View File

@ -97,7 +97,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
// IRC connector reference
internal XIRCConnector irc = null;
internal IRCConnector irc = null;
internal int idn = _idk_++;
@ -256,7 +256,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
// values that, while independent of the IRC connetion, do still distinguish
// this region's behavior.
foreach (ChannelState xcs in XIRCBridgeModule.m_channels)
foreach (ChannelState xcs in IRCBridgeModule.m_channels)
{
if (cs.IsAPerfectMatchFor(xcs))
{
@ -279,9 +279,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
m_log.DebugFormat("[IRC-Channel-{0}] New channel required", cs.idn);
if ((cs.irc = new XIRCConnector(cs)) != null)
if ((cs.irc = new IRCConnector(cs)) != null)
{
XIRCBridgeModule.m_channels.Add(cs);
IRCBridgeModule.m_channels.Add(cs);
m_log.InfoFormat("[IRC-Channel-{0}] New channel initialized for {1}, nick: {2}, commands {3}, private channels {4}",
cs.idn, rs.Region, cs.DefaultZone,
@ -554,7 +554,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
// contains information that is not differentiating from an
// IRC point-of-view.
public static void OSChat(XIRCConnector p_irc, OSChatMessage c, bool cmsg)
public static void OSChat(IRCConnector p_irc, OSChatMessage c, bool cmsg)
{
// m_log.DebugFormat("[IRC-OSCHAT] from {0}:{1}", p_irc.Server, p_irc.IrcChannel);
@ -568,7 +568,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
// Note that this code is responsible for completing some of the
// settings for the inbound OSChatMessage
foreach (ChannelState cs in XIRCBridgeModule.m_channels)
foreach (ChannelState cs in IRCBridgeModule.m_channels)
{
if ( p_irc == cs.irc)
{

View File

@ -39,7 +39,7 @@ using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{
public class XIRCBridgeModule : IRegionModule
public class IRCBridgeModule : IRegionModule
{
private static readonly ILog m_log =
@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
public string Name
{
get { return "XIRCBridgeModule"; }
get { return "IRCBridgeModule"; }
}
public bool IsSharedModule
@ -81,19 +81,19 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{
if ((m_config = config.Configs["IRC"]) == null)
{
m_log.InfoFormat("[XIRC-Bridge] module not configured");
m_log.InfoFormat("[IRC-Bridge] module not configured");
return;
}
if (!m_config.GetBoolean("enabled", false))
{
m_log.InfoFormat("[XIRC-Bridge] module disabled in configuration");
m_log.InfoFormat("[IRC-Bridge] module disabled in configuration");
return;
}
}
catch (Exception e)
{
m_log.ErrorFormat("[XIRC-Bridge] configuration failed : {0}", e.Message);
m_log.ErrorFormat("[IRC-Bridge] configuration failed : {0}", e.Message);
return;
}
@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
if (config.Configs["RemoteAdmin"] != null)
{
password = config.Configs["RemoteAdmin"].GetString("access_password", password);
scene.CommsManager.HttpServer.AddXmlRPCHandler("xirc_admin", XmlRpcAdminMethod, false);
scene.CommsManager.HttpServer.AddXmlRPCHandler("irc_admin", XmlRpcAdminMethod, false);
}
}
@ -115,18 +115,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{
try
{
m_log.InfoFormat("[XIRC-Bridge] Connecting region {0}", scene.RegionInfo.RegionName);
m_log.InfoFormat("[IRC-Bridge] Connecting region {0}", scene.RegionInfo.RegionName);
m_regions.Add(new RegionState(scene, m_config));
}
catch (Exception e)
{
m_log.WarnFormat("[XIRC-Bridge] Region {0} not connected to IRC : {1}", scene.RegionInfo.RegionName, e.Message);
m_log.WarnFormat("[IRC-Bridge] Region {0} not connected to IRC : {1}", scene.RegionInfo.RegionName, e.Message);
m_log.Debug(e);
}
}
else
{
m_log.WarnFormat("[XIRC-Bridge] Not enabled. Connect for region {0} ignored", scene.RegionInfo.RegionName);
m_log.WarnFormat("[IRC-Bridge] Not enabled. Connect for region {0} ignored", scene.RegionInfo.RegionName);
}
}
@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
foreach (RegionState region in m_regions)
{
m_log.InfoFormat("[XIRC-Bridge] Opening connection for {0}:{1} on IRC server {2}:{3}",
m_log.InfoFormat("[IRC-Bridge] Opening connection for {0}:{1} on IRC server {2}:{3}",
region.Region, region.cs.BaseNickname, region.cs.Server, region.cs.IrcChannel);
try
{
@ -152,7 +152,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception e)
{
m_log.ErrorFormat("[XIRC-Bridge] Open failed for {0}:{1} on IRC server {2}:{3} : {4}",
m_log.ErrorFormat("[IRC-Bridge] Open failed for {0}:{1} on IRC server {2}:{3} : {4}",
region.Region, region.cs.BaseNickname, region.cs.Server, region.cs.IrcChannel,
e.Message);
}
@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
foreach (RegionState region in m_regions)
{
m_log.InfoFormat("[XIRC-Bridge] Closing connection for {0}:{1} on IRC server {2}:{3}",
m_log.InfoFormat("[IRC-Bridge] Closing connection for {0}:{1} on IRC server {2}:{3}",
region.Region, region.cs.BaseNickname, region.cs.Server, region.cs.IrcChannel);
try
{
@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception e)
{
m_log.ErrorFormat("[XIRC-Bridge] Close failed for {0}:{1} on IRC server {2}:{3} : {4}",
m_log.ErrorFormat("[IRC-Bridge] Close failed for {0}:{1} on IRC server {2}:{3} : {4}",
region.Region, region.cs.BaseNickname, region.cs.Server, region.cs.IrcChannel,
e.Message);
}
@ -191,7 +191,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
foreach (ChannelState channel in m_channels)
{
m_log.InfoFormat("[XIRC-Bridge] Closing connection for {0} on IRC server {1}:{2}",
m_log.InfoFormat("[IRC-Bridge] Closing connection for {0} on IRC server {1}:{2}",
channel.BaseNickname, channel.Server, channel.IrcChannel);
try
{
@ -199,7 +199,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception e)
{
m_log.ErrorFormat("[XIRC-Bridge] Close failed for {0} on IRC server {1}:{2} : {3}",
m_log.ErrorFormat("[IRC-Bridge] Close failed for {0} on IRC server {1}:{2} : {3}",
channel.BaseNickname, channel.Server, channel.IrcChannel,
e.Message);
}
@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
public XmlRpcResponse XmlRpcAdminMethod(XmlRpcRequest request)
{
m_log.Info("[XIRC-Bridge]: XML RPC Admin Entry");
m_log.Info("[IRC-Bridge]: XML RPC Admin Entry");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
@ -258,7 +258,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception e)
{
m_log.InfoFormat("[XIRC-Bridge] XML RPC Admin request failed : {0}", e.Message);
m_log.InfoFormat("[IRC-Bridge] XML RPC Admin request failed : {0}", e.Message);
responseData["success"] = "false";
responseData["error"] = e.Message;
@ -269,7 +269,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
response.Value = responseData;
}
m_log.Debug("[XIRC-Bridge]: XML RPC Admin Exit");
m_log.Debug("[IRC-Bridge]: XML RPC Admin Exit");
return response;

View File

@ -42,7 +42,7 @@ using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{
public class XIRCConnector
public class IRCConnector
{
#region Global (static) state
@ -64,13 +64,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
// List of configured connectors
private static List<XIRCConnector> m_connectors = new List<XIRCConnector>();
private static List<IRCConnector> m_connectors = new List<IRCConnector>();
// Watchdog state
private static System.Timers.Timer m_watchdog = null;
static XIRCConnector()
static IRCConnector()
{
m_log.DebugFormat("[IRC-Connector]: Static initialization started");
m_watchdog = new System.Timers.Timer(WD_INTERVAL);
@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
#region connector instance management
internal XIRCConnector(ChannelState cs)
internal IRCConnector(ChannelState cs)
{
// Prepare network interface
@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
~XIRCConnector()
~IRCConnector()
{
m_watchdog.Stop();
Close();
@ -797,7 +797,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
_pdk_ = (_pdk_+1)%PING_PERIOD; // cycle the ping trigger
_icc_++; // increment the inter-consecutive-connect-delay counter
foreach (XIRCConnector connector in m_connectors)
foreach (IRCConnector connector in m_connectors)
{
if (connector.Enabled)
{