Support for WoJS and SS in GetAnnouncementsByUser

* Add Announcement To Send Player To SanctuaryBabySS In SuperSecret
* Add Announcement for Amphitheater in WoJS
* Announcements are send based on per game resources file

Co-authored-by: Robert Paciorek <robert@opcode.eu.org>
This commit is contained in:
Alan Moon 2024-01-01 16:07:16 -08:00 committed by Robert Paciorek
parent 6a9f2722e1
commit 2f5a589bd4
4 changed files with 46 additions and 1 deletions

View File

@ -74,8 +74,16 @@ public class ItemStoreController : Controller {
[Produces("application/xml")] [Produces("application/xml")]
[Route("ItemStoreWebService.asmx/GetAnnouncementsByUser")] [Route("ItemStoreWebService.asmx/GetAnnouncementsByUser")]
//[VikingSession(UseLock=false)] //[VikingSession(UseLock=false)]
public IActionResult GetAnnouncements([FromForm] int worldObjectID) { public IActionResult GetAnnouncements([FromForm] string apiKey, [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. // 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.
uint gameVersion = ClientVersion.GetVersion(apiKey);
if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0) {
return Ok(XmlUtil.DeserializeXml<AnnouncementList>(XmlUtil.ReadResourceXmlString("announcements_wojs")));
} else if (gameVersion == ClientVersion.SS && worldObjectID == 6) {
return Ok(XmlUtil.DeserializeXml<AnnouncementList>(XmlUtil.ReadResourceXmlString("announcements_ss")));
}
return Ok(new AnnouncementList()); return Ok(new AnnouncementList());
} }
} }

View File

@ -0,0 +1,12 @@
<Announcements>
<Announcement>
<AnnouncementID>1</AnnouncementID>
<Description>SanctuaryBabySS</Description>
<AnnouncementText>[[Message]]=[[Wanna raise and train a Dragon? Go to the Enchanted Sanctuary today!]]
[[SceneName]]=[[SanctuaryBabySS]]
</AnnouncementText>
<Type>3</Type>
<StartDate>2024-02-03</StartDate>
<EndDate>2034-02-04</EndDate>
</Announcement>
</Announcements>

View File

@ -0,0 +1,17 @@
<Announcements>
<Announcement>
<AnnouncementID>10</AnnouncementID>
<Description>Concert Song</Description>
<AnnouncementText>[[Song1]]=[[RS_DATA/PfConcertSong02.unity3d/PfConcertSong02;181;0]]
[[Song2]]=[[RS_DATA/PfConcertSong01.unity3d/PfConcertSong01;189;0]]
[[Song3]]=[[RS_DATA/PfConcertSong03.unity3d/PfConcertSong03;268;0]]
[[Song4]]=[[RS_DATA/PfConcertSong04.unity3d/PfConcertSong04;209;0]]
[[Song5]]=[[RS_DATA/PfConcertSong05.unity3d/PfConcertSong05;61;0]]
[[Song6]]=[[RS_DATA/PfConcertSong06.unity3d/PfConcertSong06;90;0]]
[[Interval]]=[[30]]
</AnnouncementText>
<Type>3</Type>
<StartDate>2024-02-03</StartDate>
<EndDate>2034-02-04</EndDate>
</Announcement>
</Announcements>

View File

@ -61,6 +61,8 @@
<None Remove="Resources\content_blastermovie.xml" /> <None Remove="Resources\content_blastermovie.xml" />
<None Remove="Resources\content_arcade.xml" /> <None Remove="Resources\content_arcade.xml" />
<None Remove="Resources\content_learning.xml" /> <None Remove="Resources\content_learning.xml" />
<None Remove="Resources\announcements_wojs.xml" />
<None Remove="Resources\announcements_ss.xml" />
<None Remove="Resources\profiletags.xml" /> <None Remove="Resources\profiletags.xml" />
<None Remove="Resources\defaulthouse.xml" /> <None Remove="Resources\defaulthouse.xml" />
</ItemGroup> </ItemGroup>
@ -166,6 +168,12 @@
<EmbeddedResource Include="Resources\content_learning.xml"> <EmbeddedResource Include="Resources\content_learning.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Resources\announcements_wojs.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\announcements_ss.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\profiletags.xml"> <EmbeddedResource Include="Resources\profiletags.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource> </EmbeddedResource>