Обновление регулярки для имени персонажа (#36)

This commit is contained in:
Tornado Tech
2024-04-04 21:38:03 +10:00
committed by GitHub
parent 3c2f198567
commit bdfb5a72b9
2 changed files with 7 additions and 1 deletions

View File

@@ -1696,6 +1696,12 @@ namespace Content.Shared.CCVar
public static readonly CVarDef<bool> RestrictedNames =
CVarDef.Create("ic.restricted_names", true, CVar.SERVER | CVar.REPLICATED);
/// <summary>
/// Regis for name validation if enabled RestrictedNames
/// </summary>
public static readonly CVarDef<string> RestrictedNameRegex =
CVarDef.Create("ic.restricted_name_regex", @"[^А-Я,а-я,A-Z,a-z,0-9, -]", CVar.SERVER | CVar.REPLICATED);
/// <summary>
/// Allows flavor text (character descriptions)
/// </summary>

View File

@@ -420,7 +420,7 @@ namespace Content.Shared.Preferences
if (configManager.GetCVar(CCVars.RestrictedNames))
{
name = Regex.Replace(name, @"[^A-Z,a-z,0-9, -]", string.Empty);
name = Regex.Replace(name, configManager.GetCVar(CCVars.RestrictedNameRegex), string.Empty);
}
if (configManager.GetCVar(CCVars.ICNameCase))