Minor fixes to server api ban endpoint (#43355)

minor fixes to server api ban endpoint
This commit is contained in:
Simon 2026-03-27 23:45:52 +01:00 committed by Coryler
parent 3c48c0129f
commit 9b099cc12c
1 changed files with 6 additions and 1 deletions

View File

@ -342,7 +342,7 @@ public sealed partial class ServerApi : IPostInjectInit
var bans = await _db.GetBansAsync(userId: located.UserId,
address: null,
hwId: null,
modernHWIds: located.LastModernHWIds,
modernHWIds: null,
includeUnbanned: false);
if (bans.Count > 0)
{
@ -372,6 +372,11 @@ public sealed partial class ServerApi : IPostInjectInit
{
info.AddAddress(player.Channel.RemoteEndPoint.Address);
}
else
{
// We fallback into using the located player ip.
info.AddAddress(located.LastAddress);
}
_bans.CreateServerBan(info);
await RespondOk(context);