403 user at login instead of logging out at /announce

This commit is contained in:
FeTetra 2025-05-25 22:49:39 -04:00
commit b84bf02373
4 changed files with 11 additions and 36 deletions

View file

@ -3,6 +3,7 @@ using LBPUnion.ProjectLighthouse.Configuration;
using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Extensions;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Servers.GameServer.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Tickets;
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
@ -66,6 +67,11 @@ public class LoginController : ControllerBase
UserEntity? user;
if (!PatchworkHelper.UserHasValidPatchworkUserAgent(this.Request.Headers.UserAgent.ToString()))
{
return this.Forbid();
}
switch (npTicket.Platform)
{
case Platform.RPCS3:
@ -214,6 +220,8 @@ public class LoginController : ControllerBase
Logger.Success($"Successfully logged in user {user.Username} as {token.GameVersion} client", LogArea.Login);
user.LastLogin = TimeHelper.TimestampMillis;
await database.SaveChangesAsync();
// Create a new room on LBP2/3/Vita