Provides data for events that concern an IrcChannelUser.
상속: IrcCommentEventArgs
예제 #1
0
        /// <summary>
        ///     Raises the <see cref="UserLeft" /> event.
        /// </summary>
        /// <param name="e">The <see cref="IrcChannelUserEventArgs" /> instance containing the event data.</param>
        protected virtual void OnUserLeft(IrcChannelUserEventArgs e)
        {
            var handler = UserLeft;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #2
0
        /// <summary>
        /// Raises the <see cref="UserKicked"/> event.
        /// </summary>
        /// <param name="e">The <see cref="IrcChannelUserEventArgs"/> instance containing the event data.</param>
        protected virtual void OnUserKicked(IrcChannelUserEventArgs e)
        {
            var handler = this.UserKicked;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #3
0
        void OnChannelJoined(object sender, IrcChannelUserEventArgs e)
        {
            if (Config.IgnoredIRCNicks.Contains(e.ChannelUser.User.NickName))
                return;

            if (String.Equals(e.ChannelUser.Channel.Name, Config.Channel, StringComparison.OrdinalIgnoreCase))
            {
                if (!IrcUsers.ContainsKey(e.ChannelUser.User))
                    IrcUsers.Add(e.ChannelUser.User, TShock.Groups.GetGroupByName(TShock.Config.DefaultGuestGroupName));
                e.ChannelUser.User.Quit += OnUserQuit;

                if (!String.IsNullOrEmpty(Config.IRCJoinMessageFormat))
                    TShock.Utils.Broadcast(String.Format(Config.IRCJoinMessageFormat, e.ChannelUser.User.NickName), Color.Yellow);
            }
        }
예제 #4
0
        private void IrcClient_Channel_UserLeft(object sender, IrcChannelUserEventArgs e)
        {
            var channel = (IrcChannel)sender;

            OnChannelUserJoined(channel, e);
        }
예제 #5
0
 protected virtual void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e)
 {
 }
예제 #6
0
 private void IrcClient_Channel_UserLeft(object sender, IrcChannelUserEventArgs e)
 {
     var channel = (IrcChannel) sender;
       Console.WriteLine("[{0}] User {1} left the channel.", channel.Name, e.ChannelUser.User.NickName);
 }
예제 #7
0
 protected override void OnChannelUserLeft(IrcChannel channel, IrcChannelUserEventArgs e)
 {
     //
 }
 protected override void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e)
 {
     SendGreeting(channel.Client.LocalUser, e.ChannelUser.User);
 }
예제 #9
0
        private void ChannelOnUserJoined(object sender, IrcChannelUserEventArgs ircChannelUserEventArgs)
        {
            if (this.HandleUserJoin(ircChannelUserEventArgs.ChannelUser.User.NickName))
            {
                this.Message(
                    "Hello, " + ircChannelUserEventArgs.ChannelUser.User.NickName
                    + ". If you need help may I recommend http://www.octgn.net/help ?");
                this.Message(
                    "If you need to report an issue you can always do that here https://github.com/kellyelton/OCTGN/issues .");
                this.Message("If you feel patient, you can ask you question here. Please be aware that it can take awhile to get a reply, so it is highly recommended to use one of the above methods first.");
            }
            else
            {

            }
            //this.Message("Hello " + ircChannelUserEventArgs.ChannelUser.User.NickName);
        }
예제 #10
0
 void RaceChannel_UserKicked(object sender, IrcChannelUserEventArgs e)
 {
     if (e.ChannelUser.User.NickName == Client.LocalUser.NickName && Kicked != null)
        Kicked(this, null);
 }
예제 #11
0
 void m_channel_UserJoined(object sender, IrcChannelUserEventArgs e)
 {
     CheckModeratorStatus(e.ChannelUser);
 }
예제 #12
0
 private void Form1_UserJoined(object sender, IrcChannelUserEventArgs e)
 {
     client.LocalUser.SendMessage(e.ChannelUser.Channel,"Welcome " + e.ChannelUser);
 }
예제 #13
0
파일: AzureBot.cs 프로젝트: bremnes/IrcBot
 protected override void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e)
 {
     Trace.TraceInformation("OnChannelUserJoined");
 }
예제 #14
0
        private void channelUserLeft(object sender, IrcChannelUserEventArgs e)
        {
            if (this.Settings.AdvertiseParts)
              {
            this.Messages.Add(new Message(String.Format("{0} [{1}] has left {2} [{3}]",
                                                    e.ChannelUser.User.NickName,
                                                    e.ChannelUser.User.HostName,
                                                    e.ChannelUser.Channel.Name,
                                                    e.Comment),
                                      DateTime.Now.ToString(this.Settings.TimestampFormat),
                                      "=!=",
                                      MessageLevels.Part));
              }

              this.Users.Remove(e.ChannelUser);
        }
