]> git.deb.at Git - rhonda/impostor.git/commitdiff
Remove name length/validity checks from JoinGame
authorminiduikboot <mini@duikbo.at>
Mon, 10 Jan 2022 19:47:19 +0000 (20:47 +0100)
committerminiduikboot <mini@duikbo.at>
Mon, 10 Jan 2022 19:54:45 +0000 (20:54 +0100)
Length and validity are checked also checked by the anticheat. In case
Impostor goes out of sync with the allowed characters again, this can
just be fixed by disabling the Anticheat.

Check for NullOrWhiteSpace is kept because an empty username could be annoying

src/Impostor.Server/Net/Manager/ClientManager.cs

index 37ae45e4b21f7c3af3e47a057a6bf46b5388444f..d25e5a1a782981868180f5d94b6a440e0250697b 100644 (file)
@@ -90,15 +90,7 @@ namespace Impostor.Server.Net.Manager
                 return;
             }
 
-            if (name.Length > 10)
-            {
-                using var packet = MessageWriter.Get(MessageType.Reliable);
-                Message01JoinGameS2C.SerializeError(packet, false, DisconnectReason.Custom, DisconnectMessages.UsernameLength);
-                await connection.SendAsync(packet);
-                return;
-            }
-
-            if (string.IsNullOrWhiteSpace(name) || !name.All(TextBox.IsCharAllowed))
+            if (string.IsNullOrWhiteSpace(name))
             {
                 using var packet = MessageWriter.Get(MessageType.Reliable);
                 Message01JoinGameS2C.SerializeError(packet, false, DisconnectReason.Custom, DisconnectMessages.UsernameIllegalCharacters);