style: amend 278c807fa3
This commit is contained in:
parent
e21dfd17ff
commit
9c938bc730
@ -161,13 +161,19 @@ internal sealed class SessionService : BackgroundService, ISessionService
|
|||||||
Span<byte> sessionAddressBytes = stackalloc byte[16];
|
Span<byte> sessionAddressBytes = stackalloc byte[16];
|
||||||
if (!remoteIpAddress.TryWriteBytes(remoteAddressBytes, out _) ||
|
if (!remoteIpAddress.TryWriteBytes(remoteAddressBytes, out _) ||
|
||||||
!session.IpAddress.TryWriteBytes(sessionAddressBytes, out _))
|
!session.IpAddress.TryWriteBytes(sessionAddressBytes, out _))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!remoteAddressBytes.SequenceEqual(sessionAddressBytes))
|
if (!remoteAddressBytes.SequenceEqual(sessionAddressBytes))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (_userService.TryGetUser(session.UserId, out _))
|
if (_userService.TryGetUser(session.UserId, out _))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user