mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
implement GetAnnouncementsByUser
This commit is contained in:
parent
258f3a9fc5
commit
e48858fd01
@ -97,3 +97,4 @@ Then run School of Dragons.
|
||||
- GetAchievementsByUserID (returns an achievement with the provided user ID)
|
||||
- SetAchievementAndGetReward (returns 5 gems)
|
||||
- SetUserAchievementTask (returns a placeholder achievement)
|
||||
- GetAnnouncementsByUser (returns no announcements, but that might be sufficient)
|
||||
|
@ -56,7 +56,8 @@ methods = [
|
||||
'AcceptMission',
|
||||
'GetUserMissionState',
|
||||
'SetAchievementAndGetReward',
|
||||
'SetUserAchievementTask'
|
||||
'SetUserAchievementTask',
|
||||
'GetAnnouncementsByUser'
|
||||
]
|
||||
|
||||
def routable(path):
|
||||
|
@ -41,4 +41,12 @@ public class ItemStoreController : Controller {
|
||||
// TODO
|
||||
return Ok(XmlUtil.ReadResourceXmlString("rankattrib"));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ItemStoreWebService.asmx/GetAnnouncementsByUser")]
|
||||
public IActionResult GetAnnouncements([FromForm] string apiToken, [FromForm] int worldObjectID) {
|
||||
// TODO: This is a placeholder, although this endpoint seems to be only used to send announcements to the user (such as the server shutdown), so this might be sufficient.
|
||||
return Ok(new AnnouncementList());
|
||||
}
|
||||
}
|
||||
|
26
src/Schema/Announcement.cs
Normal file
26
src/Schema/Announcement.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace sodoff.Schema;
|
||||
|
||||
[XmlRoot(ElementName = "Announcement")]
|
||||
[Serializable]
|
||||
public class Announcement
|
||||
{
|
||||
[XmlElement(ElementName = "AnnouncementID")]
|
||||
public int AnnouncementID;
|
||||
|
||||
[XmlElement(ElementName = "Description")]
|
||||
public string Description;
|
||||
|
||||
[XmlElement(ElementName = "AnnouncementText")]
|
||||
public string AnnouncementText;
|
||||
|
||||
[XmlElement(ElementName = "Type")]
|
||||
public AnnouncementType Type;
|
||||
|
||||
[XmlElement(ElementName = "StartDate")]
|
||||
public DateTime StartDate;
|
||||
|
||||
[XmlElement(ElementName = "EndDate", IsNullable = true)]
|
||||
public DateTime? EndDate;
|
||||
}
|
11
src/Schema/AnnouncementList.cs
Normal file
11
src/Schema/AnnouncementList.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace sodoff.Schema;
|
||||
|
||||
[XmlRoot(ElementName = "Announcements", Namespace = "")]
|
||||
[Serializable]
|
||||
public class AnnouncementList
|
||||
{
|
||||
[XmlElement(ElementName = "Announcement")]
|
||||
public Announcement[] Announcements;
|
||||
}
|
22
src/Schema/AnnouncementType.cs
Normal file
22
src/Schema/AnnouncementType.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace sodoff.Schema;
|
||||
|
||||
[Flags]
|
||||
public enum AnnouncementType
|
||||
{
|
||||
[XmlEnum("0")]
|
||||
Unknown = 0,
|
||||
[XmlEnum("1")]
|
||||
Text = 1,
|
||||
[XmlEnum("2")]
|
||||
VoiceOver = 2,
|
||||
[XmlEnum("3")]
|
||||
GeneralText = 3,
|
||||
[XmlEnum("4")]
|
||||
ScavengerText = 4,
|
||||
[XmlEnum("5")]
|
||||
Video = 5,
|
||||
[XmlEnum("6")]
|
||||
EggNapping = 6
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user