Example #1
0
 public ShortenURL(Pluggis pluggis, string[] messageLine, Channel channel, String fromNick)
     : base(pluggis, messageLine, channel)
 {
     longURL = messageLine[1];
     this.fromNick = fromNick;
     Handler();
 }
Example #2
0
        protected override void OnJoin(Channel channel, string from)
        {
            //Ignore if user already sent a message prior to the JOIN event.
            if (_userDatabase.ContainsUser(from)) return;

            PrepareWelcomeMessage(from);
            _statistics.UpdateOnJoin(from);
        }
Example #3
0
        public void AdminList(Channel channel, string nick, string admin)
        {
            if (!IsAdmin(nick)) {
            return;
              }

              Bot.SendMessage(SendType.Message, channel.Name, admins.Count.ToString());
        }
Example #4
0
        protected override void OnMessage(Channel channel, IrcUser from, string message)
        {
            //Due to Twitch architecture, a user can send a message before a JOIN.
            if (!_userDatabase.ContainsUser(from.Nick))
                OnJoin(channel, from.Nick);

            SendLastVisited(from.Nick);
            _statistics.UpdateOnMessage(from.Nick, message);
        }
Example #5
0
 private static void UserTick(object state)
 {
     Meebey.SmartIrc4net.Channel chan = _irc.GetChannel(Settings.Channel);
     foreach (Meebey.SmartIrc4net.ChannelUser user in chan.Users.Values)
     {
         UserManager.UpdateUser(user.Nick, Settings.ExpPerGrant, Settings.PointsPerGrant);
     }
     _timer.Change(TimeSpan.FromMinutes(Settings.MinutesBetweenGranting), TimeSpan.FromMilliseconds(-1));
 }
Example #6
0
 public ActionHandler(Pluggis pluggis, string[] messageLine, Channel channel)
 {
     this.pluggis = pluggis;
     this.messageLine = messageLine;
     this.channel = channel;
     if (messageLine != null)
     {
         length = messageLine.Length;
     }
 }
Example #7
0
        public void AdminDel(Channel channel, string nick, string admin)
        {
            if (!IsAdmin(nick)) {
            return;
              }

              if (Delete(admin)) {
            Bot.SendMessage(SendType.Message, channel.Name, string.Format("removed {0} from the admin list", admin));
              } else {
            Bot.SendMessage(SendType.Message, channel.Name, string.Format("no such admin {0}", admin));
              }
        }
Example #8
0
        public void AdminAdd(Channel channel, string nick, string admin)
        {
            if (!IsAdmin(nick)) {
            return;
              }

              if (Add(admin)) {
            Bot.SendMessage(SendType.Message, channel.Name, string.Format("added {0} to admins", admin));
              } else {
            Bot.SendMessage(SendType.Message, channel.Name, string.Format("{0} is already an admin", admin));
              }
        }
Example #9
0
 protected override void OnQuit(Channel channel, string from)
 {
     //Treat the same as parts.
     OnPart(channel, from);
 }
Example #10
0
 //Part and Quit don't work properly on Twitch
 protected override void OnPart(Channel channel, string from)
 {
     _userDatabase.RemoveUser(from);
 }
Example #11
0
 public Time(Pluggis pluggis, Channel channel)
     : base(pluggis, channel)
 {
     Handler();
 }
Example #12
0
        void OnChannelActiveSynced(object sender, IrcEventArgs e)
        {
            channel = client.GetChannel(e.Data.Channel);
            AddNotification("{0} users online".F(channel.Users.Count));
            connectionStatus = ChatConnectionStatus.Joined;

            foreach (DictionaryEntry user in channel.Users)
            {
                var u = (ChannelUser)user.Value;
                Game.RunAfterTick(() => Users.Add(u.Nick, new ChatUser(u.Nick, u.IsOp, u.IsVoice)));
            }
        }
Example #13
0
 public DiceRoll(Pluggis pluggis, string[] messageLine, Channel channel)
     : base(pluggis, messageLine, channel)
 {
     rand = new Random();
     Handler();
 }
Example #14
0
 public ActionHandler(Pluggis pluggis, Channel channel)
     : this(pluggis, null, channel)
 {
 }
Example #15
0
 public VersionInfo(Pluggis pluggis, Channel channel)
     : base(pluggis, channel)
 {
     Handler();
 }
Example #16
0
 protected override void OnAction(Channel channel, IrcUser from, string message)
 {
     //Treat the same as messages.
     OnMessage(channel, from, message);
 }
Example #17
0
        /// <summary>
        /// Event handler for join messages
        /// </summary>
        /// <param name="ircdata">Message data containing join information</param>
        private void _Event_JOIN(IrcMessageData ircdata)
        {
            string who = ircdata.Nick;
            string channelname = ircdata.Channel;

            if (IsMe(who)) {
                _JoinedChannels.Add(channelname);
            }

            if (ActiveChannelSyncing) {
                Channel channel;
                if (IsMe(who)) {
                    // we joined the channel
            #if LOG4NET
                    Logger.ChannelSyncing.Debug("joining channel: "+channelname);
            #endif
                    if (SupportNonRfc) {
                        channel = new NonRfcChannel(channelname);
                    } else {
                        channel = new Channel(channelname);
                    }
                    _Channels.Add(channelname, channel);
                    // request channel mode
                    RfcMode(channelname);
                    // request wholist
                    RfcWho(channelname);
                    // request banlist
                    Ban(channelname);
                } else {
                    // someone else joined the channel
                    // request the who data
                    RfcWho(who);
                }

            #if LOG4NET
                Logger.ChannelSyncing.Debug(who+" joins channel: "+channelname);
            #endif
                channel = GetChannel(channelname);
                IrcUser ircuser = GetIrcUser(who);

                if (ircuser == null) {
                    ircuser = new IrcUser(who, this);
                    ircuser.Ident = ircdata.Ident;
                    ircuser.Host  = ircdata.Host;
                    _IrcUsers.Add(who, ircuser);
                }

                ChannelUser channeluser;
                if (SupportNonRfc) {
                    channeluser = new NonRfcChannelUser(channelname, ircuser);
                } else {
                    channeluser = new ChannelUser(channelname, ircuser);
                }
                channel.UnsafeUsers.Add(who, channeluser);
            }

            if (OnJoin != null) {
                OnJoin(this, new JoinEventArgs(ircdata, channelname, who));
            }
        }
Example #18
0
 public ParseForURL(Pluggis pluggis, string[] messageLine, Channel channel)
     : base(pluggis, messageLine, channel)
 {
     Handler();
 }