diff --git a/README.md b/README.md index a261605..7f384c1 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Then run School of Dragons. - GetUserActiveMissionState - GetUserUpcomingMissionState - GetUserCompletedMissionState +- GetChildList #### Implemented enough (probably) - GetRules (doesn't return any rules, probably doesn't need to) diff --git a/mitm-redirect.py b/mitm-redirect.py index 503c6bf..2117d35 100644 --- a/mitm-redirect.py +++ b/mitm-redirect.py @@ -65,6 +65,7 @@ methods = [ 'GetUserActivityByUserID', 'SetNextItemState', 'SetUserRoom', + 'GetChildList', 'GetUserGameCurrency', 'SetAchievementByEntityIDs' ] diff --git a/src/Controllers/Common/AuthenticationController.cs b/src/Controllers/Common/AuthenticationController.cs index 8407287..7e4ae8f 100644 --- a/src/Controllers/Common/AuthenticationController.cs +++ b/src/Controllers/Common/AuthenticationController.cs @@ -92,6 +92,8 @@ public class AuthenticationController : Controller { return Ok(new UserInfo { UserID = user.Id, Username = user.Username, + MembershipID = "ef84db9-59c6-4950-b8ea-bbc1521f899b", // placeholder + FacebookUserID = 0, MultiplayerEnabled = true, Age = 24, OpenChatEnabled = true diff --git a/src/Controllers/Common/MembershipController.cs b/src/Controllers/Common/MembershipController.cs index 4c299bc..05c5937 100644 --- a/src/Controllers/Common/MembershipController.cs +++ b/src/Controllers/Common/MembershipController.cs @@ -21,4 +21,22 @@ public class MembershipController : Controller { SubscriptionEndDate = new DateTime(2033, 6, 13, 16, 17, 18) }); } + + [HttpPost] + [Produces("application/xml")] + [Route("MembershipWebService.asmx/GetChildList")] + public IActionResult GetChildList([FromForm] string apiToken) { + User? user = ctx.Sessions.FirstOrDefault(e => e.ApiToken == apiToken)?.User; + if (user is null) + // TODO: what response for not logged in? + return null; + + if (user.Vikings.Count <= 0) + return null; + + ChildList profiles = new ChildList(); + profiles.strings = user.Vikings.Select(viking => viking.Id + ", " + viking.Name).ToArray(); + + return Ok(profiles); + } } diff --git a/src/Controllers/Common/ProfileController.cs b/src/Controllers/Common/ProfileController.cs index 83cc25b..8bc6c43 100644 --- a/src/Controllers/Common/ProfileController.cs +++ b/src/Controllers/Common/ProfileController.cs @@ -171,6 +171,7 @@ public class ProfileController : Controller { GameCurrency = 1000, CashCurrency = 1000, ActivityCount = 0, + BuddyCount = 0, UserGradeData = new UserGrade { UserGradeID = 0 } }; } diff --git a/src/Schema/ChildList.cs b/src/Schema/ChildList.cs new file mode 100644 index 0000000..22dfb06 --- /dev/null +++ b/src/Schema/ChildList.cs @@ -0,0 +1,10 @@ +using System.Xml.Serialization; + +namespace sodoff.Schema; + +[XmlRoot(ElementName = "ArrayOfString", Namespace = "http://api.jumpstart.com/")] +[Serializable] +public class ChildList { + [XmlElement(ElementName = "string")] + public string[] strings; +}