mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 08:28:39 +00:00
Rework parsing to check against GameVersion enum and game token GameVersion
This commit is contained in:
parent
63b61d831c
commit
b77b7b3fb9
3 changed files with 28 additions and 13 deletions
|
@ -67,14 +67,6 @@ public class LoginController : ControllerBase
|
|||
|
||||
UserEntity? user;
|
||||
|
||||
if (ServerConfiguration.Instance.Authentication.RequirePatchworkUserAgent)
|
||||
{
|
||||
if (!PatchworkHelper.UserHasValidPatchworkUserAgent(this.Request.Headers.UserAgent.ToString()))
|
||||
{
|
||||
return this.Forbid();
|
||||
}
|
||||
}
|
||||
|
||||
switch (npTicket.Platform)
|
||||
{
|
||||
case Platform.RPCS3:
|
||||
|
@ -221,6 +213,14 @@ public class LoginController : ControllerBase
|
|||
return this.Forbid();
|
||||
}
|
||||
|
||||
if (ServerConfiguration.Instance.Authentication.RequirePatchworkUserAgent)
|
||||
{
|
||||
if (!PatchworkHelper.UserHasValidPatchworkUserAgent(token, this.Request.Headers.UserAgent.ToString()))
|
||||
{
|
||||
return this.Forbid();
|
||||
}
|
||||
}
|
||||
|
||||
Logger.Success($"Successfully logged in user {user.Username} as {token.GameVersion} client", LogArea.Login);
|
||||
|
||||
user.LastLogin = TimeHelper.TimestampMillis;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue