Implement BlacklistedRange exempt flag (#29258)
* Implement a new kind of ip range ban that only applies to new players * Put determining whether a player record exists to its own function * Make BlacklistedRange bans get bypassed by any ban exemption * Stop trying to get another DbGuard while already having one This does break with convention on the functions in that area but considering the use of this function it's probably fine? I could alternatively just move the place it's called from. Also I was suppossed to wait for tests to finish locally just to be sure, but nah. I am pushing this now
This commit is contained in:
@@ -625,6 +625,11 @@ namespace Content.Server.Database
|
||||
return record == null ? null : MakePlayerRecord(record);
|
||||
}
|
||||
|
||||
protected async Task<bool> PlayerRecordExists(DbGuard db, NetUserId userId)
|
||||
{
|
||||
return await db.DbContext.Player.AnyAsync(p => p.UserId == userId);
|
||||
}
|
||||
|
||||
[return: NotNullIfNotNull(nameof(player))]
|
||||
protected PlayerRecord? MakePlayerRecord(Player? player)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user