Pryaxis / TShock

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

ServerChat unhandled exception console spam #628

Closed 4rz0 closed 10 years ago

4rz0 commented 10 years ago

Every time anyone on my server says something, following message is displayed in the console: [Server API] Warning Plugin "TShock" has had an unhandled exception thrown by one of its ServerChat handlers: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in :0 at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in :0 at System.String.Format (System.String format, System.Object[] args) [0x00000] in :0 at TShockAPI.TShock.OnChat (TerrariaApi.Server.ServerChatEventArgs args) [0x00000] in :0 at TerrariaApi.Server.HandlerCollection`1[TerrariaApi.Server.ServerChatEventArgs].Invoke (TerrariaApi.Server.ServerChatEventArgs args) [0x00000] in :0

Running Release 13 under Ubuntu/mono

Olink commented 10 years ago

Your chatconfig is broken in your config.

4rz0 commented 10 years ago

It is? I actually just changed "EnableChatAboveHeads", but maybe I overlooked something. I'll look into it and report back!

QuiCM commented 10 years ago

Someone else reported this on the forums. Change "ChatAboveHeadsFormat": "{2}", to "ChatAboveHeadsFormat": "{4}",

4rz0 commented 10 years ago

"ChatAboveHeadsFormat" already is on {4} in my config.

Olink commented 10 years ago

{4} is invalid.

4rz0 commented 10 years ago

Good to know. Should be fixed so that initial config doesn't provide invalid values.