예제 #1
0
 private static void IrcClient_OnNickChange(object sender, NickChangeEventArgs e)
 {
     world.Penalize(new Penalty()
     {
         PenaltyType = PenaltyType.Nick, Nick = e.OldNickname, NewNick = e.NewNickname, UHost = e.Data.Host
     });
 }
예제 #2
0
 void OnNickChange(object sender, NickChangeEventArgs e)
 {
     Player.GlobalMessage(Server.IRCColour + "[IRC] " + e.OldNickname + "&g is now known as " + Server.IRCColour + e.NewNickname);
     Server.s.Log(Server.IRCColour + "[IRC] " + e.OldNickname + "&g is now known as " + Server.IRCColour + e.NewNickname);
     irc.RfcNames(channel);
     irc.RfcNames(opchannel);
 }
예제 #3
0
파일: IRCBot.cs 프로젝트: blha303/MCDawn
        void OnNickChange(object sender, NickChangeEventArgs e)
        {
            if (e.NewNickname.ToLower().Contains("afk"))
            {
                Player.GlobalMessage(Server.IRCColour + "[IRC] " + e.OldNickname + Server.DefaultColor + " is AFK");
                Server.afkset.Add(e.OldNickname);
            }
            else if (e.NewNickname.ToLower().Contains("away"))
            {
                Player.GlobalMessage(Server.IRCColour + "[IRC] " + e.OldNickname + Server.DefaultColor + " is Away");
                Server.afkset.Add(e.OldNickname);
            }
            else if (Server.afkset.Contains(e.NewNickname))
            {
                Player.GlobalMessage(Server.IRCColour + "[IRC] " + e.NewNickname + Server.DefaultColor + " is no longer away");
                Server.afkset.Remove(e.NewNickname);
            }
            else
            {
                Player.GlobalMessage(Server.IRCColour + "[IRC] " + e.OldNickname + Server.DefaultColor + " is now known as " + e.NewNickname);
            }

            irc.RfcNames(channel);
            irc.RfcNames(opchannel);
        }
예제 #4
0
        private static void OnNickChange(object sender, NickChangeEventArgs e)
        {
            string oldNick = e.OldNickname;
            string newNick = e.NewNickname;

            Users.Remove(oldNick);
            Users.Add(newNick);
            Users.Sort();
            CRCDisplay.UpdateUsers();
            CRCGame.UpdateUsers();
            if (newNick != client.Nickname)
            {
                if (crcNicks.ContainsKey(oldNick))
                {
                    crcNicks[newNick] = crcNicks[oldNick];
                    crcNicks.Remove(oldNick);
                }
                string message = oldNick + CRCStrings.Localize("client_nick_change") + newNick;
                CRCDisplay.AddInformation(message);
                CRCGame.AddInformation(message);
            }
            else
            {
                CRCOptions.Name = newNick;
                string message = CRCStrings.Localize("client_own_nick_change") + newNick;
                CRCDisplay.AddInformation(message);
                CRCGame.AddInformation(message);
            }
        }
예제 #5
0
 void ClientOnNickChange(object sender, NickChangeEventArgs e)
 {
     _events.Enqueue(new IrcEvent {
         Type = IrcEvent.EventType.NickChange, Event = e
     });
     _waitHandle.Set();
 }
예제 #6
0
        /// <summary>
        /// Verarbeitet einen Nickname wechsel
        /// </summary>
        /// <seealso cref="OnNickChange"/>
        private void _connection_OnNickChange(object sender, NickChangeEventArgs e)
        {
            Log.Information("{OldNickname} heißt jetzt {NewNickname}", e.OldNickname, e.NewNickname);
            using (var context = new BotContext())
            {
                User oldNick = context.GetUser(e.OldNickname);
                User newNick = context.GetUser(e.NewNickname);
                if (oldNick != null && newNick == null)
                {
                    oldNick.LastUsedName = new Nickname {
                        Name = e.NewNickname, User = oldNick
                    };
                    context.SaveChanges();
                }
                //else if (oldNick == null && newNick != null)
                //{
                //    newNick.Names.Add(e.OldNickname);
                //    newNick.LastUsedName = e.NewNickname;
                //    context.SaveChanges();
                //}
            }

            ThreadPool.QueueUserWorkItem(x =>
            {
                OnNickChange?.Invoke(this, e);
            });
        }
