Added an optional password for the IRC module
parent
1d8821ccb2
commit
37b63636ee
|
@ -56,6 +56,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||||
// default values (retained for compatability).
|
// default values (retained for compatability).
|
||||||
|
|
||||||
internal string Server = null;
|
internal string Server = null;
|
||||||
|
internal string Password = null;
|
||||||
internal string IrcChannel = null;
|
internal string IrcChannel = null;
|
||||||
internal string BaseNickname = "OSimBot";
|
internal string BaseNickname = "OSimBot";
|
||||||
internal uint Port = 6667;
|
internal uint Port = 6667;
|
||||||
|
@ -118,6 +119,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||||
internal ChannelState(ChannelState model)
|
internal ChannelState(ChannelState model)
|
||||||
{
|
{
|
||||||
Server = model.Server;
|
Server = model.Server;
|
||||||
|
Password = model.Password;
|
||||||
IrcChannel = model.IrcChannel;
|
IrcChannel = model.IrcChannel;
|
||||||
Port = model.Port;
|
Port = model.Port;
|
||||||
BaseNickname = model.BaseNickname;
|
BaseNickname = model.BaseNickname;
|
||||||
|
@ -159,6 +161,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||||
|
|
||||||
cs.Server = Substitute(rs, config.GetString("server", null));
|
cs.Server = Substitute(rs, config.GetString("server", null));
|
||||||
m_log.DebugFormat("[IRC-Channel-{0}] Server : <{1}>", cs.idn, cs.Server);
|
m_log.DebugFormat("[IRC-Channel-{0}] Server : <{1}>", cs.idn, cs.Server);
|
||||||
|
cs.Password = Substitute(rs, config.GetString("password", null));
|
||||||
|
// probably not a good idea to put a password in the log file
|
||||||
cs.IrcChannel = Substitute(rs, config.GetString("channel", null));
|
cs.IrcChannel = Substitute(rs, config.GetString("channel", null));
|
||||||
m_log.DebugFormat("[IRC-Channel-{0}] IrcChannel : <{1}>", cs.idn, cs.IrcChannel);
|
m_log.DebugFormat("[IRC-Channel-{0}] IrcChannel : <{1}>", cs.idn, cs.IrcChannel);
|
||||||
cs.Port = Convert.ToUInt32(Substitute(rs, config.GetString("port", Convert.ToString(cs.Port))));
|
cs.Port = Convert.ToUInt32(Substitute(rs, config.GetString("port", Convert.ToString(cs.Port))));
|
||||||
|
|
|
@ -146,6 +146,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||||
get { return m_server; }
|
get { return m_server; }
|
||||||
set { m_server = value; }
|
set { m_server = value; }
|
||||||
}
|
}
|
||||||
|
private string m_password = null;
|
||||||
|
public string Password
|
||||||
|
{
|
||||||
|
get { return m_password; }
|
||||||
|
set { m_password = value; }
|
||||||
|
}
|
||||||
|
|
||||||
private string m_user = "USER OpenSimBot 8 * :I'm an OpenSim to IRC bot";
|
private string m_user = "USER OpenSimBot 8 * :I'm an OpenSim to IRC bot";
|
||||||
public string User
|
public string User
|
||||||
|
@ -183,6 +189,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||||
// Setup IRC session parameters
|
// Setup IRC session parameters
|
||||||
|
|
||||||
m_server = cs.Server;
|
m_server = cs.Server;
|
||||||
|
m_password = cs.Password;
|
||||||
m_baseNick = cs.BaseNickname;
|
m_baseNick = cs.BaseNickname;
|
||||||
m_randomizeNick = cs.RandomizeNickname;
|
m_randomizeNick = cs.RandomizeNickname;
|
||||||
m_ircChannel = cs.IrcChannel;
|
m_ircChannel = cs.IrcChannel;
|
||||||
|
@ -346,7 +353,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||||
ThreadTracker.Add(m_listener);
|
ThreadTracker.Add(m_listener);
|
||||||
|
|
||||||
// This is the message order recommended by RFC 2812
|
// This is the message order recommended by RFC 2812
|
||||||
|
if (m_password != null)
|
||||||
|
m_writer.WriteLine(String.Format("PASS {0}", m_password));
|
||||||
m_writer.WriteLine(String.Format("NICK {0}", m_nick));
|
m_writer.WriteLine(String.Format("NICK {0}", m_nick));
|
||||||
m_writer.Flush();
|
m_writer.Flush();
|
||||||
m_writer.WriteLine(m_user);
|
m_writer.WriteLine(m_user);
|
||||||
|
|
|
@ -512,6 +512,8 @@ InterregionComms = "RESTComms"
|
||||||
;[IRC]
|
;[IRC]
|
||||||
;enabled = true ; you need to set this otherwise it won't connect
|
;enabled = true ; you need to set this otherwise it won't connect
|
||||||
;server = name.of.irc.server.on.the.net
|
;server = name.of.irc.server.on.the.net
|
||||||
|
;; user password - only use this if the server requires one
|
||||||
|
;password = mypass
|
||||||
;nick = OpenSimBotNameProbablyMakeThisShorter
|
;nick = OpenSimBotNameProbablyMakeThisShorter
|
||||||
;channel = #the_irc_channel_you_want_to_connect_to
|
;channel = #the_irc_channel_you_want_to_connect_to
|
||||||
;port = 6667
|
;port = 6667
|
||||||
|
|
Loading…
Reference in New Issue