mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
some fixes to PR
* remove unnecessary deserialize - serialize * use EmbeddedResource to read missions and badges files * remove dead (and commented out) code * define missing database model relation in DBContext.cs * revert unrelated changes
This commit is contained in:
parent
23e63320f2
commit
0e5437c5b7
@ -2122,105 +2122,77 @@ public class ContentController : Controller {
|
||||
return Ok(new TreasureChestData());
|
||||
}
|
||||
|
||||
//Oh boy it's the AL code stuff you guys ready for p a i n
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("MissionWebService.asmx/GetWorldId")] // used by Math Blaster and WoJS Adventureland
|
||||
public IActionResult GetWorldId([FromForm] int gameId, [FromForm] string sceneName, [FromForm] string apiKey)
|
||||
{
|
||||
var result = worldIdService.GetWorldID(sceneName);
|
||||
return Ok(result);
|
||||
public IActionResult GetWorldId([FromForm] int gameId, [FromForm] string sceneName) {
|
||||
return Ok(worldIdService.GetWorldID(sceneName));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
// [Produces("application/xml")]
|
||||
[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"));
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
// [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"));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/GetUserMission")] // old ("step") missions - used by MB and WoJS lands
|
||||
[VikingSession]
|
||||
public IActionResult GetUserMission(Viking viking, [FromForm] int worldId) {
|
||||
return Ok(missionService.GetUserMissionData(viking, worldId));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/SetUserMission")] // old ("step") missions - used by MB and WoJS lands
|
||||
[VikingSession]
|
||||
public IActionResult SetUserMission(Viking viking, [FromForm] int worldId, [FromForm] int missionId, [FromForm] int stepId, [FromForm] int taskId) {
|
||||
missionService.SetOrUpdateUserMissionData(viking, worldId, missionId, stepId, taskId);
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/SetUserMissionComplete")] // old ("step") missions - used by MB and WoJS lands
|
||||
[VikingSession]
|
||||
public IActionResult SetUserMissionComplete(Viking viking, [FromForm] int worldId, [FromForm] int missionId) {
|
||||
return Ok(missionService.SetUserMissionCompleted(viking, worldId, missionId, true));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
//[Produces("application/xml")]
|
||||
[Route("MissionWebService.asmx/GetBadge")]
|
||||
public IActionResult GetBadge([FromForm] int gameId)
|
||||
{
|
||||
if (gameId == 1) return Ok(System.IO.File.ReadAllText("./Resources/missions/badge_wojs_al.xml"));
|
||||
return Ok(); // if it doesn't work/causes errors then: return Ok(XmlUtil.SerializeXml(new BadgeData()));
|
||||
[Route("MissionWebService.asmx/GetBadge")] // old ("step") missions - used by MB and WoJS lands
|
||||
public IActionResult GetBadge([FromForm] int gameId) {
|
||||
if (gameId == 1) return Ok(XmlUtil.ReadResourceXmlString("missions.badge_wojs_al.xml"));
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("MissionWebService.asmx/GetMission")]
|
||||
public IActionResult GetMission([FromForm] int gameId, [FromForm] int type, [FromForm] string apiKey)
|
||||
{
|
||||
MissionData mission = missionService.GetMissionDataFromFile(ClientVersion.GetVersion(apiKey), gameId, type);
|
||||
if (mission != null) return Ok(mission);
|
||||
else return Ok(new MissionData());
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/GetUserMission")]
|
||||
[Route("ContentWebService.asmx/SetUserBadgeComplete")] // old ("step") missions - used by MB and WoJS lands
|
||||
[VikingSession]
|
||||
public IActionResult GetUserMission(Viking viking, [FromForm] int worldId, [FromForm] string apiKey)
|
||||
{
|
||||
//if (ClientVersion.GetVersion(apiKey) <= ClientVersion.WoJS_AdvLand)
|
||||
//{
|
||||
return Ok(missionService.GetUserMissionData(viking, worldId));
|
||||
//}
|
||||
|
||||
return Ok(new Schema.UserMissionData());
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/SetUserMission")]
|
||||
[VikingSession]
|
||||
public IActionResult SetUserMission(Viking viking, [FromForm] int worldId, [FromForm] int missionId, [FromForm] int stepId, [FromForm] int taskId, [FromForm] string apiKey)
|
||||
{
|
||||
//if (ClientVersion.GetVersion(apiKey) <= ClientVersion.WoJS_AdvLand)
|
||||
//{
|
||||
missionService.SetOrUpdateUserMissionData(viking, worldId, missionId, stepId, taskId);
|
||||
return Ok(true); // assuming true or false response here
|
||||
//}
|
||||
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/SetUserMissionComplete")]
|
||||
[VikingSession]
|
||||
public IActionResult SetUserMissionComplete(Viking viking, [FromForm] int worldId, [FromForm] int missionId, [FromForm] string apiKey)
|
||||
{
|
||||
//if (ClientVersion.GetVersion(apiKey) <= ClientVersion.WoJS_AdvLand)
|
||||
//{
|
||||
return Ok(missionService.SetUserMissionCompleted(viking, worldId, missionId, true));
|
||||
//}
|
||||
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/SetUserBadgeComplete")]
|
||||
[VikingSession]
|
||||
public IActionResult SetUserBadgeComplete(Viking viking, [FromForm] int badgeId)
|
||||
{
|
||||
public IActionResult SetUserBadgeComplete(Viking viking, [FromForm] int badgeId) {
|
||||
return Ok(missionService.SetUserBadgeComplete(viking, badgeId));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/GetUserBadgeComplete")]
|
||||
[Route("ContentWebService.asmx/GetUserBadgeComplete")] // old ("step") missions - used by MB and WoJS lands
|
||||
[VikingSession]
|
||||
public IActionResult GetUserBadgeComplete(Viking viking)
|
||||
{
|
||||
public IActionResult GetUserBadgeComplete(Viking viking) {
|
||||
return Ok(missionService.GetUserBadgesCompleted(viking));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("MissionWebService.asmx/GetStep")]
|
||||
public IActionResult GetMissionStep([FromForm] int stepId, [FromForm] string apiKey)
|
||||
{
|
||||
return Ok(missionService.GetMissionStepFromFile(ClientVersion.GetVersion(apiKey), stepId));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Produces("application/xml")]
|
||||
[Route("ContentWebService.asmx/GetRevealIndex")] // used by World Of Jumpstart (Learning Games)
|
||||
|
@ -3,8 +3,7 @@ using Microsoft.Extensions.Options;
|
||||
using sodoff.Configuration;
|
||||
|
||||
namespace sodoff.Model;
|
||||
public class DBContext : DbContext
|
||||
{
|
||||
public class DBContext : DbContext {
|
||||
public DbSet<User> Users { get; set; } = null!;
|
||||
public DbSet<Viking> Vikings { get; set; } = null!;
|
||||
public DbSet<Dragon> Dragons { get; set; } = null!;
|
||||
@ -34,26 +33,24 @@ public class DBContext : DbContext
|
||||
|
||||
private readonly IOptions<ApiServerConfig> config;
|
||||
|
||||
public DBContext(IOptions<ApiServerConfig> config)
|
||||
{
|
||||
public DBContext(IOptions<ApiServerConfig> config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
#if USE_POSTGRESQL
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
|
||||
#if USE_POSTGRESQL
|
||||
if (config.Value.DbProvider == DbProviders.PostgreSQL) {
|
||||
optionsBuilder.UseNpgsql(config.Value.DbConnection).UseLazyLoadingProxies();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if USE_MYSQL
|
||||
#endif
|
||||
#if USE_MYSQL
|
||||
if (config.Value.DbProvider == DbProviders.MySQL) {
|
||||
optionsBuilder.UseMySQL(config.Value.DbConnection).UseLazyLoadingProxies();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if USE_SQLITE
|
||||
#endif
|
||||
#if USE_SQLITE
|
||||
if (config.Value.DbProvider == DbProviders.SQLite) {
|
||||
string DbPath;
|
||||
if (String.IsNullOrEmpty(config.Value.DbPath)) {
|
||||
@ -64,12 +61,11 @@ public class DBContext : DbContext
|
||||
optionsBuilder.UseSqlite($"Data Source={DbPath}").UseLazyLoadingProxies();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
throw new Exception($"Unsupported DbProvider {config.Value.DbProvider}");
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
protected override void OnModelCreating(ModelBuilder builder) {
|
||||
// Sessions
|
||||
builder.Entity<Session>().HasOne(s => s.User)
|
||||
.WithMany(e => e.Sessions)
|
||||
@ -154,6 +150,12 @@ public class DBContext : DbContext
|
||||
builder.Entity<Viking>().HasMany(v => v.Ratings)
|
||||
.WithOne(r => r.Viking);
|
||||
|
||||
builder.Entity<Viking>().HasMany(v => v.UserMissions)
|
||||
.WithOne(r => r.Viking);
|
||||
|
||||
builder.Entity<Viking>().HasMany(v => v.UserBadgesCompleted)
|
||||
.WithOne(r => r.Viking);
|
||||
|
||||
// Dragons
|
||||
builder.Entity<Dragon>().HasOne(d => d.Viking)
|
||||
.WithMany(e => e.Dragons)
|
||||
@ -290,5 +292,14 @@ public class DBContext : DbContext
|
||||
|
||||
builder.Entity<RatingRank>().HasMany(rr => rr.Ratings)
|
||||
.WithOne(r => r.Rank);
|
||||
|
||||
// old ("step") missions
|
||||
builder.Entity<UserMissionData>().HasOne(r => r.Viking)
|
||||
.WithMany(v => v.UserMissions)
|
||||
.HasForeignKey(r => r.VikingId);
|
||||
|
||||
builder.Entity<UserBadgeCompleteData>().HasOne(r => r.Viking)
|
||||
.WithMany(v => v.UserBadgesCompleted)
|
||||
.HasForeignKey(r => r.VikingId);
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,7 @@ using sodoff.Schema;
|
||||
namespace sodoff.Model;
|
||||
|
||||
[Index(nameof(Uid))]
|
||||
public class Viking
|
||||
{
|
||||
public class Viking {
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
|
@ -41,7 +41,6 @@ builder.Services.AddScoped<GameDataService>();
|
||||
builder.Services.AddScoped<ProfileService>();
|
||||
builder.Services.AddScoped<NeighborhoodService>();
|
||||
|
||||
|
||||
bool assetServer = builder.Configuration.GetSection("AssetServer").GetValue<bool>("Enabled");
|
||||
string assetIP = builder.Configuration.GetSection("AssetServer").GetValue<string>("ListenIP");
|
||||
int assetPort = builder.Configuration.GetSection("AssetServer").GetValue<int>("Port");
|
||||
|
@ -1,497 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MissionData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Mission>
|
||||
<MissionID>4</MissionID>
|
||||
<Name>Lost Island Mission 1</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Welcome to Training Island</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>1</StepID>
|
||||
<TaskID>1</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>2</StepID>
|
||||
<TaskID>2</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>3</StepID>
|
||||
<TaskID>3</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>4</StepID>
|
||||
<TaskID>4</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>5</StepID>
|
||||
<TaskID>5</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>179</StepID>
|
||||
<TaskID>349</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>6</StepID>
|
||||
<TaskID>6</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>7</StepID>
|
||||
<TaskID>7</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>8</StepID>
|
||||
<TaskID>8</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>9</StepID>
|
||||
<TaskID>9</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>10</StepID>
|
||||
<TaskID>10</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>23</StepID>
|
||||
<TaskID>18</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>24</StepID>
|
||||
<TaskID>19</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>18</MissionID>
|
||||
<Name>Lost Island Mission 2</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 2- Congrats! Take the ship to Lost Island and get familar with home base.</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>26</StepID>
|
||||
<TaskID>250</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>27</StepID>
|
||||
<TaskID>251</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>28</StepID>
|
||||
<TaskID>252</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>106</StepID>
|
||||
<TaskID>348</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>29</StepID>
|
||||
<TaskID>253</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>30</StepID>
|
||||
<TaskID>254</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>31</StepID>
|
||||
<TaskID>255</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>32</StepID>
|
||||
<TaskID>256</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>33</StepID>
|
||||
<TaskID>257</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>19</MissionID>
|
||||
<Name>Lost Island Mission 3</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 3- Introduction to Lost Shores</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>34</StepID>
|
||||
<TaskID>258</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>35</StepID>
|
||||
<TaskID>259</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>36</StepID>
|
||||
<TaskID>260</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>37</StepID>
|
||||
<TaskID>261</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>38</StepID>
|
||||
<TaskID>262</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>39</StepID>
|
||||
<TaskID>263</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>40</StepID>
|
||||
<TaskID>264</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>20</MissionID>
|
||||
<Name>Lost Island Mission 4</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 4- Explore Lost Island and intro to the store</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>41</StepID>
|
||||
<TaskID>265</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>42</StepID>
|
||||
<TaskID>266</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>43</StepID>
|
||||
<TaskID>267</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>44</StepID>
|
||||
<TaskID>268</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>45</StepID>
|
||||
<TaskID>269</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>21</MissionID>
|
||||
<Name>Lost Island Mission 5</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 5- Explore the mountain with Hops</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>46</StepID>
|
||||
<TaskID>270</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>47</StepID>
|
||||
<TaskID>271</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>48</StepID>
|
||||
<TaskID>272</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>49</StepID>
|
||||
<TaskID>273</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>50</StepID>
|
||||
<TaskID>274</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>51</StepID>
|
||||
<TaskID>275</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>22</MissionID>
|
||||
<Name>Lost Island Mission 6</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 6- Punk Punk invade- Time to clean house</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>52</StepID>
|
||||
<TaskID>276</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>53</StepID>
|
||||
<TaskID>277</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>54</StepID>
|
||||
<TaskID>278</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>55</StepID>
|
||||
<TaskID>279</TaskID>
|
||||
<TaskID>280</TaskID>
|
||||
<TaskID>281</TaskID>
|
||||
<TaskID>282</TaskID>
|
||||
<TaskID>283</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>56</StepID>
|
||||
<TaskID>284</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>57</StepID>
|
||||
<TaskID>285</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>58</StepID>
|
||||
<TaskID>286</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>23</MissionID>
|
||||
<Name>Lost Island Mission 7</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 7- Get the Lost Shores ready for the celebration</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>59</StepID>
|
||||
<TaskID>287</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>60</StepID>
|
||||
<TaskID>288</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>61</StepID>
|
||||
<TaskID>289</TaskID>
|
||||
<TaskID>290</TaskID>
|
||||
<TaskID>291</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>62</StepID>
|
||||
<TaskID>292</TaskID>
|
||||
<TaskID>293</TaskID>
|
||||
<TaskID>294</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>63</StepID>
|
||||
<TaskID>295</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>64</StepID>
|
||||
<TaskID>296</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>65</StepID>
|
||||
<TaskID>297</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>66</StepID>
|
||||
<TaskID>298</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>67</StepID>
|
||||
<TaskID>299</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>24</MissionID>
|
||||
<Name>Lost Island Mission 8</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 8- Lets Party</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>68</StepID>
|
||||
<TaskID>300</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>69</StepID>
|
||||
<TaskID>301</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>70</StepID>
|
||||
<TaskID>302</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>71</StepID>
|
||||
<TaskID>303</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>72</StepID>
|
||||
<TaskID>304</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>73</StepID>
|
||||
<TaskID>305</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>74</StepID>
|
||||
<TaskID>306</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>75</StepID>
|
||||
<TaskID>307</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>76</StepID>
|
||||
<TaskID>308</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>77</StepID>
|
||||
<TaskID>309</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>78</StepID>
|
||||
<TaskID>310</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>25</MissionID>
|
||||
<Name>Lost Island Mission 9</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 9- Find where Punk Punks are coming from.</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>79</StepID>
|
||||
<TaskID>311</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>80</StepID>
|
||||
<TaskID>312</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>81</StepID>
|
||||
<TaskID>313</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>82</StepID>
|
||||
<TaskID>314</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>83</StepID>
|
||||
<TaskID>315</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>84</StepID>
|
||||
<TaskID>316</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>85</StepID>
|
||||
<TaskID>317</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>26</MissionID>
|
||||
<Name>Lost Island Mission 10</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 10- Introduce Rabbit holes and get statue</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>86</StepID>
|
||||
<TaskID>318</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>87</StepID>
|
||||
<TaskID>319</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>88</StepID>
|
||||
<TaskID>320</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>89</StepID>
|
||||
<TaskID>321</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>90</StepID>
|
||||
<TaskID>322</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>91</StepID>
|
||||
<TaskID>323</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>92</StepID>
|
||||
<TaskID>324</TaskID>
|
||||
<TaskID>325</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>93</StepID>
|
||||
<TaskID>326</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>27</MissionID>
|
||||
<Name>Lost Island Mission 11</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 11- Protect Lost Island from the Punk Punks</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>94</StepID>
|
||||
<TaskID>327</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>95</StepID>
|
||||
<TaskID>328</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>96</StepID>
|
||||
<TaskID>329</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>97</StepID>
|
||||
<TaskID>330</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>98</StepID>
|
||||
<TaskID>331</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>99</StepID>
|
||||
<TaskID>332</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>100</StepID>
|
||||
<TaskID>333</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
<Mission>
|
||||
<MissionID>28</MissionID>
|
||||
<Name>Lost Island Mission 12</Name>
|
||||
<DisplayName xsi:nil="true" />
|
||||
<IconName xsi:nil="true" />
|
||||
<Description>Mission 12- Need to take the statue back to the valley</Description>
|
||||
<Experience>1</Experience>
|
||||
<RewardDialog xsi:nil="true" />
|
||||
<Step>
|
||||
<StepID>101</StepID>
|
||||
<TaskID>334</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>102</StepID>
|
||||
<TaskID>335</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>103</StepID>
|
||||
<TaskID>336</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>104</StepID>
|
||||
<TaskID>338</TaskID>
|
||||
</Step>
|
||||
<Step>
|
||||
<StepID>105</StepID>
|
||||
<TaskID>339</TaskID>
|
||||
</Step>
|
||||
</Mission>
|
||||
</MissionData>
|
||||
|
@ -9,43 +9,33 @@ namespace sodoff.Schema
|
||||
[XmlElement(ElementName = "TaskID")]
|
||||
public int TaskID;
|
||||
|
||||
// Token: 0x0400043C RID: 1084
|
||||
[XmlElement(ElementName = "Type")]
|
||||
public string Type;
|
||||
|
||||
// Token: 0x0400043D RID: 1085
|
||||
[XmlElement(ElementName = "Dialog", IsNullable = true)]
|
||||
public StepTaskDialog Dialog;
|
||||
|
||||
// Token: 0x0400043E RID: 1086
|
||||
[XmlElement(ElementName = "Message")]
|
||||
public StepTaskMessage[] Message;
|
||||
|
||||
// Token: 0x0400043F RID: 1087
|
||||
[XmlElement(ElementName = "SetupGroup", IsNullable = true)]
|
||||
public string SetupGroup;
|
||||
|
||||
// Token: 0x04000440 RID: 1088
|
||||
[XmlElement(ElementName = "SetupScene", IsNullable = true)]
|
||||
public string SetupScene;
|
||||
|
||||
// Token: 0x04000441 RID: 1089
|
||||
[XmlElement(ElementName = "Help")]
|
||||
public StepTaskHelp[] Help;
|
||||
|
||||
// Token: 0x04000442 RID: 1090
|
||||
[XmlElement(ElementName = "RewardPlayerItem")]
|
||||
public StepTaskRewardPlayerItem[] RewardPlayerItem;
|
||||
|
||||
// Token: 0x04000443 RID: 1091
|
||||
[XmlElement(ElementName = "Experience")]
|
||||
public int Experience;
|
||||
|
||||
// Token: 0x04000444 RID: 1092
|
||||
[XmlElement(ElementName = "Time", IsNullable = true)]
|
||||
public int? Time;
|
||||
|
||||
// Token: 0x04000445 RID: 1093
|
||||
[XmlElement(ElementName = "Objective")]
|
||||
public StepTaskObjective Objective;
|
||||
}
|
||||
|
@ -9,63 +9,48 @@ namespace sodoff.Schema
|
||||
[XmlElement(ElementName = "Beacon", IsNullable = true)]
|
||||
public bool? Beacon;
|
||||
|
||||
// Token: 0x0400045B RID: 1115
|
||||
[XmlElement(ElementName = "NPC", IsNullable = true)]
|
||||
public string NPC;
|
||||
|
||||
// Token: 0x0400045C RID: 1116
|
||||
[XmlElement(ElementName = "Marker", IsNullable = true)]
|
||||
public string Marker;
|
||||
|
||||
// Token: 0x0400045D RID: 1117
|
||||
[XmlElement(ElementName = "Scene", IsNullable = true)]
|
||||
public string Scene;
|
||||
|
||||
// Token: 0x0400045E RID: 1118
|
||||
[XmlElement(ElementName = "Range", IsNullable = true)]
|
||||
public float? Range;
|
||||
|
||||
// Token: 0x0400045F RID: 1119
|
||||
[XmlElement(ElementName = "Module", IsNullable = true)]
|
||||
public string Module;
|
||||
|
||||
// Token: 0x04000460 RID: 1120
|
||||
[XmlElement(ElementName = "Group", IsNullable = true)]
|
||||
public string Group;
|
||||
|
||||
// Token: 0x04000461 RID: 1121
|
||||
[XmlElement(ElementName = "Object", IsNullable = true)]
|
||||
public string Object;
|
||||
|
||||
// Token: 0x04000462 RID: 1122
|
||||
[XmlElement(ElementName = "StoreID", IsNullable = true)]
|
||||
public int? StoreID;
|
||||
|
||||
// Token: 0x04000463 RID: 1123
|
||||
[XmlElement(ElementName = "ItemID", IsNullable = true)]
|
||||
public int? ItemID;
|
||||
|
||||
// Token: 0x04000464 RID: 1124
|
||||
[XmlElement(ElementName = "ItemName", IsNullable = true)]
|
||||
public string ItemName;
|
||||
|
||||
// Token: 0x04000465 RID: 1125
|
||||
[XmlElement(ElementName = "CategoryID", IsNullable = true)]
|
||||
public int? CategoryID;
|
||||
|
||||
// Token: 0x04000466 RID: 1126
|
||||
[XmlElement(ElementName = "AttributeID")]
|
||||
public int[] AttributeID;
|
||||
|
||||
// Token: 0x04000467 RID: 1127
|
||||
[XmlElement(ElementName = "Quantity", IsNullable = true)]
|
||||
public int? Quantity;
|
||||
|
||||
// Token: 0x04000468 RID: 1128
|
||||
[XmlElement(ElementName = "Photo", IsNullable = true)]
|
||||
public StepTaskObjectivePhoto Photo;
|
||||
|
||||
// Token: 0x04000469 RID: 1129
|
||||
[XmlElement(ElementName = "Creative", IsNullable = true)]
|
||||
public StepTaskObjectiveCreative Creative;
|
||||
}
|
||||
|
@ -54,26 +54,6 @@ public class MissionService {
|
||||
return mission;
|
||||
}
|
||||
|
||||
public MissionData GetMissionDataFromFile(uint gameVersion, int gameId, int type)
|
||||
{
|
||||
//if (gameVersion <= ClientVersion.WoJS_AdvLand)
|
||||
//{
|
||||
return XmlUtil.DeserializeXml<MissionData>(File.ReadAllText($"./Resources/missions/stepsmissions_{gameId}_{type}.xml"));
|
||||
//}
|
||||
|
||||
return new MissionData();
|
||||
}
|
||||
|
||||
public Step GetMissionStepFromFile(uint gameVersion, int id)
|
||||
{
|
||||
//if (gameVersion <= ClientVersion.WoJS_AdvLand)
|
||||
//{
|
||||
return XmlUtil.DeserializeXml<Step>(File.ReadAllText($"./Resources/missions/steps/{id}.xml"));
|
||||
//}
|
||||
|
||||
return new Step();
|
||||
}
|
||||
|
||||
public Schema.UserMissionData GetUserMissionData(Viking viking, int worldId)
|
||||
{
|
||||
Schema.UserMissionData umdRes = new Schema.UserMissionData();
|
||||
|
@ -3,15 +3,12 @@ using sodoff.Util;
|
||||
|
||||
namespace sodoff.Services;
|
||||
|
||||
|
||||
public class WorldIdService {
|
||||
|
||||
Dictionary<string, int> worlds_id = new();
|
||||
|
||||
public WorldIdService()
|
||||
{
|
||||
var worlds = XmlUtil.DeserializeXml<World[]>(XmlUtil.ReadResourceXmlString("worlds"));
|
||||
//Console.WriteLine("We are confirming this thing works");
|
||||
foreach (var w in worlds)
|
||||
{
|
||||
worlds_id[w.Scene] = w.ID;
|
||||
@ -20,7 +17,6 @@ public class WorldIdService {
|
||||
|
||||
public int GetWorldID(string mapName)
|
||||
{
|
||||
//Console.WriteLine(worlds_id[mapName]);
|
||||
if (worlds_id.ContainsKey(mapName))
|
||||
return worlds_id[mapName];
|
||||
else
|
||||
|
@ -139,10 +139,16 @@
|
||||
<EmbeddedResource Include="Resources\profiletags.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\defaulthouse.xml">
|
||||
<EmbeddedResource Include="Resources\defaulthouse.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\worlds.xml">
|
||||
<EmbeddedResource Include="Resources\worlds.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\missions\step_missions_wojs_al.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\missions\badge_wojs_al.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user