Exemplo n.º 1
0
 public override void onServerBurstEnd()
 {
     services = getChannelFromName(channel);
     if (services == null)
     {
         services = new Channel(channel, getTimeStamp());
     }
     foreach (KeyValuePair<string, Client> c in Program.Clients)
     {
         c.Value.joinChannelMode(services, c.Value, "+o");
         if (c.Value.nickname.ToLower() == "nickserv")
         {
             ns = c.Value;
         }
     }
 }
Exemplo n.º 2
0
 public override void msgUser(Client sender, User sendee, string message)
 {
     Send(":" + sender.UID + " PRIVMSG " + sendee.UID + " :" + message);
 }
Exemplo n.º 3
0
 public override void msgChannel(Client sender, Channel channel, string message)
 {
     Console.WriteLine(":" + sender.UID + " PRIVMSG " + channel.name + " :" + message);
     Send(":" + sender.UID + " PRIVMSG " + channel.name + " :" + message);
 }
Exemplo n.º 4
0
 public override void killUser(Client killer, User killee, string reason = null)
 {
     Send(":" + killer.UID + " " + killee.UID + " :" + thisserver + "!" + killer.hostname + "!" + killer.username + "!" + killer.nickname + " (" + reason + ")");
 }
Exemplo n.º 5
0
 public override void kickUser(Client kicker, User kickee, Channel channel, string reason = null)
 {
     Send(":" + kicker.UID + " KICK " + channel.name + " " + kickee.UID + " :" + reason);
 }
Exemplo n.º 6
0
 public override void onServerBurstStart()
 {
     cs = new Client("ChanServ", "ChanServ", "S", "Chan.Serv", "Channel Management Services", generateUID());
     cs.introduce();
     this.registerClient(cs);
 }
Exemplo n.º 7
0
 public void registerClient(Client client)
 {
     if (moduleClient == null) {
         this.moduleClient = client;
         Help = new HelpManager (client);
     }
 }
Exemplo n.º 8
0
 public override void chanMode(Client sender, Channel channel, User dest, string modes)
 {
     Send(":" + sender.UID + " TMODE " + getTimeStamp() + " " + channel.name + " " + modes + " " + dest.UID);
 }
Exemplo n.º 9
0
 public virtual void noticeChannel(Client sender, Channel channel, string message)
 {
 }
Exemplo n.º 10
0
 public virtual void killUser(Client killer, User killee, string reason = null)
 {
 }
Exemplo n.º 11
0
 public virtual void kickUser(Client kicker, User kickee, Channel channel, string reason = null)
 {
 }
Exemplo n.º 12
0
 public virtual void joinChannelMode(Client client, Channel channel, User dest, string modes)
 {
 }
Exemplo n.º 13
0
 public override void onServerBurstStart()
 {
     os = new Client("OperServ", "OperServ", "S", "Oper.Serv", "Operator Management Services", generateUID());
     os.introduce();
     this.registerClient(os);
 }
Exemplo n.º 14
0
 public HelpManager(Client client)
 {
     this.client = client;
     HelpDict = new Dictionary<string, CommandExecutor> ();
 }
Exemplo n.º 15
0
 public override void noticeChannel(Client sender, Channel channel, string message)
 {
     Send(":" + sender.UID + " NOTICE " + channel.name + " :" + message);
 }
Exemplo n.º 16
0
 public virtual void noticeUser(Client sender, User sendee, string message)
 {
 }
Exemplo n.º 17
0
 public override void noticeUser(Client sender, User sendee, string message)
 {
     Send(":" + sender.UID + " NOTICE " + sendee.UID + " :" + message);
 }
Exemplo n.º 18
0
 public virtual void chanMode(Client sender, Channel channel, string modes)
 {
 }
Exemplo n.º 19
0
 public override void joinChannelMode(Client client, Channel channel, string modes)
 {
     Send(":" + SID + " SJOIN " + channel.TS + " " + channel.name + " " + modes + " :" + client.UID);
 }
Exemplo n.º 20
0
 public override void joinChannelMode(Client client, Channel channel, User dest, string modes)
 {
     if (modes.StartsWith("+"))
     {
         if (modes.Contains('o'))
         {
             Send("SJOIN " + channel.TS + " " + channel.name + " + :@" + client.UID);
         }
         else if (modes.Contains('v'))
         {
             Send("SJOIN " + channel.TS + " " + channel.name + " + :+" + client.UID);
         }
     }
     else
     {
         Send(":" + client.UID + " TMODE " + getTimeStamp() + " " + channel.name + " " + modes + " " + dest.UID);
     }
 }
Exemplo n.º 21
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:
                         {
                             if (Proto.Protocol.protocolPlugin.burstComplete)
                             {
                                 Console.WriteLine("message called");
                                 UserMessageEvent me = (UserMessageEvent)ev;
                                 if (module.moduleClient == 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:
                         {
                             if (Proto.Protocol.protocolPlugin.burstComplete)
                             {
                                 UserEvent me = (UserEvent)ev;
                                 if (me.user != client)
                                 {
                                     module.onUserConnect(me);
                                 }
                             }
                             break;
                         }
                     case Hooks.USER_NICKCHANGE:
                         {
                             if (Proto.Protocol.protocolPlugin.burstComplete)
                             {
                                 UserNickChangeEvent me = (UserNickChangeEvent)ev;
                                 if (me.user != client)
                                 {
                                     module.onUserNickChange(me);
                                 }
                             }
                             break;
                         }
                     case Hooks.USER_IDENTIFY:
                         {
                             UserEvent me = (UserEvent)ev;
                             module.onUserIdentify(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_START:
                         {
                             module.onServerBurstStart();
                             break;
                         }
                     case Hooks.SERVER_BURST_END:
                         {
                             Console.WriteLine("server burst end");
                             module.onServerBurstEnd();
                             break;
                         }
                     case Hooks.USER_BURST_CONNECT:
                         {
                             UserEvent me = (UserEvent) ev;
                             if (!Proto.Protocol.protocolPlugin.burstComplete)
                             {
                                 module.onUserBurstConnect(me);
                             }
                             break;
                         }
                     case Hooks.USER_IDENTIFY_FAIL:
                         {
                             UserEvent me = (UserEvent)ev;
                             module.onUserIdentifyFail(me);
                             break;
                         }
                 }
             }
         }
         catch (Exception e)
         {
             Console.WriteLine(e.ToString());
         }
     }
 }
Exemplo n.º 22
0
 public ClientIntroduceEvent(Client client)
 {
     this.client = client;
 }