Role bans (#6703)
This commit is contained in:
@@ -41,14 +41,15 @@ namespace Content.Server.Database
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
// ReSharper disable once CommentTypo
|
||||
// ReSharper disable once StringLiteralTypo
|
||||
// ReSharper disable StringLiteralTypo
|
||||
// Enforce that an address cannot be IPv6-mapped IPv4.
|
||||
// So that IPv4 addresses are consistent between separate-socket and dual-stack socket modes.
|
||||
modelBuilder.Entity<ServerBan>()
|
||||
.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address");
|
||||
|
||||
// ReSharper disable once StringLiteralTypo
|
||||
modelBuilder.Entity<ServerRoleBan>()
|
||||
.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address");
|
||||
|
||||
modelBuilder.Entity<Player>()
|
||||
.HasCheckConstraint("LastSeenAddressNotIPv6MappedIPv4",
|
||||
"NOT inet '::ffff:0.0.0.0/96' >>= last_seen_address");
|
||||
@@ -56,6 +57,7 @@ namespace Content.Server.Database
|
||||
modelBuilder.Entity<ConnectionLog>()
|
||||
.HasCheckConstraint("AddressNotIPv6MappedIPv4",
|
||||
"NOT inet '::ffff:0.0.0.0/96' >>= address");
|
||||
// ReSharper restore StringLiteralTypo
|
||||
|
||||
foreach(var entity in modelBuilder.Model.GetEntityTypes())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user