Merge pull request #455 from miniduikboot/fix/i18n-nicknames

Fix/i18n nicknames
This commit is contained in:
miniduikboot authored and GitHub committed 2022-01-27 19:23:30 +01:00
commit 6a8f089576
2 files changed
+14 -2

No files matched your search

+13 -1
View File
@@ -4,7 +4,19 @@
{
public static bool IsCharAllowed(char i)
{
return i == ' ' || (i >= 'A' && i <= 'Z') || (i >= 'a' && i <= 'z') || (i >= '0' && i <= '9') || (i >= 'À' && i <= 'ÿ') || (i >= 'Ѐ' && i <= 'џ') || (i >= 'ㄱ' && i <= 'ㆎ') || (i >= '가' && i <= '힣');
return i == ' ' ||
(i >= 'A' && i <= 'Z') ||
(i >= 'a' && i <= 'z') ||
(i >= '0' && i <= '9') ||
// U+00C0 to U+00FF (Latin-1 Supplement)
(i >= 'À' && i <= 'ÿ') ||
// U+0400 to U+045F (Cyrillic)
(i >= 'Ѐ' && i <= 'џ') ||
// U+2C61 to U+D7A3 (CJK)
(i >= 'ⱡ' && i <= '힣');
}
}
}
@@ -98,7 +98,7 @@ namespace Impostor.Server.Net.Manager
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);