(a410fd46c) Trying to help the merge script through a jungle of merges

This commit is contained in:
Joonas Rikkonen
2019-06-04 16:19:53 +03:00
parent 5208b922d8
commit bea7b58ff3
84 changed files with 1720 additions and 929 deletions
@@ -7,6 +7,8 @@ namespace Barotrauma.Networking
{
partial class Client : IDisposable
{
public const int MaxNameLength = 20;
public string Name;
public byte ID;
@@ -205,6 +207,21 @@ namespace Barotrauma.Networking
SetPermissions(permissions, permittedCommands);
}
public static string SanitizeName(string name)
{
name = name.Trim();
if (name.Length > MaxNameLength)
{
name = name.Substring(0, MaxNameLength);
}
string rName = "";
for (int i = 0; i < name.Length; i++)
{
rName += name[i] < 32 ? '?' : name[i];
}
return rName;
}
public void Dispose()
{
DisposeProjSpecific();