mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
fix registration in Math Blaster
This commit is contained in:
parent
7189f049e8
commit
b2220ccfdb
@ -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);
|
||||
|
@ -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<ParentRegistrationData>(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<InventoryItem>(),
|
||||
AchievementPoints = new List<AchievementPoints>(),
|
||||
Rooms = new List<Room>()
|
||||
};
|
||||
ctx.Vikings.Add(v);
|
||||
}
|
||||
|
||||
ctx.SaveChanges();
|
||||
|
||||
ParentLoginInfo pli = new ParentLoginInfo {
|
||||
|
Loading…
x
Reference in New Issue
Block a user