mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
Merge branch 'SoDOff-Project:master' into master
This commit is contained in:
commit
a74eea66a4
@ -43,10 +43,10 @@ public class AchievementController : Controller {
|
||||
//[Produces("application/xml")]
|
||||
[Route("AchievementWebService.asmx/GetAllRanks")]
|
||||
public IActionResult GetAllRanks([FromForm] string apiKey) {
|
||||
uint gameVersion = ClientVersion.GetVersion(apiKey);
|
||||
if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0)
|
||||
uint gameID = ClientVersion.GetGameID(apiKey);
|
||||
if (gameID == ClientVersion.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_sod"));
|
||||
}
|
||||
|
@ -529,8 +529,7 @@ public class ContentController : Controller {
|
||||
raisedPetData.PetTypeID = petTypeID;
|
||||
raisedPetData.RaisedPetID = 0; // Initially make zero, so the db auto-fills
|
||||
raisedPetData.EntityID = Guid.Parse(dragonId);
|
||||
uint gameVersion = ClientVersion.GetVersion(apiKey);
|
||||
if (gameVersion > ClientVersion.Max_OldJS || (gameVersion & ClientVersion.WoJS) == 0)
|
||||
if (ClientVersion.GetGameID(apiKey) != ClientVersion.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.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
|
||||
if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0
|
||||
if (gameID == ClientVersion.WoJS
|
||||
&& (party.Location == "MyNeighborhood"
|
||||
|| party.Location == "MyVIPRoomInt")) {
|
||||
userParties.Add(userParty);
|
||||
// Send only Math Blaster parties to Math Blaster
|
||||
} else if (gameVersion == ClientVersion.MB
|
||||
} else if (gameID == ClientVersion.MB
|
||||
&& party.Location == "MyPodInt") {
|
||||
userParties.Add(userParty);
|
||||
}
|
||||
|
@ -77,10 +77,10 @@ public class ItemStoreController : Controller {
|
||||
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.
|
||||
|
||||
uint gameVersion = ClientVersion.GetVersion(apiKey);
|
||||
if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0) {
|
||||
uint gameID = ClientVersion.GetGameID(apiKey);
|
||||
if (gameID == ClientVersion.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")));
|
||||
}
|
||||
|
||||
|
@ -428,6 +428,7 @@
|
||||
<int>16160</int>
|
||||
<int>16209</int>
|
||||
<int>16162</int>
|
||||
<int>8443</int>
|
||||
|
||||
<!-- runes (~1.2% probability) -->
|
||||
<int>18794</int>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12759,7 +12759,6 @@ SoD 3.31 main store section and subsection filtering:
|
||||
<ii>20742</ii>
|
||||
<ii>20785</ii>
|
||||
<ii>20432</ii>
|
||||
<ii>20833</ii>
|
||||
<ii>8894</ii>
|
||||
<ii>10892</ii>
|
||||
<ii>8231</ii>
|
||||
@ -13229,6 +13228,18 @@ SoD 3.31 main store section and subsection filtering:
|
||||
<id>8378</id>
|
||||
<c>10</c>
|
||||
</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>17905</ii>
|
||||
<ii>17906</ii>
|
||||
@ -13263,8 +13274,6 @@ SoD 3.31 main store section and subsection filtering:
|
||||
<ii>12198</ii>
|
||||
<ii>12201</ii>
|
||||
<ii>12286</ii>
|
||||
<ii>9523</ii>
|
||||
<ii>9522</ii>
|
||||
<ii>12287</ii>
|
||||
<ii>12363</ii>
|
||||
<ii>12364</ii>
|
||||
@ -17311,10 +17320,6 @@ SoD 3.31 main store section and subsection filtering:
|
||||
<sd>2023-05-25T19:00:00</sd>
|
||||
<ed>2023-06-01T11:59:00</ed>
|
||||
</ss>
|
||||
<pitem>
|
||||
<id>8661</id>
|
||||
<c>1047515</c>
|
||||
</pitem>
|
||||
<pitem>
|
||||
<id>9429</id>
|
||||
<c>114184</c>
|
||||
@ -17535,18 +17540,18 @@ SoD 3.31 main store section and subsection filtering:
|
||||
<ii>20899</ii>
|
||||
<ii>20900</ii>
|
||||
<ii>20901</ii>
|
||||
<ii>20912</ii>
|
||||
<ii>20902</ii>
|
||||
<ii>20903</ii>
|
||||
<ii>20904</ii>
|
||||
<ii>20913</ii>
|
||||
<ii>20911</ii>
|
||||
<ii>20905</ii>
|
||||
<ii>20906</ii>
|
||||
<ii>20907</ii>
|
||||
<ii>20908</ii>
|
||||
<ii>20909</ii>
|
||||
<ii>20911</ii>
|
||||
<ii>20912</ii>
|
||||
<ii>20913</ii>
|
||||
<ii>20914</ii>
|
||||
<ii>20909</ii>
|
||||
<ii>18003</ii>
|
||||
<ii>13026</ii>
|
||||
<ii>19118</ii>
|
||||
|
@ -73,14 +73,14 @@ namespace sodoff.Services {
|
||||
}
|
||||
|
||||
public ReadOnlyDictionary<int, int> GetAchievementsGroupIdToTaskId(uint gameVersion) {
|
||||
gameVersion = GameVersionForTasks(gameVersion);
|
||||
gameVersion = ClientVersion.GetGameID(gameVersion);
|
||||
if (achievementsTasks.ContainsKey(gameVersion))
|
||||
return achievementsTasks[gameVersion].achievementsGroupIdToTaskId;
|
||||
return new ReadOnlyDictionary<int, int>(new Dictionary<int, int>());
|
||||
}
|
||||
|
||||
public List<AchievementTaskInfo>? GetAllAchievementTaskInfo(int taskID, uint gameVersion) {
|
||||
gameVersion = GameVersionForTasks(gameVersion);
|
||||
gameVersion = ClientVersion.GetGameID(gameVersion);
|
||||
if (achievementsTasks.ContainsKey(gameVersion) && achievementsTasks[gameVersion].achievementsRewardByTask.ContainsKey(taskID)) {
|
||||
return achievementsTasks[gameVersion].achievementsRewardByTask[taskID];
|
||||
}
|
||||
@ -121,13 +121,5 @@ namespace sodoff.Services {
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,17 @@ public class ClientVersion {
|
||||
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 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) {
|
||||
if (
|
||||
apiKey == "b99f695c-7c6e-4e9b-b0f7-22034d799013" || // PC / Windows
|
||||
|
Loading…
x
Reference in New Issue
Block a user