diff --git a/TShockAPI/Resources.Designer.cs b/TShockAPI/Resources.Designer.cs index 34060646..466bc4f2 100644 --- a/TShockAPI/Resources.Designer.cs +++ b/TShockAPI/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.235 +// Runtime Version:4.0.30319.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -91,6 +91,15 @@ namespace TShockAPI { } } + /// + /// Looks up a localized string similar to !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…///†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©. + /// + internal static string mousefontchars { + get { + return ResourceManager.GetString("mousefontchars", resourceCulture); + } + } + /// /// Looks up a localized string similar to #format ///#ip group diff --git a/TShockAPI/Resources.resx b/TShockAPI/Resources.resx index 21b8b3ab..7aca9391 100644 --- a/TShockAPI/Resources.resx +++ b/TShockAPI/Resources.resx @@ -124,6 +124,9 @@ config\itembans.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + config\mousefontchars.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + config\users.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index ae52c4b8..a94b4d31 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -319,6 +319,16 @@ namespace TShockAPI return; } + foreach (var character in text) + { + if (Resources.mousefontchars.IndexOf(character) == -1) + { + Tools.HandleCheater(tsplr, "Attempted to crash clients"); + e.Handled = true; + return; + } + } + if (msg.whoAmI != ply) { e.Handled = Tools.HandleGriefer(tsplr, "Faking Chat"); diff --git a/TShockAPI/TShockAPI.csproj b/TShockAPI/TShockAPI.csproj index 5ecf8d47..a2cc337c 100644 --- a/TShockAPI/TShockAPI.csproj +++ b/TShockAPI/TShockAPI.csproj @@ -135,6 +135,7 @@ + diff --git a/TShockAPI/config/mousefontchars.txt b/TShockAPI/config/mousefontchars.txt new file mode 100644 index 00000000..326a1642 --- /dev/null +++ b/TShockAPI/config/mousefontchars.txt @@ -0,0 +1 @@ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨© \ No newline at end of file