Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.43k stars 382 forks source link

chat achievements code bug >>>Warning Plugin "TShock" has had an unhandled exception thrown by one of its ServerChat handlers: #2661

Closed ATFGK closed 1 year ago

ATFGK commented 2 years ago

TShock version:4.5.18.0

[Server API] Warning Plugin "TShock" has had an unhandled exception thrown by one of its ServerChat handlers: System.NullReferenceException: Object reference not set to an instance of an object. at Terraria.GameContent.UI.Chat.AchievementTagHandler.Terraria.UI.Chat.ITagHandler.Parse(String text, Color baseColor, String options) at Terraria.UI.Chat.ChatManager.ParseMessage(String text, Color baseColor) at TShockAPI.TSServerPlayer.SendConsoleMessage(String msg, Byte red, Byte green, Byte blue) at TShockAPI.TSServerPlayer.SendMessage(String msg, Byte red, Byte green, Byte blue) at TShockAPI.Utils.Broadcast(String msg, Byte red, Byte green, Byte blue) at TShockAPI.TShock.OnChat(ServerChatEventArgs args) at TerrariaApi.Server.HandlerCollection`1.Invoke(ArgsType args) in D:\a\TShock\TShock\TerrariaServerAPI\TerrariaServerAPI\TerrariaApi.Server\HandlerCollection.cs:line 109

ATFGK commented 2 years ago

TShock version:5.0 [Server API] Warning Plugin "TShock" has had an unhandled exception thrown by one of its ServerChat handlers: System.NullReferenceException: Object reference not set to an instance of an object. at Terraria.GameContent.UI.Chat.AchievementTagHandler.Terraria.UI.Chat.ITagHandler.Parse(String text, Color baseColor, String options) at Terraria.UI.Chat.ChatManager.ParseMessage(String text, Color baseColor) at TShockAPI.TSServerPlayer.SendConsoleMessage(String msg, Byte red, Byte green, Byte blue) in /home/runner/work/TShock/TShock/TShockAPI/TSServerPlayer.cs:line 75 at TShockAPI.Utils.Broadcast(String msg, Byte red, Byte green, Byte blue) in /home/runner/work/TShock/TShock/TShockAPI/Utils.cs:line 136 at TShockAPI.TShock.OnChat(ServerChatEventArgs args) in /home/runner/work/TShock/TShock/TShockAPI/TShock.cs:line 1421 at TerrariaApi.Server.HandlerCollection`1.Invoke(ArgsType args) in /home/runner/work/TShock/TShock/TerrariaServerAPI/TerrariaServerAPI/TerrariaApi.Server/HandlerCollection.cs:line 109

ATFGK commented 2 years ago

This bug is caused by [A:TOPPED_OFF] when TShock.Utils.Broadcast

ATFGK commented 2 years ago

when the chat sends achievements code ,100% trigger,such as [A:TOPPED_OFF]

drunderscore commented 1 year ago

Fixed via #2858