add check to determine whether to include color codes when checking name length
This commit is contained in:
parent
e97119211f
commit
d4fb75d07c
@ -457,7 +457,8 @@ namespace SharedLibraryCore.Database.Models
|
|||||||
|
|
||||||
using (LogContext.PushProperty("Server", CurrentServer?.ToString()))
|
using (LogContext.PushProperty("Server", CurrentServer?.ToString()))
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(Name) || CleanedName.Replace(" ", "").Length <
|
var nameToCheck = CurrentServer.IsCodGame() ? CleanedName : Name;
|
||||||
|
if (string.IsNullOrWhiteSpace(Name) || nameToCheck.Replace(" ", "").Length <
|
||||||
(CurrentServer?.Manager?.GetApplicationSettings()?.Configuration()?.MinimumNameLength ?? 3))
|
(CurrentServer?.Manager?.GetApplicationSettings()?.Configuration()?.MinimumNameLength ?? 3))
|
||||||
{
|
{
|
||||||
Utilities.DefaultLogger.LogInformation("Kicking {Client} because their name is too short", ToString());
|
Utilities.DefaultLogger.LogInformation("Kicking {Client} because their name is too short", ToString());
|
||||||
|
@ -186,6 +186,8 @@ namespace SharedLibraryCore
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static bool IsZombieServer(this Server server) => server.GameName == Game.T6 && _zmGameTypes.Contains(server.Gametype.ToLower());
|
public static bool IsZombieServer(this Server server) => server.GameName == Game.T6 && _zmGameTypes.Contains(server.Gametype.ToLower());
|
||||||
|
|
||||||
|
public static bool IsCodGame(this Server server) => server.RconParser?.RConEngine == "COD";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the IW Engine color code corresponding to an admin level
|
/// Get the IW Engine color code corresponding to an admin level
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user