diff --git a/src/Controllers/Common/AuthenticationController.cs b/src/Controllers/Common/AuthenticationController.cs index 04a6342..fce21ce 100644 --- a/src/Controllers/Common/AuthenticationController.cs +++ b/src/Controllers/Common/AuthenticationController.cs @@ -39,7 +39,7 @@ public class AuthenticationController : Controller { // Authenticate the user User? user = null; uint gameVersion = ClientVersion.GetVersion(apiKey); - if (gameVersion == ClientVersion.WoJS) { + if (gameVersion == ClientVersion.WoJS || gameVersion == ClientVersion.MB) { user = ctx.Users.FirstOrDefault(e => e.Email == data.UserName); } else { user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName); diff --git a/src/Controllers/Common/RegistrationController.cs b/src/Controllers/Common/RegistrationController.cs index 9be9e86..f0b99bf 100644 --- a/src/Controllers/Common/RegistrationController.cs +++ b/src/Controllers/Common/RegistrationController.cs @@ -53,7 +53,7 @@ public class RegistrationController : Controller { [Route("v3/RegistrationWebService.asmx/RegisterParent")] [DecryptRequest("parentRegistrationData")] [EncryptResponse] - public IActionResult RegisterParent() { + public IActionResult RegisterParent([FromForm] string apiKey) { ParentRegistrationData data = XmlUtil.DeserializeXml(Request.Form["parentRegistrationData"]); User u = new User { Id = Guid.NewGuid(), @@ -74,6 +74,19 @@ public class RegistrationController : Controller { } ctx.Users.Add(u); + + if(gameVersion == ClientVersion.MB) { + Viking v = new Viking { + Uid = Guid.NewGuid(), + Name = data.ChildList[0].ChildName, + User = u, + InventoryItems = new List(), + AchievementPoints = new List(), + Rooms = new List() + }; + ctx.Vikings.Add(v); + } + ctx.SaveChanges(); ParentLoginInfo pli = new ParentLoginInfo {