mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Merge pull request #455 from miniduikboot/fix/i18n-nicknames
Fix/i18n nicknames
This commit is contained in:
2 files changed
+14
-2
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user