Update AuthenticationController.cs

This commit is contained in:
HaiFire3344 2025-07-05 21:33:34 -04:00 committed by GitHub
parent 1a6db72d7a
commit 4dadd43680
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -179,7 +179,7 @@ public class AuthenticationController : Controller {
[Route("AuthenticationWebService.asmx/LoginChild")]
[DecryptRequest("childUserID")]
[EncryptResponse]
public IActionResult LoginChild([FromForm] Guid parentApiToken, [FromForm] string apiKey) {
public IActionResult LoginChild([FromForm] Guid parentApiToken) {
User? user = ctx.Sessions.FirstOrDefault(e => e.ApiToken == parentApiToken)?.User;
if (user is null) {
return Unauthorized();
@ -192,19 +192,6 @@ public class AuthenticationController : Controller {
return Unauthorized();
}
uint gameVersion = ClientVersion.GetVersion(apiKey);
if (viking.GameVersion is null)
viking.GameVersion = gameVersion;
if (
(viking.GameVersion != gameVersion) &&
!(viking.GameVersion >= ClientVersion.Min_SoD && gameVersion >= ClientVersion.Min_SoD) &&
!(viking.GameVersion >= ClientVersion.WoJS && gameVersion >= ClientVersion.WoJS && viking.GameVersion < ClientVersion.WoJS_NewAvatar && gameVersion < ClientVersion.WoJS_NewAvatar)
)
return Unauthorized();
// do not let players log into users from other games, exceptions:
// 1) different version of SoD
// 2) WoJS with old avatar and lands
// Check if user is viking parent
if (user != viking.User) {
return Unauthorized();