aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/ChannelState.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/IRCConnector.cs10
-rw-r--r--bin/OpenSim.ini.example2
3 files changed, 15 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);
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 05680ab..f202e18 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -512,6 +512,8 @@ InterregionComms = "RESTComms"
512;[IRC] 512;[IRC]
513 ;enabled = true ; you need to set this otherwise it won't connect 513 ;enabled = true ; you need to set this otherwise it won't connect
514 ;server = name.of.irc.server.on.the.net 514 ;server = name.of.irc.server.on.the.net
515 ;; user password - only use this if the server requires one
516 ;password = mypass
515 ;nick = OpenSimBotNameProbablyMakeThisShorter 517 ;nick = OpenSimBotNameProbablyMakeThisShorter
516 ;channel = #the_irc_channel_you_want_to_connect_to 518 ;channel = #the_irc_channel_you_want_to_connect_to
517 ;port = 6667 519 ;port = 6667