diff --git a/README.md b/README.md index 68b092f..afc55f1 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ By default (modifiable in appsettings.json), files for version 2.5.0 and newer w A sample file is provided for `{PLATFORM} = WIN`, `{VERSION} = 3.31.0`. It assumes that the server address are `localhost:5000` (API) and `localhost:5001` (assets). +To use this server with games other than School of Dragons you need to change the `LoadNonSoDData` value in `appsettings.json` to `true`. + #### Asset Server Various settings for the asset server are customizable, with the key one being `ProviderURL`, which specifies the source for downloading assets in `partial` mode. By default, it's configured to use archive.org diff --git a/src/Configuration/ApiServerConfig.cs b/src/Configuration/ApiServerConfig.cs index 58b079b..958c3e8 100644 --- a/src/Configuration/ApiServerConfig.cs +++ b/src/Configuration/ApiServerConfig.cs @@ -5,6 +5,8 @@ public class ApiServerConfig { public string MMOAdress { get; set; } = "127.0.0.1"; public int MMOPort { get; set; } = 9933; public uint MMOSupportMinVersion { get; set; } = 0; + + public bool LoadNonSoDData { get; set; } = false; public DbProviders DbProvider { get; set; } = DbProviders.SQLite; public string DbPath { get; set; } = string.Empty; diff --git a/src/Controllers/Common/ContentController.cs b/src/Controllers/Common/ContentController.cs index 27063cb..ea98d23 100644 --- a/src/Controllers/Common/ContentController.cs +++ b/src/Controllers/Common/ContentController.cs @@ -15,6 +15,7 @@ public class ContentController : Controller { private readonly DBContext ctx; private KeyValueService keyValueService; private ItemService itemService; + private MissionStoreSingleton missionStore; private MissionService missionService; private RoomService roomService; private AchievementService achievementService; @@ -30,6 +31,7 @@ public class ContentController : Controller { DBContext ctx, KeyValueService keyValueService, ItemService itemService, + MissionStoreSingleton missionStore, MissionService missionService, RoomService roomService, AchievementService achievementService, @@ -43,6 +45,7 @@ public class ContentController : Controller { this.ctx = ctx; this.keyValueService = keyValueService; this.itemService = itemService; + this.missionStore = missionStore; this.missionService = missionService; this.roomService = roomService; this.achievementService = achievementService; @@ -2134,14 +2137,15 @@ public class ContentController : Controller { [Route("MissionWebService.asmx/GetMission")] // old ("step") missions - used by MB and WoJS lands public IActionResult GetMission([FromForm] int gameId, [FromForm] int type) { if (gameId == 1) return Ok(XmlUtil.ReadResourceXmlString("missions.step_missions_wojs_al")); + if (gameId == 5) return Ok(XmlUtil.ReadResourceXmlString("missions.step_missions_mb")); return Ok(); } [HttpPost] - // [Produces("application/xml")] + [Produces("application/xml")] [Route("MissionWebService.asmx/GetStep")] // old ("step") missions - used by MB and WoJS lands public IActionResult GetMissionStep([FromForm] int stepId) { - return Ok(System.IO.File.ReadAllText($"./Resources/missions/steps/{stepId}.xml")); + return Ok(missionStore.GetStep(stepId)); } [HttpPost] diff --git a/src/Resources/missions/step_missions_mb.xml b/src/Resources/missions/step_missions_mb.xml new file mode 100644 index 0000000..d3613a6 --- /dev/null +++ b/src/Resources/missions/step_missions_mb.xml @@ -0,0 +1,101 @@ + + + + 189 + Rescue a Larva + ADOPT A PET TO RAISE AND TRAIN. + + ADOPT A PET TO RAISE AND TRAIN. + -1 + + + 326 + 505 + + + + 213 + Larva Attachment + Play and Feed your larva + + Lets get emotionally attached to the larva + -1 + + DlgGCM213End + GC + RS_DATA/MBDirectedM213.unity3d + + + 350 + 529 + + + 351 + 530 + + + 354 + 533 + 534 + + + + 215 + MB Boy Visit Mutt Pod + Go to your Mutt Pod + + Visit Mutt Pod Boy + -1 + + DlgGCM215End + GC + RS_DATA/MBDirectedM215.unity3d + + + 358 + 539 + + + 360 + 541 + + + + 217 + MB Boy Visit Pod + Go to your Pod + + Visit Pod Boy + -1 + + DlgGCM217End + GC + RS_DATA/MBDirectedM217.unity3d + + + 366 + 547 + + + 368 + 549 + + + 370 + 551 + + + + 220 + MB Boy Play Hyperblast + Play Hyperblast + + Play Hyperblast Boy + -1 + + + 373 + 554 + + + \ No newline at end of file diff --git a/src/Resources/missions/step_missions_steps.xml b/src/Resources/missions/step_missions_steps.xml new file mode 100644 index 0000000..255dd96 --- /dev/null +++ b/src/Resources/missions/step_missions_steps.xml @@ -0,0 +1,23706 @@ + + + + 1 + + DlgFrankieS1Offer + NPCs.unity3d/PfFrankie + RS_DATA/DlgsAdventureM01S01.unity3d + + + DlgFrankieS1End + NPCs.unity3d/PfFrankie + RS_DATA/DlgsAdventureM01S01.unity3d + + -1 + + 1 + Visit + + GrpTiMis01St01 + TrainingIsland + + DlgEleanorT1Help + NPCs.unity3d/PfEleanor + RS_DATA/DlgsAdventureM01S01.unity3d + + + DlgPierreT1Help + NPCs.unity3d/PfPierre + RS_DATA/DlgsAdventureM01S01.unity3d + + 0 +