Hacked clients can't send chat messages from other characters anymore

Also added sendername as userdata in chat messages, for now it's not used for anything but we'll probably find something where this is useful
This commit is contained in:
juanjp600
2016-08-30 17:35:58 -03:00
parent 07398be97e
commit 52270e3a35
7 changed files with 73 additions and 45 deletions

View File

@@ -93,17 +93,17 @@ namespace Barotrauma.Networking
name = name.Substring(0, 20);
}
string rName = "";
for (int i=0;i<name.Length;i++)
{
if (name[i] < 32 || name[i] > 126)
{
//TODO: allow safe unicode characters, this is just to prevent players from taking names that look similar but aren't the same
rName += '?';
}
else
{
rName += name[i];
}
for (int i=0;i<name.Length;i++)
{
if (name[i] < 32 || name[i] > 126)
{
//TODO: allow safe unicode characters, this is just to prevent players from taking names that look similar but aren't the same
rName += '?';
}
else
{
rName += name[i];
}
}
return rName;
@@ -125,7 +125,7 @@ namespace Barotrauma.Networking
}
public bool HasPermission(ClientPermissions permission)
{
{
return false; //Permissions.HasFlag(permission);
}