diff --git a/MCGalaxy/Commands/Chat/CmdIgnore.cs b/MCGalaxy/Commands/Chat/CmdIgnore.cs index 2e3594c9b..66c99f346 100644 --- a/MCGalaxy/Commands/Chat/CmdIgnore.cs +++ b/MCGalaxy/Commands/Chat/CmdIgnore.cs @@ -43,7 +43,8 @@ namespace MCGalaxy.Commands.Chatting { } else if (action == "titles") { Toggle(p, ref p.Ignores.Titles, "{1}Player titles {0} show before names in chat"); return; } else if (action == "nicks") { - Toggle(p, ref p.Ignores.Nicks, "{1}Custom player nicks {0} show in chat"); return; + Toggle(p, ref p.Ignores.Nicks, "{1}Custom player nicks {0} show in chat"); + TabList.Update(p, true); return; } else if (action == "8ball") { Toggle(p, ref p.Ignores.EightBall, "{0} ignoring %T/8ball"); return; } else if (action == "drawoutput") { diff --git a/MCGalaxy/Commands/Chat/CmdNick.cs b/MCGalaxy/Commands/Chat/CmdNick.cs index f182e3fbb..88551ab60 100644 --- a/MCGalaxy/Commands/Chat/CmdNick.cs +++ b/MCGalaxy/Commands/Chat/CmdNick.cs @@ -65,8 +65,10 @@ namespace MCGalaxy.Commands.Chatting { Chat.MessageFrom(who, "λNICK %Shad their nick set to " + who.color + nick); who.DisplayName = nick; - } + } + PlayerDB.Save(who); + TabList.Update(who, true); } public override void Help(Player p) { diff --git a/MCGalaxy/Entity/TabList.cs b/MCGalaxy/Entity/TabList.cs index 6488408e8..eb5003b48 100644 --- a/MCGalaxy/Entity/TabList.cs +++ b/MCGalaxy/Entity/TabList.cs @@ -36,14 +36,15 @@ namespace MCGalaxy { string name, group; GetEntry(p, dst, out name, out group); - name = Colors.Cleanup(name, dst.hasTextColors); + name = Colors.Escape(name); // for nicks + name = Colors.Cleanup(name, dst.hasTextColors); group = Colors.Cleanup(group, dst.hasTextColors); dst.Send(Packet.ExtAddPlayerName(id, p.truename, name, group, grpPerm, dst.hasCP437)); } static void GetEntry(Player p, Player dst, out string name, out string group) { group = Server.Config.TablistGlobal ? "On " + p.level.name : "&fPlayers"; - name = p.color + p.truename; + name = dst.Ignores.Nicks ? p.color + p.truename : p.ColoredName; OnTabListEntryAddedEvent.Call(p, ref name, ref group, dst); if (p.hidden && p.IsAfk) { name += " &f(Hid, &7AFK)"; return; } @@ -57,7 +58,7 @@ namespace MCGalaxy { string name = b.color + b.name, group = "Bots"; OnTabListEntryAddedEvent.Call(b, ref name, ref group, dst); - dst.Send(Packet.ExtAddPlayerName(b.id, b.SkinName, name, group, 0, dst.hasCP437)); + dst.Send(Packet.ExtAddPlayerName(b.id, b.name, name, group, 0, dst.hasCP437)); } /// Removes the given player from player's tab list (if their client supports it). @@ -88,7 +89,7 @@ namespace MCGalaxy { } } - /// Updates the tab list entry for this player to all other players + /// Removes this tab list entry for this player to all other players /// (whose clients support it) in the server. internal static void RemoveAll(Player p, bool self, bool toVisible) { if (!Server.Config.TablistGlobal) return; diff --git a/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs b/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs index 1fd6a49e1..fee81ebaf 100644 --- a/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs +++ b/MCGalaxy/Network/IRCPlugin/IRCHandlers.cs @@ -437,7 +437,7 @@ namespace MCGalaxy.Network { List GetNicks(string channel) { foreach (var chan in userMap) { - if (chan.Key.CaselessEq(channel)) return chan.Value; + if (chan.Key.CaselessEq(channel)) return chan.Value; } List nicks = new List();