mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Player nicks show in tab list. Clicking on names in tab list still adds their original username to chat input.
This commit is contained in:
parent
c17e37315e
commit
abb56f8867
@ -43,7 +43,8 @@ namespace MCGalaxy.Commands.Chatting {
|
|||||||
} else if (action == "titles") {
|
} else if (action == "titles") {
|
||||||
Toggle(p, ref p.Ignores.Titles, "{1}Player titles {0} show before names in chat"); return;
|
Toggle(p, ref p.Ignores.Titles, "{1}Player titles {0} show before names in chat"); return;
|
||||||
} else if (action == "nicks") {
|
} 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") {
|
} else if (action == "8ball") {
|
||||||
Toggle(p, ref p.Ignores.EightBall, "{0} ignoring %T/8ball"); return;
|
Toggle(p, ref p.Ignores.EightBall, "{0} ignoring %T/8ball"); return;
|
||||||
} else if (action == "drawoutput") {
|
} else if (action == "drawoutput") {
|
||||||
|
@ -65,8 +65,10 @@ namespace MCGalaxy.Commands.Chatting {
|
|||||||
|
|
||||||
Chat.MessageFrom(who, "λNICK %Shad their nick set to " + who.color + nick);
|
Chat.MessageFrom(who, "λNICK %Shad their nick set to " + who.color + nick);
|
||||||
who.DisplayName = nick;
|
who.DisplayName = nick;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerDB.Save(who);
|
PlayerDB.Save(who);
|
||||||
|
TabList.Update(who, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
|
@ -36,14 +36,15 @@ namespace MCGalaxy {
|
|||||||
string name, group;
|
string name, group;
|
||||||
GetEntry(p, dst, out name, out 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);
|
group = Colors.Cleanup(group, dst.hasTextColors);
|
||||||
dst.Send(Packet.ExtAddPlayerName(id, p.truename, name, group, grpPerm, dst.hasCP437));
|
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) {
|
static void GetEntry(Player p, Player dst, out string name, out string group) {
|
||||||
group = Server.Config.TablistGlobal ? "On " + p.level.name : "&fPlayers";
|
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);
|
OnTabListEntryAddedEvent.Call(p, ref name, ref group, dst);
|
||||||
|
|
||||||
if (p.hidden && p.IsAfk) { name += " &f(Hid, &7AFK)"; return; }
|
if (p.hidden && p.IsAfk) { name += " &f(Hid, &7AFK)"; return; }
|
||||||
@ -57,7 +58,7 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
string name = b.color + b.name, group = "Bots";
|
string name = b.color + b.name, group = "Bots";
|
||||||
OnTabListEntryAddedEvent.Call(b, ref name, ref group, dst);
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Removes the given player from player's tab list (if their client supports it). </summary>
|
/// <summary> Removes the given player from player's tab list (if their client supports it). </summary>
|
||||||
@ -88,7 +89,7 @@ namespace MCGalaxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Updates the tab list entry for this player to all other players
|
/// <summary> Removes this tab list entry for this player to all other players
|
||||||
/// (whose clients support it) in the server. </summary>
|
/// (whose clients support it) in the server. </summary>
|
||||||
internal static void RemoveAll(Player p, bool self, bool toVisible) {
|
internal static void RemoveAll(Player p, bool self, bool toVisible) {
|
||||||
if (!Server.Config.TablistGlobal) return;
|
if (!Server.Config.TablistGlobal) return;
|
||||||
|
@ -437,7 +437,7 @@ namespace MCGalaxy.Network {
|
|||||||
|
|
||||||
List<string> GetNicks(string channel) {
|
List<string> GetNicks(string channel) {
|
||||||
foreach (var chan in userMap) {
|
foreach (var chan in userMap) {
|
||||||
if (chan.Key.CaselessEq(channel)) return chan.Value;
|
if (chan.Key.CaselessEq(channel)) return chan.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> nicks = new List<string>();
|
List<string> nicks = new List<string>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user