diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Login/LoginController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Login/LoginController.cs index 7a483463..b51da021 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Login/LoginController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Login/LoginController.cs @@ -130,6 +130,23 @@ public class LoginController : ControllerBase Logger.Warn($"Unknown user tried to connect username={username}", LogArea.Login); return this.Forbid(); } + + // Block RPCN signups if forbidden in config + if (npTicket.Platform == Platform.RPCS3 && !ServerConfiguration.Instance.Authentication.AllowRPCNSignup) + { + Logger.Warn( + $"New user tried to sign up via RPCN, and that is forbidden in the config, username={username}, remoteIpAddress={remoteIpAddress}", + LogArea.Login); + } + + // Block PSN signups if forbidden in config + if (npTicket.Platform == Platform.RPCS3 && !ServerConfiguration.Instance.Authentication.AllowPSNSignup) + { + Logger.Warn( + $"New user tried to sign up via PSN, and that is forbidden in the config, username={username}, remoteIpAddress={remoteIpAddress}", + LogArea.Login); + } + // create account for user if they don't exist user = await this.database.CreateUser(username, "$"); user.Password = null; diff --git a/ProjectLighthouse/Configuration/ConfigurationCategories/AuthenticationConfiguration.cs b/ProjectLighthouse/Configuration/ConfigurationCategories/AuthenticationConfiguration.cs index 76989aa2..4c3abb36 100644 --- a/ProjectLighthouse/Configuration/ConfigurationCategories/AuthenticationConfiguration.cs +++ b/ProjectLighthouse/Configuration/ConfigurationCategories/AuthenticationConfiguration.cs @@ -5,4 +5,9 @@ public class AuthenticationConfiguration public bool RegistrationEnabled { get; set; } = true; public bool AutomaticAccountCreation { get; set; } = true; public bool VerifyTickets { get; set; } = true; + + public bool AllowRPCNSignup { get; set; } = true; + + public bool AllowPSNSignup { get; set; } = true; + } \ No newline at end of file