Minor fixes to server api ban endpoint (#43355)
minor fixes to server api ban endpoint
This commit is contained in:
parent
3c48c0129f
commit
9b099cc12c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue