Merge branch 'SoDOff-Project:master' into master

This commit is contained in:
Hipposgrumm 2025-06-22 16:46:34 -06:00 committed by GitHub
commit a74eea66a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 84 additions and 1278 deletions

View File

@ -43,10 +43,10 @@ public class AchievementController : Controller {
//[Produces("application/xml")] //[Produces("application/xml")]
[Route("AchievementWebService.asmx/GetAllRanks")] [Route("AchievementWebService.asmx/GetAllRanks")]
public IActionResult GetAllRanks([FromForm] string apiKey) { public IActionResult GetAllRanks([FromForm] string apiKey) {
uint gameVersion = ClientVersion.GetVersion(apiKey); uint gameID = ClientVersion.GetGameID(apiKey);
if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0) if (gameID == ClientVersion.WoJS)
return Ok(XmlUtil.ReadResourceXmlString("ranks.allranks_wojs")); return Ok(XmlUtil.ReadResourceXmlString("ranks.allranks_wojs"));
if (gameVersion == ClientVersion.MB) if (gameID == ClientVersion.MB)
return Ok(XmlUtil.ReadResourceXmlString("ranks.allranks_mb")); return Ok(XmlUtil.ReadResourceXmlString("ranks.allranks_mb"));
return Ok(XmlUtil.ReadResourceXmlString("ranks.allranks_sod")); return Ok(XmlUtil.ReadResourceXmlString("ranks.allranks_sod"));
} }

View File

@ -529,8 +529,7 @@ public class ContentController : Controller {
raisedPetData.PetTypeID = petTypeID; raisedPetData.PetTypeID = petTypeID;
raisedPetData.RaisedPetID = 0; // Initially make zero, so the db auto-fills raisedPetData.RaisedPetID = 0; // Initially make zero, so the db auto-fills
raisedPetData.EntityID = Guid.Parse(dragonId); raisedPetData.EntityID = Guid.Parse(dragonId);
uint gameVersion = ClientVersion.GetVersion(apiKey); if (ClientVersion.GetGameID(apiKey) != ClientVersion.WoJS)
if (gameVersion > ClientVersion.Max_OldJS || (gameVersion & ClientVersion.WoJS) == 0)
raisedPetData.Name = string.Concat("Dragon-", dragonId.AsSpan(0, 8)); // Start off with a random name (if game isn't WoJS) raisedPetData.Name = string.Concat("Dragon-", dragonId.AsSpan(0, 8)); // Start off with a random name (if game isn't WoJS)
raisedPetData.IsSelected = false; // The api returns false, not sure why raisedPetData.IsSelected = false; // The api returns false, not sure why
raisedPetData.CreateDate = new DateTime(DateTime.Now.Ticks); raisedPetData.CreateDate = new DateTime(DateTime.Now.Ticks);
@ -1428,14 +1427,14 @@ public class ContentController : Controller {
} }
} }
uint gameVersion = ClientVersion.GetVersion(apiKey); uint gameID = ClientVersion.GetGameID(apiKey);
// Send only JumpStart parties to JumpStart // Send only JumpStart parties to JumpStart
if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0 if (gameID == ClientVersion.WoJS
&& (party.Location == "MyNeighborhood" && (party.Location == "MyNeighborhood"
|| party.Location == "MyVIPRoomInt")) { || party.Location == "MyVIPRoomInt")) {
userParties.Add(userParty); userParties.Add(userParty);
// Send only Math Blaster parties to Math Blaster // Send only Math Blaster parties to Math Blaster
} else if (gameVersion == ClientVersion.MB } else if (gameID == ClientVersion.MB
&& party.Location == "MyPodInt") { && party.Location == "MyPodInt") {
userParties.Add(userParty); userParties.Add(userParty);
} }

View File

@ -77,10 +77,10 @@ public class ItemStoreController : Controller {
public IActionResult GetAnnouncements([FromForm] string apiKey, [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); uint gameID = ClientVersion.GetGameID(apiKey);
if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0) { if (gameID == ClientVersion.WoJS) {
return Ok(XmlUtil.DeserializeXml<AnnouncementList>(XmlUtil.ReadResourceXmlString("announcements_wojs"))); return Ok(XmlUtil.DeserializeXml<AnnouncementList>(XmlUtil.ReadResourceXmlString("announcements_wojs")));
} else if (gameVersion == ClientVersion.SS && worldObjectID == 6) { } else if (gameID == ClientVersion.SS && worldObjectID == 6) {
return Ok(XmlUtil.DeserializeXml<AnnouncementList>(XmlUtil.ReadResourceXmlString("announcements_ss"))); return Ok(XmlUtil.DeserializeXml<AnnouncementList>(XmlUtil.ReadResourceXmlString("announcements_ss")));
} }

View File

@ -428,6 +428,7 @@
<int>16160</int> <int>16160</int>
<int>16209</int> <int>16209</int>
<int>16162</int> <int>16162</int>
<int>8443</int>
<!-- runes (~1.2% probability) --> <!-- runes (~1.2% probability) -->
<int>18794</int> <int>18794</int>

File diff suppressed because it is too large Load Diff

View File

@ -12759,7 +12759,6 @@ SoD 3.31 main store section and subsection filtering:
<ii>20742</ii> <ii>20742</ii>
<ii>20785</ii> <ii>20785</ii>
<ii>20432</ii> <ii>20432</ii>
<ii>20833</ii>
<ii>8894</ii> <ii>8894</ii>
<ii>10892</ii> <ii>10892</ii>
<ii>8231</ii> <ii>8231</ii>
@ -13229,6 +13228,18 @@ SoD 3.31 main store section and subsection filtering:
<id>8378</id> <id>8378</id>
<c>10</c> <c>10</c>
</pitem> </pitem>
<ii>9522</ii>
<ii>9523</ii>
<ii>14905</ii>
<ii>14906</ii>
<ii>16657</ii>
<ii>16658</ii>
<ii>18291</ii>
<ii>19003</ii>
<ii>20304</ii>
<ii>20885</ii>
<ii>20833</ii>
<ii>12013</ii>
<ii>17904</ii> <ii>17904</ii>
<ii>17905</ii> <ii>17905</ii>
<ii>17906</ii> <ii>17906</ii>
@ -13263,8 +13274,6 @@ SoD 3.31 main store section and subsection filtering:
<ii>12198</ii> <ii>12198</ii>
<ii>12201</ii> <ii>12201</ii>
<ii>12286</ii> <ii>12286</ii>
<ii>9523</ii>
<ii>9522</ii>
<ii>12287</ii> <ii>12287</ii>
<ii>12363</ii> <ii>12363</ii>
<ii>12364</ii> <ii>12364</ii>
@ -17311,10 +17320,6 @@ SoD 3.31 main store section and subsection filtering:
<sd>2023-05-25T19:00:00</sd> <sd>2023-05-25T19:00:00</sd>
<ed>2023-06-01T11:59:00</ed> <ed>2023-06-01T11:59:00</ed>
</ss> </ss>
<pitem>
<id>8661</id>
<c>1047515</c>
</pitem>
<pitem> <pitem>
<id>9429</id> <id>9429</id>
<c>114184</c> <c>114184</c>
@ -17535,18 +17540,18 @@ SoD 3.31 main store section and subsection filtering:
<ii>20899</ii> <ii>20899</ii>
<ii>20900</ii> <ii>20900</ii>
<ii>20901</ii> <ii>20901</ii>
<ii>20912</ii>
<ii>20902</ii> <ii>20902</ii>
<ii>20903</ii> <ii>20903</ii>
<ii>20904</ii> <ii>20904</ii>
<ii>20913</ii>
<ii>20911</ii>
<ii>20905</ii> <ii>20905</ii>
<ii>20906</ii> <ii>20906</ii>
<ii>20907</ii> <ii>20907</ii>
<ii>20908</ii> <ii>20908</ii>
<ii>20909</ii>
<ii>20911</ii>
<ii>20912</ii>
<ii>20913</ii>
<ii>20914</ii> <ii>20914</ii>
<ii>20909</ii>
<ii>18003</ii> <ii>18003</ii>
<ii>13026</ii> <ii>13026</ii>
<ii>19118</ii> <ii>19118</ii>

View File

@ -73,14 +73,14 @@ namespace sodoff.Services {
} }
public ReadOnlyDictionary<int, int> GetAchievementsGroupIdToTaskId(uint gameVersion) { public ReadOnlyDictionary<int, int> GetAchievementsGroupIdToTaskId(uint gameVersion) {
gameVersion = GameVersionForTasks(gameVersion); gameVersion = ClientVersion.GetGameID(gameVersion);
if (achievementsTasks.ContainsKey(gameVersion)) if (achievementsTasks.ContainsKey(gameVersion))
return achievementsTasks[gameVersion].achievementsGroupIdToTaskId; return achievementsTasks[gameVersion].achievementsGroupIdToTaskId;
return new ReadOnlyDictionary<int, int>(new Dictionary<int, int>()); return new ReadOnlyDictionary<int, int>(new Dictionary<int, int>());
} }
public List<AchievementTaskInfo>? GetAllAchievementTaskInfo(int taskID, uint gameVersion) { public List<AchievementTaskInfo>? GetAllAchievementTaskInfo(int taskID, uint gameVersion) {
gameVersion = GameVersionForTasks(gameVersion); gameVersion = ClientVersion.GetGameID(gameVersion);
if (achievementsTasks.ContainsKey(gameVersion) && achievementsTasks[gameVersion].achievementsRewardByTask.ContainsKey(taskID)) { if (achievementsTasks.ContainsKey(gameVersion) && achievementsTasks[gameVersion].achievementsRewardByTask.ContainsKey(taskID)) {
return achievementsTasks[gameVersion].achievementsRewardByTask[taskID]; return achievementsTasks[gameVersion].achievementsRewardByTask[taskID];
} }
@ -121,13 +121,5 @@ namespace sodoff.Services {
} }
return dragonXP; return dragonXP;
} }
private uint GameVersionForTasks(uint gameVersion) {
// all SoD version of SoD using the same Tasks database
if ((gameVersion & ClientVersion.Min_SoD) == 0xa0000000) return ClientVersion.Min_SoD;
// all version of WoJS (including lands) using the same Tasks database
if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0) return ClientVersion.WoJS;
return gameVersion;
}
} }
} }

View File

@ -13,6 +13,17 @@ public class ClientVersion {
public const uint WoJS_StoryLand = 0x01000400; // World of JumpStart -- Storyland public const uint WoJS_StoryLand = 0x01000400; // World of JumpStart -- Storyland
public const uint WoJS_NewAvatar = 0x01010000; // World of JumpStart with new avatars (e.g. 1.21) public const uint WoJS_NewAvatar = 0x01010000; // World of JumpStart with new avatars (e.g. 1.21)
public static uint GetGameID(uint gameVersion) {
if (gameVersion > ClientVersion.Max_OldJS)
return gameVersion & 0xf0000000;
else
return gameVersion & 0x0f000000;
}
public static uint GetGameID(string apiKey) {
return GetGameID(GetVersion(apiKey));
}
public static uint GetVersion(string apiKey) { public static uint GetVersion(string apiKey) {
if ( if (
apiKey == "b99f695c-7c6e-4e9b-b0f7-22034d799013" || // PC / Windows apiKey == "b99f695c-7c6e-4e9b-b0f7-22034d799013" || // PC / Windows