mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
initial support for older clients, tested with 2.9 (#11)
- add GetChildList method - add placeholder fields to respond in GetUserInfoByApiToken and GetUserProfile
This commit is contained in:
parent
207e56602f
commit
4c2dd92969
@ -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)
|
||||
|
@ -65,6 +65,7 @@ methods = [
|
||||
'GetUserActivityByUserID',
|
||||
'SetNextItemState',
|
||||
'SetUserRoom',
|
||||
'GetChildList',
|
||||
'GetUserGameCurrency',
|
||||
'SetAchievementByEntityIDs'
|
||||
]
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -171,6 +171,7 @@ public class ProfileController : Controller {
|
||||
GameCurrency = 1000,
|
||||
CashCurrency = 1000,
|
||||
ActivityCount = 0,
|
||||
BuddyCount = 0,
|
||||
UserGradeData = new UserGrade { UserGradeID = 0 }
|
||||
};
|
||||
}
|
||||
|
10
src/Schema/ChildList.cs
Normal file
10
src/Schema/ChildList.cs
Normal file
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user