예제 #7
0
파일: IRCBot.cs 프로젝트: larnin/McWorlds
        void OnNickChange(object sender, NickChangeEventArgs e)
        {
            string key;

            if (e.NewNickname.Split('|').Length == 2)
            {
                key = e.NewNickname.Split('|')[1];
                if (key != null && key != "")
                {
                    switch (key)
                    {
                    case "AFK":
                        Player.GlobalMessage("[IRC] " + Server.IRCColour + e.OldNickname + Server.DefaultColor + " est AFK"); Server.afkset.Add(e.OldNickname); break;

                    case "Away":
                        Player.GlobalMessage("[IRC] " + Server.IRCColour + e.OldNickname + Server.DefaultColor + " is Away"); Server.afkset.Add(e.OldNickname); break;
                    }
                }
            }
            else if (Server.afkset.Contains(e.NewNickname))
            {
                Player.GlobalMessage("[IRC] " + Server.IRCColour + e.NewNickname + Server.DefaultColor + " is no longer away");
                Server.afkset.Remove(e.NewNickname);
            }
            else
            {
                Player.GlobalMessage("[IRC] " + Server.IRCColour + e.OldNickname + Server.DefaultColor + " is now known as " + e.NewNickname);
            }

            irc.RfcNames(channel);
            irc.RfcNames(opchannel);
        }
예제 #8
0
파일: GlobalBot.cs 프로젝트: xeons/MCSong
        void OnNickChange(object sender, NickChangeEventArgs e)
        {
            Player.GlobalMessageGC(Server.gcColor + "[Global] " + e.OldNickname + Server.DefaultColor + " is now known as " + Server.gcColor + e.NewNickname);
            Server.s.LogGC(e.OldNickname + " is now known as " + e.NewNickname);

            irc.RfcNames(channel);
        }
예제 #9
0
 internal void HandleOnNickChange(object sender, NickChangeEventArgs e)
 {
     if (OnNickChange != null)
     {
         OnNickChange(this, e);
     }
 }
        private void NickChangeHandler(object sender, NickChangeEventArgs e)
        {
            lock (seenData)
            {
                var seenResult = seenData.SeenEntries.Where(s => s.Nick == e.OldNickname).FirstOrDefault();

                if (seenResult != null)
                {
                    seenResult.LastSeenTime = DateTime.Now;
                    seenResult.LastAction   = "(NICK) Nick changed to: " + e.NewNickname;
                    seenResult.OnStatus     = false;
                }

                seenResult = seenData.SeenEntries.Where(s => s.Nick == e.NewNickname).FirstOrDefault();
                if (seenResult != null)
                {
                    seenResult.LastSeenTime = DateTime.Now;
                    seenResult.LastAction   = "(NICK) Nick changed from: " + e.OldNickname;
                    seenResult.OnStatus     = true;
                }
                else
                {
                    var seenEntry = new SeenEntry();
                    seenData.SeenEntries.InsertOnSubmit(seenEntry);

                    seenEntry.Nick         = e.NewNickname;
                    seenEntry.LastSeenTime = DateTime.Now;
                    seenEntry.LastAction   = "(NICK) Nick changed from: " + e.OldNickname;
                    seenEntry.LastMessage  = "<no message yet>";
                    seenEntry.TimesSeen    = 0;
                    seenEntry.OnStatus     = true;
                }

                var aliasResult = seenData.AliasEntries.Where(a => a.Nick == e.OldNickname && a.Alias == e.NewNickname).FirstOrDefault();

                if (aliasResult == null)
                {
                    var aliasEntry = new AliasEntry();
                    seenData.AliasEntries.InsertOnSubmit(aliasEntry);

                    aliasEntry.Nick  = e.OldNickname;
                    aliasEntry.Alias = e.NewNickname;
                }

                aliasResult = seenData.AliasEntries.Where(a => a.Nick == e.NewNickname && a.Alias == e.OldNickname).FirstOrDefault();
                if (aliasResult == null)
                {
                    var aliasEntry = new AliasEntry();
                    seenData.AliasEntries.InsertOnSubmit(aliasEntry);

                    aliasEntry.Nick  = e.NewNickname;
                    aliasEntry.Alias = e.OldNickname;
                }

                SaveDb();
            }
        }
예제 #11
0
 private static void OnNickChange(object sender, NickChangeEventArgs e)
 {
     if (!Users.ContainsKey(e.OldNickname))
     {
         return;
     }
     Users.Add(e.NewNickname, Users[e.OldNickname]);
     Users.Remove(e.OldNickname);
 }
예제 #12
0
        public void Server_OnNick(object sender, NickChangeEventArgs e)
        {
            User user = Users.GetUser(e.User);

            if (user != null)
            {
                user.Nick = e.NewNick;
            }
        }
예제 #13
0
 public void OnNickChange(object sender, NickChangeEventArgs e)
 {
     try
     {
         Player.GlobalMessageDevs("To Devs: " + Server.GlobalChatColour + e.OldNickname + Server.DefaultColor + " is now known as " + e.NewNickname + " on " + e.Data.Channel);
         globalchat.RfcNames(channel);
         globalchat.RfcNames(devchannel);
     }
     catch (Exception ex) { Server.ErrorLog(ex); }
 }
