mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 16:28:50 -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
|
// Authenticate the user
|
||||||
User? user = null;
|
User? user = null;
|
||||||
uint gameVersion = ClientVersion.GetVersion(apiKey);
|
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);
|
user = ctx.Users.FirstOrDefault(e => e.Email == data.UserName);
|
||||||
} else {
|
} else {
|
||||||
user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName);
|
user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName);
|
||||||
|
@ -53,7 +53,7 @@ public class RegistrationController : Controller {
|
|||||||
[Route("v3/RegistrationWebService.asmx/RegisterParent")]
|
[Route("v3/RegistrationWebService.asmx/RegisterParent")]
|
||||||
[DecryptRequest("parentRegistrationData")]
|
[DecryptRequest("parentRegistrationData")]
|
||||||
[EncryptResponse]
|
[EncryptResponse]
|
||||||
public IActionResult RegisterParent() {
|
public IActionResult RegisterParent([FromForm] string apiKey) {
|
||||||
ParentRegistrationData data = XmlUtil.DeserializeXml<ParentRegistrationData>(Request.Form["parentRegistrationData"]);
|
ParentRegistrationData data = XmlUtil.DeserializeXml<ParentRegistrationData>(Request.Form["parentRegistrationData"]);
|
||||||
User u = new User {
|
User u = new User {
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
@ -74,6 +74,19 @@ public class RegistrationController : Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx.Users.Add(u);
|
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();
|
ctx.SaveChanges();
|
||||||
|
|
||||||
ParentLoginInfo pli = new ParentLoginInfo {
|
ParentLoginInfo pli = new ParentLoginInfo {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user