Remove name length/validity checks from JoinGame

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
This commit is contained in:
miniduikboot committed 2022-01-10 20:54:45 +01:00
1 parent e6a35344c3
commit cc8d5d2a45
1 file changed
+1 -9
@@ -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);