예제 #14
0
        // ---------------------------------------------------
        // IRC events related to (possibly) multiple channels.
        // ---------------------------------------------------

        void NickChange(object s, NickChangeEventArgs e)
        {
            foreach (var channel in GetJoinedChannels(e.NewNickname))
            {
                writer.Log(channel,
                           "-!- {0} is now known as {1}", e.OldNickname, e.NewNickname);
            }

            writer.CloseLog(e.OldNickname);
        }
예제 #15
0
파일: frmMain.cs 프로젝트: anon-erebus/LOIC
 void OnNickChange(object sender, NickChangeEventArgs e)
 {
     if (OpList.ContainsKey(e.OldNickname))
     {
         OpList.Remove(e.OldNickname);
     }
     if (!OpList.ContainsKey(e.NewNickname))
     {
         OpList.Add(e.NewNickname, "");
     }
 }
예제 #16
0
        private void Listener_OnNick(object sender, NickChangeEventArgs e)
        {
            OnNick.Fire(this, new NickChangeEventArgs(e.User, e.NewNick));

            foreach (KeyValuePair <string, Channel> item in _channels)
            {
                if (item.Value.HasUser(e.User.Nick))
                {
                    item.Value.NickChange(e.User, e.NewNick);
                }
            }
        }
예제 #17
0
        public void ProcessNickCommand()
        {
            IrcMessage msg = new IrcMessage
            {
                Command = "NICK",
                From    = _userString,
                Message = "Ortz",
                Tokens  = _nick.Split(new[] { ' ' })
            };
            NickChangeEventArgs givenArgs = null;

            _listener.OnNick += delegate(object sender, NickChangeEventArgs args) { givenArgs = args; };
            _listener.ProcessNickCommand(msg);
            Assert.AreEqual(_testUser, givenArgs.User);
            Assert.AreEqual("Ortz", givenArgs.NewNick);
        }
예제 #18
0
 void ClienNickChange(NickChangeEventArgs e)
 {
     if (_iam == e.OldNickname)
     {
         _iam = e.NewNickname;
     }
     else
     {
         var bot = Server.Bot(e.OldNickname);
         if (bot != null)
         {
             bot.Name = e.NewNickname;
             UpdateBot(bot);
         }
     }
 }
예제 #19
0
        void OnNickChange(object sender, NickChangeEventArgs e)
        {
            AddNotification("{0} is now known as {1}.".F(e.OldNickname, e.NewNickname));

            Game.RunAfterTick(() =>
            {
                ChatUser user;
                if (!Users.TryGetValue(e.OldNickname, out user))
                {
                    return;
                }

                Users.Remove(e.OldNickname);
                Users.Add(e.NewNickname, new ChatUser(e.NewNickname, user.IsOp, user.IsVoiced));
            });
        }
예제 #20
0
 void mClient_OnNickChange(object sender, NickChangeEventArgs e)
 {
     AddText(string.Format("*** {0} is now known as {1}", e.OldNickname, e.NewNickname));
     UpdateNames();
 }
예제 #21
0
 private void OnNickChange(object sender, NickChangeEventArgs e)
 {
     AddClientLine(e.OldNickname + " is now known as " + e.NewNickname + ".", Color.DarkBlue);
     AddGameMsg("Information", e.OldNickname + " is now known as " + e.NewNickname + ".");
 }
예제 #22
0
 private void Channel_OnNick(object sender, NickChangeEventArgs ea)
 {
     AddLine(ChannelStrings.NickChange.With(ea.User.Nick, ea.NewNick));
 }
예제 #23
0
 void onIRCNick(object sender, NickChangeEventArgs e)
 {
     messageToVP(true, "", msgNick, e.OldNickname, e.NewNickname);
 }
예제 #24
0
 private void irc_OnNickChange(object sender, NickChangeEventArgs e)
 {
     this.AddChatMsg("# " + e.OldNickname + " is now known as " + e.NewNickname + ".");
     this.irc.RfcNames(Res.IrcChannel);
 }
예제 #25
0
 private void Listener_OnNick(object sender, NickChangeEventArgs e)
 {
     OnNick.Fire(this, new NickChangeEventArgs(e.User, e.NewNick));
 }
 void BotOnNickChange(object sender, NickChangeEventArgs e)
 {
     RemoveNick(e.OldNickname);
     Identified(e.NewNickname);
 }
예제 #27
0
 private void Channel_OnNick(object sender, NickChangeEventArgs e)
 {
     AddMessage(ChannelStrings.NickChange.With(e.User.Nick, e.NewNick));
 }
예제 #28
0
 public void OnNickChange(object sender, NickChangeEventArgs e)
 {
     //Player.GlobalMessageDevsStaff("To Devs/Staff: " + Server.GlobalChatColour + e.OldNickname + Server.DefaultColor + " is now known as " + e.NewNickname);
     globalchat.RfcNames(channel);
 }
 public void PluginsOnNickChange(object sender, NickChangeEventArgs e)
 {
     OnNickChange(this, e);
 }