diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 22aa0897..ed40bc9c 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -171,7 +171,7 @@ namespace TShockAPI "Changes ingame chat format: {0} = Group Name, {1} = Group Prefix, {2} = Player Name, {3} = Group Suffix, {4} = Chat Message" )] public string ChatFormat = "{1}{2}{3}: {4}"; - [Description("Change the chat format when using chat above heads. This begins with a player name wrapped in brackets, as per Terraria's formatting. Same formatting as ChatFormat.")] public string ChatAboveHeadsFormat = "{4}"; + [Description("Change the player name when using chat above heads. This begins with a player name wrapped in brackets, as per Terraria's formatting. Same formatting as ChatFormat(minus the text).")] public string ChatAboveHeadsFormat = "{2}"; [Description("Force the world time to be normal, day, or night.")] public string ForceTime = "normal"; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 94b5de26..184e5933 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -966,9 +966,12 @@ namespace TShockAPI } else { - Utils.Broadcast(args.Who, - String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix, - args.Text), tsplr.Group.R, tsplr.Group.G, tsplr.Group.B); + string name = Main.player[args.Who].name; + Main.player[args.Who].name = String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix); + NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, Main.player[args.Who].name, args.Who, 0, 0, 0, 0); + Main.player[args.Who].name = name; + Utils.Broadcast(args.Who, args.Text, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B); + NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, name, args.Who, 0, 0, 0, 0); args.Handled = true; } }