first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using System.ComponentModel.DataAnnotations;
using System.Text.RegularExpressions;
namespace Nitrox.Launcher.Models.Validators;
public sealed partial class NitroxWorldSeedAttribute : TypedValidationAttribute<string>
{
[GeneratedRegex(@"^[a-zA-Z]{10}$")]
private static partial Regex NitroxWorldSeedRegex { get; }
protected override ValidationResult IsValid(string value, ValidationContext context)
{
if (string.IsNullOrEmpty(value) || NitroxWorldSeedRegex.IsMatch(value))
{
return ValidationResult.Success;
}
return new ValidationResult($"The field {context.DisplayName} must contain 10 alphabetical characters.");
}
}