diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Chat/ChannelState.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Chat/IRCConnector.cs | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChannelState.cs index 213ae96..8f1ad00 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChannelState.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChannelState.cs | |||
@@ -56,6 +56,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
56 | // default values (retained for compatability). | 56 | // default values (retained for compatability). |
57 | 57 | ||
58 | internal string Server = null; | 58 | internal string Server = null; |
59 | internal string Password = null; | ||
59 | internal string IrcChannel = null; | 60 | internal string IrcChannel = null; |
60 | internal string BaseNickname = "OSimBot"; | 61 | internal string BaseNickname = "OSimBot"; |
61 | internal uint Port = 6667; | 62 | internal uint Port = 6667; |
@@ -118,6 +119,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
118 | internal ChannelState(ChannelState model) | 119 | internal ChannelState(ChannelState model) |
119 | { | 120 | { |
120 | Server = model.Server; | 121 | Server = model.Server; |
122 | Password = model.Password; | ||
121 | IrcChannel = model.IrcChannel; | 123 | IrcChannel = model.IrcChannel; |
122 | Port = model.Port; | 124 | Port = model.Port; |
123 | BaseNickname = model.BaseNickname; | 125 | BaseNickname = model.BaseNickname; |
@@ -159,6 +161,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
159 | 161 | ||
160 | cs.Server = Substitute(rs, config.GetString("server", null)); | 162 | cs.Server = Substitute(rs, config.GetString("server", null)); |
161 | m_log.DebugFormat("[IRC-Channel-{0}] Server : <{1}>", cs.idn, cs.Server); | 163 | m_log.DebugFormat("[IRC-Channel-{0}] Server : <{1}>", cs.idn, cs.Server); |
164 | cs.Password = Substitute(rs, config.GetString("password", null)); | ||
165 | // probably not a good idea to put a password in the log file | ||
162 | cs.IrcChannel = Substitute(rs, config.GetString("channel", null)); | 166 | cs.IrcChannel = Substitute(rs, config.GetString("channel", null)); |
163 | m_log.DebugFormat("[IRC-Channel-{0}] IrcChannel : <{1}>", cs.idn, cs.IrcChannel); | 167 | m_log.DebugFormat("[IRC-Channel-{0}] IrcChannel : <{1}>", cs.idn, cs.IrcChannel); |
164 | cs.Port = Convert.ToUInt32(Substitute(rs, config.GetString("port", Convert.ToString(cs.Port)))); | 168 | cs.Port = Convert.ToUInt32(Substitute(rs, config.GetString("port", Convert.ToString(cs.Port)))); |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCConnector.cs index 1dec9a5..e1c0ac4 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCConnector.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCConnector.cs | |||
@@ -146,6 +146,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
146 | get { return m_server; } | 146 | get { return m_server; } |
147 | set { m_server = value; } | 147 | set { m_server = value; } |
148 | } | 148 | } |
149 | private string m_password = null; | ||
150 | public string Password | ||
151 | { | ||
152 | get { return m_password; } | ||
153 | set { m_password = value; } | ||
154 | } | ||
149 | 155 | ||
150 | private string m_user = "USER OpenSimBot 8 * :I'm an OpenSim to IRC bot"; | 156 | private string m_user = "USER OpenSimBot 8 * :I'm an OpenSim to IRC bot"; |
151 | public string User | 157 | public string User |
@@ -183,6 +189,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
183 | // Setup IRC session parameters | 189 | // Setup IRC session parameters |
184 | 190 | ||
185 | m_server = cs.Server; | 191 | m_server = cs.Server; |
192 | m_password = cs.Password; | ||
186 | m_baseNick = cs.BaseNickname; | 193 | m_baseNick = cs.BaseNickname; |
187 | m_randomizeNick = cs.RandomizeNickname; | 194 | m_randomizeNick = cs.RandomizeNickname; |
188 | m_ircChannel = cs.IrcChannel; | 195 | m_ircChannel = cs.IrcChannel; |
@@ -346,7 +353,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
346 | ThreadTracker.Add(m_listener); | 353 | ThreadTracker.Add(m_listener); |
347 | 354 | ||
348 | // This is the message order recommended by RFC 2812 | 355 | // This is the message order recommended by RFC 2812 |
349 | 356 | if (m_password != null) | |
357 | m_writer.WriteLine(String.Format("PASS {0}", m_password)); | ||
350 | m_writer.WriteLine(String.Format("NICK {0}", m_nick)); | 358 | m_writer.WriteLine(String.Format("NICK {0}", m_nick)); |
351 | m_writer.Flush(); | 359 | m_writer.Flush(); |
352 | m_writer.WriteLine(m_user); | 360 | m_writer.WriteLine(m_user); |