diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs index 66265d8..5a37fad 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs | |||
@@ -55,42 +55,42 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
55 | // These are the IRC Connector configurable parameters with hard-wired | 55 | // These are the IRC Connector configurable parameters with hard-wired |
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 Password = null; |
60 | internal string IrcChannel = null; | 60 | internal string IrcChannel = null; |
61 | internal string BaseNickname = "OSimBot"; | 61 | internal string BaseNickname = "OSimBot"; |
62 | internal uint Port = 6667; | 62 | internal uint Port = 6667; |
63 | internal string User = null; | 63 | internal string User = null; |
64 | 64 | ||
65 | internal bool ClientReporting = true; | 65 | internal bool ClientReporting = true; |
66 | internal bool RelayChat = true; | 66 | internal bool RelayChat = true; |
67 | internal bool RelayPrivateChannels = false; | 67 | internal bool RelayPrivateChannels = false; |
68 | internal int RelayChannel = 1; | 68 | internal int RelayChannel = 1; |
69 | internal List<int> ValidInWorldChannels = new List<int>(); | 69 | internal List<int> ValidInWorldChannels = new List<int>(); |
70 | 70 | ||
71 | // Connector agnostic parameters. These values are NOT shared with the | 71 | // Connector agnostic parameters. These values are NOT shared with the |
72 | // connector and do not differentiate at an IRC level | 72 | // connector and do not differentiate at an IRC level |
73 | 73 | ||
74 | internal string PrivateMessageFormat = "PRIVMSG {0} :<{2}> {1} {3}"; | 74 | internal string PrivateMessageFormat = "PRIVMSG {0} :<{2}> {1} {3}"; |
75 | internal string NoticeMessageFormat = "PRIVMSG {0} :<{2}> {3}"; | 75 | internal string NoticeMessageFormat = "PRIVMSG {0} :<{2}> {3}"; |
76 | internal int RelayChannelOut = -1; | 76 | internal int RelayChannelOut = -1; |
77 | internal bool RandomizeNickname = true; | 77 | internal bool RandomizeNickname = true; |
78 | internal bool CommandsEnabled = false; | 78 | internal bool CommandsEnabled = false; |
79 | internal int CommandChannel = -1; | 79 | internal int CommandChannel = -1; |
80 | internal int ConnectDelay = 10; | 80 | internal int ConnectDelay = 10; |
81 | internal int PingDelay = 15; | 81 | internal int PingDelay = 15; |
82 | internal string DefaultZone = "Sim"; | 82 | internal string DefaultZone = "Sim"; |
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 List<string> ExcludeList = new List<string>(); |
87 | internal string AccessPassword | 87 | internal string AccessPassword |
88 | { | 88 | { |
89 | get { return _accessPassword; } | 89 | get { return _accessPassword; } |
90 | set | 90 | set |
91 | { | 91 | { |
92 | _accessPassword = value; | 92 | _accessPassword = value; |
93 | AccessPasswordRegex = new Regex(String.Format(@"^{0},\s*(?<avatar>[^,]+),\s*(?<message>.+)$", _accessPassword), | 93 | AccessPasswordRegex = new Regex(String.Format(@"^{0},\s*(?<avatar>[^,]+),\s*(?<message>.+)$", _accessPassword), |
94 | RegexOptions.Compiled); | 94 | RegexOptions.Compiled); |
95 | } | 95 | } |
96 | } | 96 | } |
@@ -99,9 +99,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
99 | 99 | ||
100 | // IRC connector reference | 100 | // IRC connector reference |
101 | 101 | ||
102 | internal IRCConnector irc = null; | 102 | internal IRCConnector irc = null; |
103 | 103 | ||
104 | internal int idn = _idk_++; | 104 | internal int idn = _idk_++; |
105 | 105 | ||
106 | // List of regions dependent upon this connection | 106 | // List of regions dependent upon this connection |
107 | 107 | ||
@@ -119,29 +119,29 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
119 | 119 | ||
120 | internal ChannelState(ChannelState model) | 120 | internal ChannelState(ChannelState model) |
121 | { | 121 | { |
122 | Server = model.Server; | 122 | Server = model.Server; |
123 | Password = model.Password; | 123 | Password = model.Password; |
124 | IrcChannel = model.IrcChannel; | 124 | IrcChannel = model.IrcChannel; |
125 | Port = model.Port; | 125 | Port = model.Port; |
126 | BaseNickname = model.BaseNickname; | 126 | BaseNickname = model.BaseNickname; |
127 | RandomizeNickname = model.RandomizeNickname; | 127 | RandomizeNickname = model.RandomizeNickname; |
128 | User = model.User; | 128 | User = model.User; |
129 | CommandsEnabled = model.CommandsEnabled; | 129 | CommandsEnabled = model.CommandsEnabled; |
130 | CommandChannel = model.CommandChannel; | 130 | CommandChannel = model.CommandChannel; |
131 | RelayChat = model.RelayChat; | 131 | RelayChat = model.RelayChat; |
132 | RelayPrivateChannels = model.RelayPrivateChannels; | 132 | RelayPrivateChannels = model.RelayPrivateChannels; |
133 | RelayChannelOut = model.RelayChannelOut; | 133 | RelayChannelOut = model.RelayChannelOut; |
134 | RelayChannel = model.RelayChannel; | 134 | RelayChannel = model.RelayChannel; |
135 | ValidInWorldChannels = model.ValidInWorldChannels; | 135 | ValidInWorldChannels = model.ValidInWorldChannels; |
136 | PrivateMessageFormat = model.PrivateMessageFormat; | 136 | PrivateMessageFormat = model.PrivateMessageFormat; |
137 | NoticeMessageFormat = model.NoticeMessageFormat; | 137 | NoticeMessageFormat = model.NoticeMessageFormat; |
138 | ClientReporting = model.ClientReporting; | 138 | ClientReporting = model.ClientReporting; |
139 | AccessPassword = model.AccessPassword; | 139 | AccessPassword = model.AccessPassword; |
140 | DefaultZone = model.DefaultZone; | 140 | DefaultZone = model.DefaultZone; |
141 | ConnectDelay = model.ConnectDelay; | 141 | ConnectDelay = model.ConnectDelay; |
142 | PingDelay = model.PingDelay; | 142 | PingDelay = model.PingDelay; |
143 | } | 143 | } |
144 | 144 | ||
145 | // Read the configuration file, performing variable substitution and any | 145 | // Read the configuration file, performing variable substitution and any |
146 | // necessary aliasing. See accompanying documentation for how this works. | 146 | // necessary aliasing. See accompanying documentation for how this works. |
147 | // If you don't need variables, then this works exactly as before. | 147 | // If you don't need variables, then this works exactly as before. |
@@ -160,54 +160,54 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
160 | 160 | ||
161 | m_log.DebugFormat("[IRC-Channel-{0}] Initial request by Region {1} to connect to IRC", cs.idn, rs.Region); | 161 | m_log.DebugFormat("[IRC-Channel-{0}] Initial request by Region {1} to connect to IRC", cs.idn, rs.Region); |
162 | 162 | ||
163 | cs.Server = Substitute(rs, config.GetString("server", null)); | 163 | cs.Server = Substitute(rs, config.GetString("server", null)); |
164 | m_log.DebugFormat("[IRC-Channel-{0}] Server : <{1}>", cs.idn, cs.Server); | 164 | m_log.DebugFormat("[IRC-Channel-{0}] Server : <{1}>", cs.idn, cs.Server); |
165 | cs.Password = Substitute(rs, config.GetString("password", null)); | 165 | cs.Password = Substitute(rs, config.GetString("password", null)); |
166 | // probably not a good idea to put a password in the log file | 166 | // probably not a good idea to put a password in the log file |
167 | cs.User = Substitute(rs, config.GetString("user", null)); | 167 | cs.User = Substitute(rs, config.GetString("user", null)); |
168 | cs.IrcChannel = Substitute(rs, config.GetString("channel", null)); | 168 | cs.IrcChannel = Substitute(rs, config.GetString("channel", null)); |
169 | m_log.DebugFormat("[IRC-Channel-{0}] IrcChannel : <{1}>", cs.idn, cs.IrcChannel); | 169 | m_log.DebugFormat("[IRC-Channel-{0}] IrcChannel : <{1}>", cs.idn, cs.IrcChannel); |
170 | cs.Port = Convert.ToUInt32(Substitute(rs, config.GetString("port", Convert.ToString(cs.Port)))); | 170 | cs.Port = Convert.ToUInt32(Substitute(rs, config.GetString("port", Convert.ToString(cs.Port)))); |
171 | m_log.DebugFormat("[IRC-Channel-{0}] Port : <{1}>", cs.idn, cs.Port); | 171 | m_log.DebugFormat("[IRC-Channel-{0}] Port : <{1}>", cs.idn, cs.Port); |
172 | cs.BaseNickname = Substitute(rs, config.GetString("nick", cs.BaseNickname)); | 172 | cs.BaseNickname = Substitute(rs, config.GetString("nick", cs.BaseNickname)); |
173 | m_log.DebugFormat("[IRC-Channel-{0}] BaseNickname : <{1}>", cs.idn, cs.BaseNickname); | 173 | m_log.DebugFormat("[IRC-Channel-{0}] BaseNickname : <{1}>", cs.idn, cs.BaseNickname); |
174 | cs.RandomizeNickname = Convert.ToBoolean(Substitute(rs, config.GetString("randomize_nick", Convert.ToString(cs.RandomizeNickname)))); | 174 | cs.RandomizeNickname = Convert.ToBoolean(Substitute(rs, config.GetString("randomize_nick", Convert.ToString(cs.RandomizeNickname)))); |
175 | m_log.DebugFormat("[IRC-Channel-{0}] RandomizeNickname : <{1}>", cs.idn, cs.RandomizeNickname); | 175 | m_log.DebugFormat("[IRC-Channel-{0}] RandomizeNickname : <{1}>", cs.idn, cs.RandomizeNickname); |
176 | cs.RandomizeNickname = Convert.ToBoolean(Substitute(rs, config.GetString("nicknum", Convert.ToString(cs.RandomizeNickname)))); | 176 | cs.RandomizeNickname = Convert.ToBoolean(Substitute(rs, config.GetString("nicknum", Convert.ToString(cs.RandomizeNickname)))); |
177 | m_log.DebugFormat("[IRC-Channel-{0}] RandomizeNickname : <{1}>", cs.idn, cs.RandomizeNickname); | 177 | m_log.DebugFormat("[IRC-Channel-{0}] RandomizeNickname : <{1}>", cs.idn, cs.RandomizeNickname); |
178 | cs.User = Substitute(rs, config.GetString("username", cs.User)); | 178 | cs.User = Substitute(rs, config.GetString("username", cs.User)); |
179 | m_log.DebugFormat("[IRC-Channel-{0}] User : <{1}>", cs.idn, cs.User); | 179 | m_log.DebugFormat("[IRC-Channel-{0}] User : <{1}>", cs.idn, cs.User); |
180 | cs.CommandsEnabled = Convert.ToBoolean(Substitute(rs, config.GetString("commands_enabled", Convert.ToString(cs.CommandsEnabled)))); | 180 | cs.CommandsEnabled = Convert.ToBoolean(Substitute(rs, config.GetString("commands_enabled", Convert.ToString(cs.CommandsEnabled)))); |
181 | m_log.DebugFormat("[IRC-Channel-{0}] CommandsEnabled : <{1}>", cs.idn, cs.CommandsEnabled); | 181 | m_log.DebugFormat("[IRC-Channel-{0}] CommandsEnabled : <{1}>", cs.idn, cs.CommandsEnabled); |
182 | cs.CommandChannel = Convert.ToInt32(Substitute(rs, config.GetString("commandchannel", Convert.ToString(cs.CommandChannel)))); | 182 | cs.CommandChannel = Convert.ToInt32(Substitute(rs, config.GetString("commandchannel", Convert.ToString(cs.CommandChannel)))); |
183 | m_log.DebugFormat("[IRC-Channel-{0}] CommandChannel : <{1}>", cs.idn, cs.CommandChannel); | 183 | m_log.DebugFormat("[IRC-Channel-{0}] CommandChannel : <{1}>", cs.idn, cs.CommandChannel); |
184 | cs.CommandChannel = Convert.ToInt32(Substitute(rs, config.GetString("command_channel", Convert.ToString(cs.CommandChannel)))); | 184 | cs.CommandChannel = Convert.ToInt32(Substitute(rs, config.GetString("command_channel", Convert.ToString(cs.CommandChannel)))); |
185 | m_log.DebugFormat("[IRC-Channel-{0}] CommandChannel : <{1}>", cs.idn, cs.CommandChannel); | 185 | m_log.DebugFormat("[IRC-Channel-{0}] CommandChannel : <{1}>", cs.idn, cs.CommandChannel); |
186 | cs.RelayChat = Convert.ToBoolean(Substitute(rs, config.GetString("relay_chat", Convert.ToString(cs.RelayChat)))); | 186 | cs.RelayChat = Convert.ToBoolean(Substitute(rs, config.GetString("relay_chat", Convert.ToString(cs.RelayChat)))); |
187 | m_log.DebugFormat("[IRC-Channel-{0}] RelayChat : <{1}>", cs.idn, cs.RelayChat); | 187 | m_log.DebugFormat("[IRC-Channel-{0}] RelayChat : <{1}>", cs.idn, cs.RelayChat); |
188 | cs.RelayPrivateChannels = Convert.ToBoolean(Substitute(rs, config.GetString("relay_private_channels", Convert.ToString(cs.RelayPrivateChannels)))); | 188 | cs.RelayPrivateChannels = Convert.ToBoolean(Substitute(rs, config.GetString("relay_private_channels", Convert.ToString(cs.RelayPrivateChannels)))); |
189 | m_log.DebugFormat("[IRC-Channel-{0}] RelayPrivateChannels : <{1}>", cs.idn, cs.RelayPrivateChannels); | 189 | m_log.DebugFormat("[IRC-Channel-{0}] RelayPrivateChannels : <{1}>", cs.idn, cs.RelayPrivateChannels); |
190 | cs.RelayPrivateChannels = Convert.ToBoolean(Substitute(rs, config.GetString("useworldcomm", Convert.ToString(cs.RelayPrivateChannels)))); | 190 | cs.RelayPrivateChannels = Convert.ToBoolean(Substitute(rs, config.GetString("useworldcomm", Convert.ToString(cs.RelayPrivateChannels)))); |
191 | m_log.DebugFormat("[IRC-Channel-{0}] RelayPrivateChannels : <{1}>", cs.idn, cs.RelayPrivateChannels); | 191 | m_log.DebugFormat("[IRC-Channel-{0}] RelayPrivateChannels : <{1}>", cs.idn, cs.RelayPrivateChannels); |
192 | cs.RelayChannelOut = Convert.ToInt32(Substitute(rs, config.GetString("relay_private_channel_out", Convert.ToString(cs.RelayChannelOut)))); | 192 | cs.RelayChannelOut = Convert.ToInt32(Substitute(rs, config.GetString("relay_private_channel_out", Convert.ToString(cs.RelayChannelOut)))); |
193 | m_log.DebugFormat("[IRC-Channel-{0}] RelayChannelOut : <{1}>", cs.idn, cs.RelayChannelOut); | 193 | m_log.DebugFormat("[IRC-Channel-{0}] RelayChannelOut : <{1}>", cs.idn, cs.RelayChannelOut); |
194 | cs.RelayChannel = Convert.ToInt32(Substitute(rs, config.GetString("relay_private_channel_in", Convert.ToString(cs.RelayChannel)))); | 194 | cs.RelayChannel = Convert.ToInt32(Substitute(rs, config.GetString("relay_private_channel_in", Convert.ToString(cs.RelayChannel)))); |
195 | m_log.DebugFormat("[IRC-Channel-{0}] RelayChannel : <{1}>", cs.idn, cs.RelayChannel); | 195 | m_log.DebugFormat("[IRC-Channel-{0}] RelayChannel : <{1}>", cs.idn, cs.RelayChannel); |
196 | cs.RelayChannel = Convert.ToInt32(Substitute(rs, config.GetString("inchannel", Convert.ToString(cs.RelayChannel)))); | 196 | cs.RelayChannel = Convert.ToInt32(Substitute(rs, config.GetString("inchannel", Convert.ToString(cs.RelayChannel)))); |
197 | m_log.DebugFormat("[IRC-Channel-{0}] RelayChannel : <{1}>", cs.idn, cs.RelayChannel); | 197 | m_log.DebugFormat("[IRC-Channel-{0}] RelayChannel : <{1}>", cs.idn, cs.RelayChannel); |
198 | cs.PrivateMessageFormat = Substitute(rs, config.GetString("msgformat", cs.PrivateMessageFormat)); | 198 | cs.PrivateMessageFormat = Substitute(rs, config.GetString("msgformat", cs.PrivateMessageFormat)); |
199 | m_log.DebugFormat("[IRC-Channel-{0}] PrivateMessageFormat : <{1}>", cs.idn, cs.PrivateMessageFormat); | 199 | m_log.DebugFormat("[IRC-Channel-{0}] PrivateMessageFormat : <{1}>", cs.idn, cs.PrivateMessageFormat); |
200 | cs.NoticeMessageFormat = Substitute(rs, config.GetString("noticeformat", cs.NoticeMessageFormat)); | 200 | cs.NoticeMessageFormat = Substitute(rs, config.GetString("noticeformat", cs.NoticeMessageFormat)); |
201 | m_log.DebugFormat("[IRC-Channel-{0}] NoticeMessageFormat : <{1}>", cs.idn, cs.NoticeMessageFormat); | 201 | m_log.DebugFormat("[IRC-Channel-{0}] NoticeMessageFormat : <{1}>", cs.idn, cs.NoticeMessageFormat); |
202 | cs.ClientReporting = Convert.ToInt32(Substitute(rs, config.GetString("verbosity", cs.ClientReporting?"1":"0"))) > 0; | 202 | cs.ClientReporting = Convert.ToInt32(Substitute(rs, config.GetString("verbosity", cs.ClientReporting ? "1" : "0"))) > 0; |
203 | m_log.DebugFormat("[IRC-Channel-{0}] ClientReporting : <{1}>", cs.idn, cs.ClientReporting); | 203 | m_log.DebugFormat("[IRC-Channel-{0}] ClientReporting : <{1}>", cs.idn, cs.ClientReporting); |
204 | cs.ClientReporting = Convert.ToBoolean(Substitute(rs, config.GetString("report_clients", Convert.ToString(cs.ClientReporting)))); | 204 | cs.ClientReporting = Convert.ToBoolean(Substitute(rs, config.GetString("report_clients", Convert.ToString(cs.ClientReporting)))); |
205 | m_log.DebugFormat("[IRC-Channel-{0}] ClientReporting : <{1}>", cs.idn, cs.ClientReporting); | 205 | m_log.DebugFormat("[IRC-Channel-{0}] ClientReporting : <{1}>", cs.idn, cs.ClientReporting); |
206 | cs.DefaultZone = Substitute(rs, config.GetString("fallback_region", cs.DefaultZone)); | 206 | cs.DefaultZone = Substitute(rs, config.GetString("fallback_region", cs.DefaultZone)); |
207 | m_log.DebugFormat("[IRC-Channel-{0}] DefaultZone : <{1}>", cs.idn, cs.DefaultZone); | 207 | m_log.DebugFormat("[IRC-Channel-{0}] DefaultZone : <{1}>", cs.idn, cs.DefaultZone); |
208 | cs.ConnectDelay = Convert.ToInt32(Substitute(rs, config.GetString("connect_delay", Convert.ToString(cs.ConnectDelay)))); | 208 | cs.ConnectDelay = Convert.ToInt32(Substitute(rs, config.GetString("connect_delay", Convert.ToString(cs.ConnectDelay)))); |
209 | m_log.DebugFormat("[IRC-Channel-{0}] ConnectDelay : <{1}>", cs.idn, cs.ConnectDelay); | 209 | m_log.DebugFormat("[IRC-Channel-{0}] ConnectDelay : <{1}>", cs.idn, cs.ConnectDelay); |
210 | cs.PingDelay = Convert.ToInt32(Substitute(rs, config.GetString("ping_delay", Convert.ToString(cs.PingDelay)))); | 210 | cs.PingDelay = Convert.ToInt32(Substitute(rs, config.GetString("ping_delay", Convert.ToString(cs.PingDelay)))); |
211 | 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); |
212 | cs.AccessPassword = Substitute(rs, config.GetString("access_password", cs.AccessPassword)); | 212 | cs.AccessPassword = Substitute(rs, config.GetString("access_password", cs.AccessPassword)); |
213 | 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); |
@@ -217,7 +217,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
217 | { | 217 | { |
218 | cs.ExcludeList.Add(name.Trim().ToLower()); | 218 | cs.ExcludeList.Add(name.Trim().ToLower()); |
219 | } | 219 | } |
220 | 220 | ||
221 | // Fail if fundamental information is still missing | 221 | // Fail if fundamental information is still missing |
222 | 222 | ||
223 | if (cs.Server == null) | 223 | if (cs.Server == null) |
@@ -306,8 +306,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
306 | 306 | ||
307 | IRCBridgeModule.m_channels.Add(cs); | 307 | IRCBridgeModule.m_channels.Add(cs); |
308 | 308 | ||
309 | m_log.InfoFormat("[IRC-Channel-{0}] New channel initialized for {1}, nick: {2}, commands {3}, private channels {4}", | 309 | m_log.InfoFormat("[IRC-Channel-{0}] New channel initialized for {1}, nick: {2}, commands {3}, private channels {4}", |
310 | cs.idn, rs.Region, cs.DefaultZone, | 310 | cs.idn, rs.Region, cs.DefaultZone, |
311 | cs.CommandsEnabled ? "enabled" : "not enabled", | 311 | cs.CommandsEnabled ? "enabled" : "not enabled", |
312 | cs.RelayPrivateChannels ? "relayed" : "not relayed"); | 312 | cs.RelayPrivateChannels ? "relayed" : "not relayed"); |
313 | } | 313 | } |
@@ -417,7 +417,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
417 | private bool IsAConnectionMatchFor(ChannelState cs) | 417 | private bool IsAConnectionMatchFor(ChannelState cs) |
418 | { | 418 | { |
419 | return ( | 419 | return ( |
420 | Server == cs.Server && | 420 | Server == cs.Server && |
421 | IrcChannel == cs.IrcChannel && | 421 | IrcChannel == cs.IrcChannel && |
422 | Port == cs.Port && | 422 | Port == cs.Port && |
423 | BaseNickname == cs.BaseNickname && | 423 | BaseNickname == cs.BaseNickname && |
@@ -473,27 +473,27 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
473 | { | 473 | { |
474 | 474 | ||
475 | string vvar = arg.Match(result).ToString(); | 475 | string vvar = arg.Match(result).ToString(); |
476 | string var = vvar.Substring(1,vvar.Length-2).Trim(); | 476 | string var = vvar.Substring(1, vvar.Length - 2).Trim(); |
477 | 477 | ||
478 | switch (var.ToLower()) | 478 | switch (var.ToLower()) |
479 | { | 479 | { |
480 | case "%region" : | 480 | case "%region": |
481 | result = result.Replace(vvar, rs.Region); | 481 | result = result.Replace(vvar, rs.Region); |
482 | break; | 482 | break; |
483 | case "%host" : | 483 | case "%host": |
484 | result = result.Replace(vvar, rs.Host); | 484 | result = result.Replace(vvar, rs.Host); |
485 | break; | 485 | break; |
486 | case "%locx" : | 486 | case "%locx": |
487 | result = result.Replace(vvar, rs.LocX); | 487 | result = result.Replace(vvar, rs.LocX); |
488 | break; | 488 | break; |
489 | case "%locy" : | 489 | case "%locy": |
490 | result = result.Replace(vvar, rs.LocY); | 490 | result = result.Replace(vvar, rs.LocY); |
491 | break; | 491 | break; |
492 | case "%k" : | 492 | case "%k": |
493 | result = result.Replace(vvar, rs.IDK); | 493 | result = result.Replace(vvar, rs.IDK); |
494 | break; | 494 | break; |
495 | default : | 495 | default: |
496 | result = result.Replace(vvar, rs.config.GetString(var,var)); | 496 | result = result.Replace(vvar, rs.config.GetString(var, var)); |
497 | break; | 497 | break; |
498 | } | 498 | } |
499 | // m_log.DebugFormat("[IRC-Channel] Parse[2]: {0}", result); | 499 | // m_log.DebugFormat("[IRC-Channel] Parse[2]: {0}", result); |