Example #1
0
 public virtual void chanMode(Client sender, Channel channel, string modes)
 {
 }
 public ClientIntroduceEvent(Client client)
 {
     this.client = client;
 }
Example #3
0
 public virtual void noticeUser(Client sender, User sendee, string message)
 {
 }
Example #4
0
 public virtual void noticeChannel(Client sender, Channel channel, string message)
 {
 }
Example #5
0
 public virtual void killUser(Client killer, User killee, string reason = null)
 {
 }
Example #6
0
 public virtual void kickUser(Client kicker, User kickee, Channel channel, string reason = null)
 {
 }
Example #7
0
        public static void callHook(Hooks hook, Client client, Event ev = null)
        {
            foreach (ModulePlugin module in moduleList)
            {
                try
                {
                    if (module.moduleHooks.Contains(hook))
                    {
                        Console.WriteLine("hook " + hook + " : " + module.ToString());
                        switch (hook)
                        {
                            case Hooks.USER_CHANNEL_PRIVMSG:
                                {
                                    ChannelMessageEvent me = (ChannelMessageEvent)ev;
                                    if (me.channel.containsUser(me.user))
                                    {
                                        module.onUserMessageChannel(me);
                                    }
                                    break;
                                }
                            case Hooks.USER_MESSAGE_CLIENT:
                                {
                                    Console.WriteLine("message called");
                                    UserMessageEvent me = (UserMessageEvent)ev;
                                    if (me.sendee == client)
                                    {
                                        module.onUserMessageClient(me);
                                    }
                                    break;
                                }
                            case Hooks.CLIENT_KILLED:
                                {
                                    KillEvent me = (KillEvent)ev;
                                    if (me.killee == client)
                                    {
                                        module.onClientKilled(me);
                                    }
                                    break;
                                }
                            case Hooks.USER_CONNECT:
                                {
                                    UserEvent me = (UserEvent)ev;
                                    if (me.user != client)
                                    {
                                        module.onUserConnect(me);
                                    }
                                    break;
                                }
                            case Hooks.USER_NICKCHANGE:
                                {
                                    UserNickChangeEvent me = (UserNickChangeEvent)ev;
                                    if (me.user != client)
                                    {
                                        module.onUserNickChange(me);
                                    }
                                    break;
                                }

                            case Hooks.CHANNEL_LOG:
                                {
                                    ChannelLogEvent me = (ChannelLogEvent)ev;
                                    module.onChannelLog(me);
                                    break;
                                }
                            case Hooks.CLIENT_INTRO:
                                {
                                    ClientIntroduceEvent me = (ClientIntroduceEvent)ev;
                                    Console.WriteLine("Client " + me.client.nickname + " introduced!");
                                    module.onClientIntroduce(me);
                                    break;
                                }
                            case Hooks.SERVER_BURST:
                                {
                                    module.onServerBurst();
                                    break;
                                }

                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
        }