Fix Jexius's font exploit.

This commit is contained in:
Deathmax 2011-07-09 21:17:54 +08:00
parent 0b6777ba85
commit 1cd0f4c74b
5 changed files with 25 additions and 1 deletions

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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 {
}
}
/// <summary>
/// Looks up a localized string similar to !&quot;#$%&amp;&apos;()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…///†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©.
/// </summary>
internal static string mousefontchars {
get {
return ResourceManager.GetString("mousefontchars", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to #format
///#ip group

View file

@ -124,6 +124,9 @@
<data name="itembans" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>config\itembans.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="mousefontchars" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>config\mousefontchars.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="users" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>config\users.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>

View file

@ -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");

View file

@ -135,6 +135,7 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="config\mousefontchars.txt" />
<Content Include="config\itembans.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View file

@ -0,0 +1 @@
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©