Added list of homoglyphs for name comparison

Unicode is now allowed in player names, but it can't be easily exploited anymore
This commit is contained in:
juanjp600
2017-03-02 12:09:08 -03:00
parent 65625777e5
commit ba026a8f88
4 changed files with 1842 additions and 4 deletions
+2 -3
View File
@@ -87,7 +87,7 @@ namespace Barotrauma.Networking
c != '<' &&
c != '/'));
}
public static string SanitizeName(string name)
{
name = name.Trim();
@@ -98,9 +98,8 @@ namespace Barotrauma.Networking
string rName = "";
for (int i=0;i<name.Length;i++)
{
if (name[i] < 32 || name[i] > 126)
if (name[i] < 32)
{
//TODO: allow safe unicode characters, this is just to prevent players from taking names that look similar but aren't the same
rName += '?';
}
else