aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-08-17 19:48:32 +0100
committerJustin Clark-Casey (justincc)2009-08-17 19:48:32 +0100
commiteb78ac343e68d36a84fdc7fec47797233699cccc (patch)
tree93e29213d4e32167566569186ea88b4c44fe20ae
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-eb78ac343e68d36a84fdc7fec47797233699cccc.zip
opensim-SC-eb78ac343e68d36a84fdc7fec47797233699cccc.tar.gz
opensim-SC-eb78ac343e68d36a84fdc7fec47797233699cccc.tar.bz2
opensim-SC-eb78ac343e68d36a84fdc7fec47797233699cccc.tar.xz
Apply http://opensimulator.org/mantis/view.php?id=3538
Add ability to silence IRC relay of region joins and quits from certain users This is useful for admins who wish to remain hidden, or service bots. Thanks RemedyTomm
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs10
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs12
-rw-r--r--bin/OpenSim.ini.example25
3 files changed, 33 insertions, 14 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
index f03e5fc..b61959f 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
@@ -83,6 +83,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
83 83
84 internal string _accessPassword = String.Empty; 84 internal string _accessPassword = String.Empty;
85 internal Regex AccessPasswordRegex = null; 85 internal Regex AccessPasswordRegex = null;
86 internal List<string> ExcludeList = new List<string>();
86 internal string AccessPassword 87 internal string AccessPassword
87 { 88 {
88 get { return _accessPassword; } 89 get { return _accessPassword; }
@@ -210,8 +211,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
210 m_log.DebugFormat("[IRC-Channel-{0}] PingDelay : <{1}>", cs.idn, cs.PingDelay); 211 m_log.DebugFormat("[IRC-Channel-{0}] PingDelay : <{1}>", cs.idn, cs.PingDelay);
211 cs.AccessPassword = Substitute(rs, config.GetString("access_password", cs.AccessPassword)); 212 cs.AccessPassword = Substitute(rs, config.GetString("access_password", cs.AccessPassword));
212 m_log.DebugFormat("[IRC-Channel-{0}] AccessPassword : <{1}>", cs.idn, cs.AccessPassword); 213 m_log.DebugFormat("[IRC-Channel-{0}] AccessPassword : <{1}>", cs.idn, cs.AccessPassword);
213 214 string[] excludes = config.GetString("exclude_list", "").Trim().Split(new Char[] { ',' });
214 215 cs.ExcludeList = new List<string>(excludes.Length);
216 foreach(string name in excludes)
217 {
218 cs.ExcludeList.Add(name.Trim().ToLower());
219 }
220
215 // Fail if fundamental information is still missing 221 // Fail if fundamental information is still missing
216 222
217 if (cs.Server == null || cs.IrcChannel == null || cs.BaseNickname == null || cs.User == null) 223 if (cs.Server == null || cs.IrcChannel == null || cs.BaseNickname == null || cs.User == null)
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
index 203948e..c49d942 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
@@ -145,7 +145,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
145 if (enabled && (cs.irc.Enabled) && (cs.irc.Connected) && (cs.ClientReporting)) 145 if (enabled && (cs.irc.Enabled) && (cs.irc.Connected) && (cs.ClientReporting))
146 { 146 {
147 m_log.InfoFormat("[IRC-Region {0}]: {1} has left", Region, client.Name); 147 m_log.InfoFormat("[IRC-Region {0}]: {1} has left", Region, client.Name);
148 cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has left", client.Name)); 148 //Check if this person is excluded from IRC
149 if (!cs.ExcludeList.Contains(client.Name.ToLower()))
150 {
151 cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has left", client.Name));
152 }
149 } 153 }
150 client.OnLogout -= OnClientLoggedOut; 154 client.OnLogout -= OnClientLoggedOut;
151 client.OnConnectionClosed -= OnClientLoggedOut; 155 client.OnConnectionClosed -= OnClientLoggedOut;
@@ -209,7 +213,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
209 { 213 {
210 string clientName = String.Format("{0} {1}", presence.Firstname, presence.Lastname); 214 string clientName = String.Format("{0} {1}", presence.Firstname, presence.Lastname);
211 m_log.DebugFormat("[IRC-Region {0}] {1} has arrived", Region, clientName); 215 m_log.DebugFormat("[IRC-Region {0}] {1} has arrived", Region, clientName);
212 cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has arrived", clientName)); 216 //Check if this person is excluded from IRC
217 if (!cs.ExcludeList.Contains(clientName.ToLower()))
218 {
219 cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has arrived", clientName));
220 }
213 } 221 }
214 } 222 }
215 } 223 }
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 166f2c6..9a17c58 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -679,16 +679,21 @@
679 ;relay_chat = true 679 ;relay_chat = true
680 ;access_password = foobar 680 ;access_password = foobar
681 681
682 ;fallback_region = name of "default" region 682 ;;fallback_region = name of "default" region
683 ;MSGformat fields : 0=botnick, 1=user, 2=region, 3=message 683 ;;MSGformat fields : 0=botnick, 1=user, 2=region, 3=message
684 ; must start with "PRIVMSG {0} : " or irc server will get upset 684 ;; must start with "PRIVMSG {0} : " or irc server will get upset
685 ;for <bot>:<user in region> :<message> 685 ;;for <bot>:<user in region> :<message>
686 ;msgformat = "PRIVMSG {0} :<{1} in {2}>: {3}" 686 ;;msgformat = "PRIVMSG {0} :<{1} in {2}>: {3}"
687 ;for <bot>:<message> - <user of region> : 687 ;;for <bot>:<message> - <user of region> :
688 msgformat = "PRIVMSG {0} : {3} - {1} of {2}" 688 ;msgformat = "PRIVMSG {0} : {3} - {1} of {2}"
689 ;for <bot>:<message> - from <user> : 689 ;;for <bot>:<message> - from <user> :
690 ;msgformat = "PRIVMSG {0} : {3} - from {1}" 690 ;;msgformat = "PRIVMSG {0} : {3} - from {1}"
691 691
692 ;; exclude_list allows you to stop the IRC connector from announcing the
693 ;;arrival and departure of certain users. For example: admins, bots.
694
695 ;exclude_list=User 1,User 2,User 3
696
692 697
693;[CMS] 698;[CMS]
694 ;enabled = true 699 ;enabled = true