Обновление регулярки для имени персонажа (#36)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user