当前位置: 首页>>代码示例>>C#>>正文


C# SmartIrc4net.IrcMessageData类代码示例

本文整理汇总了C#中Meebey.SmartIrc4net.IrcMessageData的典型用法代码示例。如果您正苦于以下问题:C# IrcMessageData类的具体用法?C# IrcMessageData怎么用?C# IrcMessageData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IrcMessageData类属于Meebey.SmartIrc4net命名空间,在下文中一共展示了IrcMessageData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ', start);
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No account specified");
                    return;
                }
            }

            string account = data.Message.Substring(start, end - start);

            plugin.RemoveAccount(account);
            plugin.Host.Reply(data, SendType.Message, "Account deleted");
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:25,代码来源:DeleteAccount.cs

示例2: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ', start);
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No account group specified");
                    return;
                }
            }

            string group = data.Message.Substring(start, end - start);
            var members = plugin.GetAccountMembers(group);

            StringBuilder msg = new StringBuilder("Members: ");
            for (int i = 0; i < members.Length; i++)
            {
                msg.Append(members[i]);
                if (i + 1 < members.Length)
                    msg.Append(", ");
            }

            plugin.Host.Reply(data, SendType.Message, msg.ToString());
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:33,代码来源:AccountGroupMembers.cs

示例3: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + 2;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ');
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No such command");
                    return;
                }
            }

            string command = data.Message.Substring(start, end - start).ToLower();

            Type[] types = System.Reflection.Assembly.GetExecutingAssembly().GetTypes();
            //grab and add given command
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:25,代码来源:AddCommand.cs

示例4: AddPlayer

 private string AddPlayer(IrcMessageData msg)
 {
     string res;
     string sender = RealName(msg.From).ToLower();
     if (sender == "voodoohood")
     {
         if(msg.MessageArray.Length >= 2)
         {
             string userToAdd = msg.MessageArray[1].ToLower();
             bool playerAlreadyRegistered = _database.isUserRegistered(userToAdd);
             if (!playerAlreadyRegistered)
             {
                 _database.addPlayerToCraftWar(userToAdd);
                 res = "User " + userToAdd + " added to the registered players .";
                 DumberLogger.Log(" CraftWarComp: Added user" + userToAdd + " to database, is registered " + _database.isUserRegistered(userToAdd));
             }
             else
             {
                 res = "User " + userToAdd + " is already registered";
             }
               
         }
         else
         {
             res = null;
             DumberLogger.Log(" CraftWarComp: Format of the message wasnt correct");
         }
     }
     else
     {
         res = null;
         DumberLogger.Log(" CraftWarComp: User other than voodoohood tryed to add a user");
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:35,代码来源:CraftWarComp.cs

示例5: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ', start);
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No such command");
                    return;
                }
            }

            string group = data.Message.Substring(start, end - start);
            if (plugin.GetCommandsAtGroup(group) == null)
            {
                plugin.Host.Reply(data, SendType.Message, "No account group '" + group + "' exists");
                return;
            }

            plugin.RemoveAccountGroup(group);
            plugin.Host.Reply(data, SendType.Message, "Account group " + group + " deleted");
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:30,代码来源:AccountGroupDelete.cs

示例6: OnReadLine

        public bool OnReadLine(IrcMessageData data)
        {
            if ((data.Type != ReceiveType.ChannelMessage) && (data.Type != ReceiveType.QueryMessage))
                return true;

            if ((data.MessageArray.Length > 1) && ((data.MessageArray[0].ToLower() == "!nick") || (data.MessageArray[0].ToLower() == "!name"))) {
                _irc.RfcNick(data.MessageArray[1]);
                return true;
            }

            if ((data.Type == ReceiveType.ChannelMessage) && (data.MessageArray[0] == "!help")) {
                DisplayHelp(data);
                return true;
            }

            if (data.Type != ReceiveType.QueryMessage)
                return true;

            if (data.MessageArray.Length > 0) {
                _irc.SendMessage(SendType.Message, Admin._channel, data.Message);
                Console.WriteLine(data.Nick + " " + data.Message);
            }

            return true;
        }
开发者ID:silpheed,项目名称:IRC-Bot,代码行数:25,代码来源:Puppet.cs