예제 #15
0
 private void channelUserJoined(object sender, IrcChannelUserEventArgs e)
 {
     if (this.Settings.AdvertiseJoins)
       {
     this.Messages.Add(new Message(String.Format("{0} [{1}] has joined {2}",
                                             e.ChannelUser.User.NickName,
                                             e.ChannelUser.User.HostName,
                                             e.ChannelUser.Channel.Name),
                               DateTime.Now.ToString(this.Settings.TimestampFormat),
                               "=!=",
                               MessageLevels.Join));
       }
       this.Users.Add(e.ChannelUser);
       this.Users.Sort(IrcChannelUserComparison.Compare);
 }
예제 #16
0
 /// <summary>
 /// Raises the <see cref="UserLeft"/> event.
 /// </summary>
 /// <param name="e">The <see cref="IrcChannelUserEventArgs"/> instance containing the event data.</param>
 protected virtual void OnUserLeft(IrcChannelUserEventArgs e)
 {
     var handler = this.UserLeft;
     if (handler != null)
         handler(this, e);
 }
예제 #17
0
 /// <summary>
 /// </summary>
 /// <param name="channel">
 /// </param>
 /// <param name="e">
 /// </param>
 protected abstract void OnChannelUserLeft(IrcChannel channel, IrcChannelUserEventArgs e);
예제 #18
0
 private static void IrcClient_Channel_UserLeft(object sender, IrcChannelUserEventArgs e)
 {
 }
예제 #19
0
 /// <summary>
 ///     Raises the <see cref="UserKicked" /> event.
 /// </summary>
 /// <param name="e">The <see cref="IrcChannelUserEventArgs" /> instance containing the event data.</param>
 protected virtual void OnUserKicked(IrcChannelUserEventArgs e)
 {
     var handler = UserKicked;
     if (handler != null)
         handler(this, e);
 }
예제 #20
0
 protected override void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e)
 {
     if (Properties.Settings.Default.SilentMode.ToString() != "true")
     {
         if (xmlprovider == null)
         {
             xmlprovider = new XMLProvider();
         }
         ReconnectInbound = false;
         if (!e.ChannelUser.User.ToString().ToLower().Contains("andchat"))
         {
             #region whisperstatsonjoin
             NormalisedUser normaliseduser = new NormalisedUser();
             normaliseduser.orig_username = e.ChannelUser.User.ToString();
             IEnumerable<User> joineduser = LUserList.Where(x => x.isUser(normaliseduser.normalised_username()));
             if (joineduser.Count() > 0)
             {
                 Tuple<DateTime, int> VisitData = joineduser.First().visit();
                 string visitstring = "";
                 switch (VisitData.Item2)
                 {
                     case 1: visitstring = VisitData.Item2 + "st"; break;
                     case 2: visitstring = VisitData.Item2 + "nd"; break;
                     case 3: visitstring = VisitData.Item2 + "rd"; break;
                     default: visitstring = VisitData.Item2 + "th"; break;
                 }
                 String days_since_last_visit = DateTime.Now.Subtract(Convert.ToDateTime(VisitData.Item1)).ToString("d' days 'h':'mm':'ss");
                 String output = "This is " + normaliseduser.normalised_username() + "'s " + visitstring + " visit. Their last visit was on " + VisitData.Item1.ToString("dd-MM-yyyy HH:mm:ss") + " (" + days_since_last_visit + " ago)";
                 foreach (var loggingOp in LUserList.Where(x => x.bIsLoggingOp))
                     thisclient.LocalUser.SendNotice(loggingOp.Name, output);
             }
             else
             {
                 String output = "This is " + normaliseduser.normalised_username() + "'s first visit.";
                 foreach (var loggingOp in LUserList.Where(x => x.bIsLoggingOp))
                     thisclient.LocalUser.SendNotice(loggingOp.Name, output);
                 User newUser = new User();
                 XDocument Streams = XDocument.Load(Directory.GetCurrentDirectory() + "/XML/Streams.xml");
                 IEnumerable<XElement> streamchildren = from streams in Streams.Root.Elements() select streams;
                 foreach (var stream in streamchildren)
                 {
                     newUser.addStream(stream.Attribute("Channel").Value, true);
                 }
                 newUser.Name = normaliseduser.normalised_username();
                 newUser.bIsLoggingOp = false;
                 newUser.password = "";
                 newUser.bMessages = false;
                 newUser.visit();
                 LUserList.Add(newUser);
                 // TODO: Suscribe to all streams;
             }
             #endregion
             SaveUserList();
             foreach (string streamname in xmlprovider.OnlineStreamList())
             {
                 string _streamname = streamname.Replace(",", "");
                 User user = getUser(normaliseduser.normalised_username().ToLower());
                 if(user != null)
                 if (user.isSubscribed(_streamname))
                 {
                         thisclient.LocalUser.SendNotice(e.ChannelUser.User.ToString(), String.Format(
                                                     "Stream running: _{0}_ ({1}) at {2}",
                                                     _streamname,
                                                     xmlprovider.StreamInfo(_streamname, "game"),
                                                     xmlprovider.StreamInfo(_streamname, "URL")
                                                     ));
                 }
             }
             normaliseduser = null;
         }
     }
 }
