Beispiel #1
0
 protected override void ChatInputHandler(object sender, ChatEventArgs e)
 {
     base.ChatInputHandler(sender, e);
     if (e.Type == ChatType.OwnerSay)
     {
         if (allow_RLV == true)
         {
             if (e.Message.StartsWith("@") == true)
             {
                 string message_text     = e.Message.Substring(1);
                 bool   permissive_allow = true;
                 if (permissive_allow == true)
                 {
                     string[] requested_commands = message_text.Split(',');
                     foreach (string R in requested_commands)
                     {
                         List <string> args    = new List <string>();
                         string        command = "";
                         string[]      build   = R.Split('=');
                         string[]      build2  = build[0].Split(':');
                         if (build2.Length == 2)
                         {
                             string[] build3 = build2[1].Split(';');
                             foreach (string build_arg in build3)
                             {
                                 args.Add(build_arg);
                             }
                         }
                         command = build2[0];
                         if (build.Length == 2)
                         {
                             args.Add(build[1]);
                         }
                         if (blacklist_recvim.Contains(command) == false)
                         {
                             if (Notify.ContainsKey("#") == true)
                             {
                                 foreach (int channel in Notify["#"])
                                 {
                                     Client.Self.Chat("/" + message_text, channel, ChatType.Normal);
                                 }
                             }
                             if (Notify.ContainsKey(command) == true)
                             {
                                 foreach (int channel in Notify[command])
                                 {
                                     Client.Self.Chat("/" + message_text, channel, ChatType.Normal);
                                 }
                             }
                             RLVinterface.SetCallerDetails(e.SourceID, e.FromName);
                             RLVinterface.Call(command, args.ToArray());
                         }
                         else
                         {
                             ConsoleLog.Debug("RLV API -> blacklisted [" + command + "]");
                         }
                     }
                 }
             }
         }
     }
 }