示例7: Parse

 public static BanInfo Parse(IrcMessageData data)
 {
     BanInfo info = new BanInfo();
     // :magnet.oftc.net 367 meebey #smuxi [email protected] [email protected] 1216309801..
     info.f_Channel = data.RawMessageArray[3];
     info.f_Mask= data.RawMessageArray[4];
     return info;
 }
开发者ID:brudish,项目名称:furkiebot,代码行数:8,代码来源:BanInfo.cs

示例8: Check

 public override bool Check(IrcMessageData msg)
 {
     Boolean res = false;
     string com = msg.MessageArray[0];
     for (int i = 0; i < commands.Length; i++)
     {
         if (com == commands[i]) res = true;
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:10,代码来源:UtilComponent.cs

示例9: ParseForLink

 private void ParseForLink(IrcMessageData data)
 {
     CheckLinkDate();
     _links.AddRange(data.MessageArray.Where(word =>
         (!_links.Contains(word)) &&
         (Uri.IsWellFormedUriString(word, UriKind.Absolute)) &&
             ((word.StartsWith("http")) ||
             (word.StartsWith("www")))
         ));
 }
开发者ID:silpheed,项目名称:IRC-Bot,代码行数:10,代码来源:LOTD.cs

示例10: Disconnect

 private string Disconnect(IrcMessageData msg)
 {
     string sender = RealName(msg.From).ToLower();
     bool isSenderDev = sender == "voodoohood" || sender == "n1ghtsh0ck";
     if (isSenderDev)
     {
         Environment.Exit(0);
     }
     
     return null;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:11,代码来源:UtilComponent.cs

示例11: CreateCtcpEventArgs

        protected IrcEventArgs CreateCtcpEventArgs(string aChannel, string aBot, string aMessage, ReceiveType aType, string aCtcpCommand)
        {
            IrcMessageData data = new IrcMessageData(null, "", aBot, "", "", aChannel, aMessage, aMessage, aType, ReplyCode.Null);
            CtcpEventArgs args = (CtcpEventArgs)System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(CtcpEventArgs));
            FieldInfo[] EventFields = typeof(IrcEventArgs).GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
            EventFields[0].SetValue(args, data);

            FieldInfo[] EventFields2 = typeof(CtcpEventArgs).GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
            EventFields2[0].SetValue(args, aCtcpCommand);

            return args;
        }
开发者ID:scottc,项目名称:xdcc-grabscher,代码行数:12,代码来源:AParser.cs

示例12: Execute

        public override void Execute(IrcMessageData data)
        {
            var groups = plugin.GetAccountGroups();
            StringBuilder msg = new StringBuilder("Existing groups: ");
            for (int i = 0; i < groups.Length; i++)
            {
                msg.Append(groups[i]);
                if (i + 1 < groups.Length)
                    msg.Append(", ");
            }

            plugin.Host.Reply(data, SendType.Message, msg.ToString());
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:13,代码来源:AccountGroupPrintAll.cs

示例13: Handle

        public override string Handle(IrcMessageData msg)
        {
            string res = null;
            string com = msg.MessageArray[0];
            switch (com)
            {
                case "#gamba":
                    res = Gamba(msg);
                    break;
            }
            return res;
            

        }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:14,代码来源:FunComponent.cs

示例14: Handle

 public override string Handle(IrcMessageData msg)
 {
     string res = null;
     string com = msg.MessageArray[0];
     switch (com)
     {
         case "#disconnect":
             Disconnect(msg);
             break;
         default:
             break;
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:14,代码来源:UtilComponent.cs

示例15: StartRoulette

 private string StartRoulette(IrcMessageData msg)
 {
     
     string res = null;
     string sender = RealName(msg.From).ToLower();
     if(sender == "voodoohood")
     {
         _rouletteActive = true;
         res = "Roulette started place your bets , you have 1 minute time. Use #placebet <0-36> <1-10000> to place a bet";
         Thread rouletteThread = new Thread(RouletteThreadTask);
         _bets = new List<bet>();
         rouletteThread.Start();
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:15,代码来源:TwitchCasinoComponent.cs


注:本文中的Meebey.SmartIrc4net.IrcMessageData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。