예제 #21
0
 protected override void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e)
 {
     SendGreeting(channel.Client.LocalUser, e.ChannelUser.User);
 }
예제 #22
0
 protected override void OnChannelUserLeft(IrcChannel channel, IrcChannelUserEventArgs e)
 {
     ReconnectInbound = false;
     NormalisedUser normaliseduser = new NormalisedUser();
     normaliseduser.orig_username = e.ChannelUser.User.ToString();
     IEnumerable<User> joineduser = LUserList.Where(x => x.isUser(normaliseduser.normalised_username()));
     if(joineduser.Count() > 0)
     {
         joineduser.First().leave();
     }
 }
예제 #23
0
 private static void IrcClient_Channel_UserJoined(object sender, IrcChannelUserEventArgs e)
 {
     var channel = (IrcChannel)sender;
     Console.WriteLine("[{0}] User {1} joined the channel.", channel.Name, e.ChannelUser.User.NickName);
 }
예제 #24
0
 protected virtual void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e)
 {
 }
예제 #25
0
 private void OnUserLeft(object sender, IrcChannelUserEventArgs e)
 {
     IrcBotUser user;
     this.users.TryRemove(e.ChannelUser.User.NickName, out user);
 }
예제 #26
0
 protected virtual void OnChannelUserLeft(IrcChannel channel, IrcChannelUserEventArgs e)
 {
 }
예제 #27
0
 protected virtual void OnChannelUserLeft(IrcChannel channel, IrcChannelUserEventArgs e)
 {
 }
예제 #28
0
 void m_channel_UserJoined(object sender, IrcChannelUserEventArgs e)
 {
     CheckModeratorStatus(e.ChannelUser);
     e.ChannelUser.ModesChanged += ChannelUser_ModesChanged;
 }
예제 #29
0
파일: mainForm.cs 프로젝트: Foltik/SugoiRC
 private void ircClient_Channel_UserLeft(object sender, IrcChannelUserEventArgs e)
 {
     var channel = (IrcChannel)sender;
     writeLine(e.ChannelUser.User.NickName+" left the channel " +channel.Name);
 }
예제 #30
0
        private void ChannelOnUserLeft(object sender, IrcChannelUserEventArgs e)
        {
            var channel = (IrcChannel)sender;
            var ircUser = e.ChannelUser.User;

            User user = this.GetOrCreateGuestUser(ircUser);

            Parallel.ForEach(this.Modules, module => module.OnUserLeft(user, channel.Name));
        }
예제 #31
0
        void OnChannelLeft(object sender, IrcChannelUserEventArgs e)
        {
            if (Config.IgnoredIRCNicks.Contains(e.ChannelUser.User.NickName))
                return;

            if (String.Equals(e.ChannelUser.Channel.Name, Config.Channel, StringComparison.OrdinalIgnoreCase))
            {
                IrcUsers.Remove(e.ChannelUser.User);
                if (!String.IsNullOrEmpty(Config.IRCLeaveMessageFormat))
                    TShock.Utils.Broadcast(String.Format(Config.IRCLeaveMessageFormat, e.ChannelUser.User.NickName, e.Comment), Color.Yellow);
            }
        }
예제 #32
0
 private void ChannelOnUserLeft(object sender, IrcChannelUserEventArgs ircChannelUserEventArgs)
 {
     Message(ircChannelUserEventArgs.ChannelUser.User.NickName + " was a real dick that year...");
 }
예제 #33
0
 /// <summary>
 /// </summary>
 /// <param name="channel">
 /// </param>
 /// <param name="e">
 /// </param>
 protected abstract void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e);
예제 #34
0
 private void ChannelOnUserJoined(object sender, IrcChannelUserEventArgs ircChannelUserEventArgs)
 {
     this.Message("Hello " + ircChannelUserEventArgs.ChannelUser.User.NickName);
 }
예제 #35
0
        /// <summary>
        /// </summary>
        /// <param name="sender">
        /// </param>
        /// <param name="e">
        /// </param>
        private void IrcClient_Channel_UserLeft(object sender, IrcChannelUserEventArgs e)
        {
            var channel = (IrcChannel)sender;

            this.OnChannelUserJoined(channel, e);
        }
예제 #36
0
 protected override void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e)
 {
 }
 protected override void OnChannelUserLeft(IrcChannel channel, IrcChannelUserEventArgs e)
 {
     //
 }
예제 #38
0
        private static void IrcClient_Channel_UserJoined(object sender, IrcChannelUserEventArgs e)
        {
            var channel = (IrcChannel)sender;

            Console.WriteLine("[{0}] User {1} joined the channel.", channel.Name, e.ChannelUser.User.NickName);
        }