Esempio n. 1
0
 public ShortenURL(Pluggis pluggis, string[] messageLine, Channel channel, String fromNick)
     : base(pluggis, messageLine, channel)
 {
     longURL = messageLine[1];
     this.fromNick = fromNick;
     Handler();
 }
Esempio n. 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);
        }
Esempio n. 3
0
        public void AdminList(Channel channel, string nick, string admin)
        {
            if (!IsAdmin(nick)) {
            return;
              }

              Bot.SendMessage(SendType.Message, channel.Name, admins.Count.ToString());
        }
Esempio n. 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);
        }
Esempio n. 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));
 }
Esempio n. 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;
     }
 }
Esempio n. 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));
              }
        }
Esempio n. 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));
              }
        }
Esempio n. 9
0
 protected override void OnQuit(Channel channel, string from)
 {
     //Treat the same as parts.
     OnPart(channel, from);
 }
Esempio n. 10
0
 //Part and Quit don't work properly on Twitch
 protected override void OnPart(Channel channel, string from)
 {
     _userDatabase.RemoveUser(from);
 }
Esempio n. 11
0
 public Time(Pluggis pluggis, Channel channel)
     : base(pluggis, channel)
 {
     Handler();
 }
Esempio n. 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)));
            }
        }
Esempio n. 13
0
 public DiceRoll(Pluggis pluggis, string[] messageLine, Channel channel)
     : base(pluggis, messageLine, channel)
 {
     rand = new Random();
     Handler();
 }
Esempio n. 14
0
 public ActionHandler(Pluggis pluggis, Channel channel)
     : this(pluggis, null, channel)
 {
 }
Esempio n. 15
0
 public VersionInfo(Pluggis pluggis, Channel channel)
     : base(pluggis, channel)
 {
     Handler();
 }
Esempio n. 16
0
 protected override void OnAction(Channel channel, IrcUser from, string message)
 {
     //Treat the same as messages.
     OnMessage(channel, from, message);
 }
Esempio n. 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));
            }
        }
Esempio n. 18
0
 public ParseForURL(Pluggis pluggis, string[] messageLine, Channel channel)
     : base(pluggis, messageLine, channel)
 {
     Handler();
 }