diff --git a/Subsurface/Source/Networking/Client.cs b/Subsurface/Source/Networking/Client.cs index 449a7ded8..0b3c17f03 100644 --- a/Subsurface/Source/Networking/Client.cs +++ b/Subsurface/Source/Networking/Client.cs @@ -92,8 +92,21 @@ namespace Barotrauma.Networking { name = name.Substring(0, 20); } + string rName = ""; + for (int i=0;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 name; + return rName; } public void SetPermissions(ClientPermissions permissions) diff --git a/Subsurface/Source/Networking/GameServerLogin.cs b/Subsurface/Source/Networking/GameServerLogin.cs index 5b0e54df3..c57d774e9 100644 --- a/Subsurface/Source/Networking/GameServerLogin.cs +++ b/Subsurface/Source/Networking/GameServerLogin.cs @@ -75,6 +75,7 @@ namespace Barotrauma.Networking else { inc.SenderConnection.Disconnect("Authentication failed"); + return; } DebugConsole.NewMessage("New player has joined the server", Color.White);