Index: trunk/tools/wmib/Config.cs |
— | — | @@ -140,6 +140,7 @@ |
141 | 141 | AddConfig("username", username); |
142 | 142 | AddConfig("password", password); |
143 | 143 | AddConfig("network", network); |
| 144 | + AddConfig("debug", debugchan); |
144 | 145 | AddConfig("nick", login); |
145 | 146 | text = text + "\nchannels="; |
146 | 147 | foreach (channel current in channels) |
— | — | @@ -185,6 +186,7 @@ |
186 | 187 | username = parseConfig(text, "username"); |
187 | 188 | network = parseConfig(text, "network"); |
188 | 189 | login = parseConfig(text, "nick"); |
| 190 | + debugchan = parseConfig(text, "debug"); |
189 | 191 | password = parseConfig(text, "password"); |
190 | 192 | if (!System.IO.Directory.Exists(config.DumpDir)) |
191 | 193 | { |
— | — | @@ -200,6 +202,7 @@ |
201 | 203 | /// Nick name |
202 | 204 | /// </summary> |
203 | 205 | public static string username = "wm-bot"; |
| 206 | + public static string debugchan = ""; |
204 | 207 | /// <summary> |
205 | 208 | /// Login name |
206 | 209 | /// </summary> |
Index: trunk/tools/wmib/Core.cs |
— | — | @@ -520,11 +520,11 @@ |
521 | 521 | { |
522 | 522 | if ( parameters > 1) |
523 | 523 | { |
524 | | - int curr = 0; |
525 | | - while ( parameters >= curr ) |
| 524 | + int curr = 1; |
| 525 | + while ( parameters > curr ) |
526 | 526 | { |
527 | | - curr++; |
528 | 527 | keyv = keyv.Replace("$" + curr.ToString(), p[curr]); |
| 528 | + curr++; |
529 | 529 | } |
530 | 530 | } |
531 | 531 | if (User == "") |
— | — | @@ -761,7 +761,11 @@ |
762 | 762 | /// <param name="chan">Channel name</param> |
763 | 763 | public static void handleException(Exception ex, string chan) |
764 | 764 | { |
765 | | - Message("DEBUG Exception: " + ex.Message + " I feel crushed, uh :|", chan); |
| 765 | + if (config.debugchan != null) |
| 766 | + { |
| 767 | + Message("DEBUG Exception: " + ex.Message + " I feel crushed, uh :|", config.debugchan); |
| 768 | + } |
| 769 | + Program.Log(ex.Message + ex.Source + ex.StackTrace); |
766 | 770 | } |
767 | 771 | |
768 | 772 | /// <summary> |
— | — | @@ -1063,6 +1067,7 @@ |
1064 | 1068 | if (!chan.logged) |
1065 | 1069 | { |
1066 | 1070 | Message("Channel was already not logged", chan.name); |
| 1071 | + return; |
1067 | 1072 | } |
1068 | 1073 | else |
1069 | 1074 | { |
— | — | @@ -1085,6 +1090,7 @@ |
1086 | 1091 | channels = channels + a.name + ", "; |
1087 | 1092 | } |
1088 | 1093 | Message("I am now in following channels: " + channels, chan.name); |
| 1094 | + return; |
1089 | 1095 | } |
1090 | 1096 | if (message.StartsWith("@infobot-off")) |
1091 | 1097 | { |
— | — | @@ -1105,6 +1111,7 @@ |
1106 | 1112 | else |
1107 | 1113 | { |
1108 | 1114 | Message("Permission denied", chan.name); |
| 1115 | + return; |
1109 | 1116 | } |
1110 | 1117 | } |
1111 | 1118 | if (message.StartsWith("@infobot-on")) |
— | — | @@ -1130,18 +1137,8 @@ |
1131 | 1138 | } |
1132 | 1139 | if (message.StartsWith("@commands")) |
1133 | 1140 | { |
1134 | | - Message("Commands: channellist, trusted, trustadd, trustdel, infobot-off, infobot-on, drop, add, flush, logon, logoff", chan.name); |
| 1141 | + Message("Commands: channellist, trusted, trustadd, trustdel, infobot-off, infobot-on, drop, add, reload, logon, logoff", chan.name); |
1135 | 1142 | } |
1136 | | - |
1137 | | - if (message.StartsWith("@channellist")) |
1138 | | - { |
1139 | | - string channels = ""; |
1140 | | - foreach (config.channel a in config.channels) |
1141 | | - { |
1142 | | - channels = channels + a.name + ", "; |
1143 | | - } |
1144 | | - Message("I am now in following channels: " + channels, chan.name); |
1145 | | - } |
1146 | 1143 | } |
1147 | 1144 | |
1148 | 1145 | /// <summary> |