mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Partial revert of cc8d5d2: Readd length check
Oversized nicknames can cause bigger issues, so it is desireable to still block them. .Length counts codepoints, not bytes, which means that 10 character Japanese nicknames, which are configurable ingame, should still be allowed.
This commit is contained in:
1 parent
cc8d5d2a45
commit
3f374da44b
1 file changed
+8
@@ -90,6 +90,14 @@ 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))
|
||||
{
|
||||
using var packet = MessageWriter.Get(MessageType.Reliable);
|
||||
|
||||
Reference in new issue
Block a user