diff --git a/src/Controllers/Common/ContentController.cs b/src/Controllers/Common/ContentController.cs index fd337fe..d281168 100644 --- a/src/Controllers/Common/ContentController.cs +++ b/src/Controllers/Common/ContentController.cs @@ -1441,7 +1441,7 @@ public class ContentController : Controller { [HttpPost] [Produces("application/xml")] [Route("ContentWebService.asmx/GetActiveParties")] // used by World Of Jumpstart - public IActionResult GetActiveParties() + public IActionResult GetActiveParties([FromForm] string apiKey) { List allParties = ctx.Parties.ToList(); List userParties = new List(); @@ -1456,6 +1456,7 @@ public class ContentController : Controller { continue; } + Viking viking = ctx.Vikings.FirstOrDefault(e => e.Id == party.VikingId); AvatarData avatarData = XmlUtil.DeserializeXml(viking.AvatarSerialized); UserParty userParty = new UserParty @@ -1471,8 +1472,26 @@ public class ContentController : Controller { if (party.Location == "MyNeighborhood") userParty.DisplayName = $"{userParty.UserName}'s Block Party"; if (party.Location == "MyVIPRoomInt") userParty.DisplayName = $"{userParty.UserName}'s VIP Party"; + if (party.Location == "MyPodInt") { + // Only way to do this without adding another column to the table. + if (party.AssetBundle == "RS_DATA/PfMyPodBirthdayParty.unity3d/PfMyPodBirthdayParty") { + userParty.DisplayName = $"{userParty.UserName}'s Pod Birthday Party"; + } else { + userParty.DisplayName = $"{userParty.UserName}'s Pod Party"; + } + } - userParties.Add(userParty); + uint gameVersion = ClientVersion.GetVersion(apiKey); + // Send only JumpStart parties to JumpStart + if (gameVersion <= ClientVersion.Max_OldJS && (gameVersion & ClientVersion.WoJS) != 0 + && (party.Location == "MyNeighborhood" + || party.Location == "MyVIPRoomInt")) { + userParties.Add(userParty); + // Send only Math Blaster parties to Math Blaster + } else if (gameVersion == ClientVersion.MB + && party.Location == "MyPodInt") { + userParties.Add(userParty); + } } return Ok(new UserPartyData { NonBuddyParties = userParties.ToArray() }); @@ -1526,7 +1545,7 @@ public class ContentController : Controller { [Produces("application/xml")] [Route("ContentWebService.asmx/PurchaseParty")] // used by World Of Jumpstart [VikingSession] - public IActionResult PurchaseParty(Viking viking, [FromForm] int itemId) + public IActionResult PurchaseParty(Viking viking, [FromForm] int itemId, [FromForm] string apiKey) { ItemData itemData = itemService.GetItem(itemId); @@ -1542,14 +1561,25 @@ public class ContentController : Controller { return Ok(null); } + uint gameVersion = ClientVersion.GetVersion(apiKey); if (partyType == "Default") { - party.Location = "MyNeighborhood"; - party.LocationIconAsset = "RS_DATA/PfUiPartiesList.unity3d/IcoPartyLocationMyNeighborhood"; - party.AssetBundle = "RS_DATA/PfMyNeighborhoodParty.unity3d/PfMyNeighborhoodParty"; + if (gameVersion == ClientVersion.MB) { + party.Location = "MyPodInt"; + party.LocationIconAsset = "RS_DATA/PfUiPartiesListMB.unity3d/IcoMbPartyDefault"; + party.AssetBundle = "RS_DATA/PfMyPodParty.unity3d/PfMyPodParty"; + } else { + party.Location = "MyNeighborhood"; + party.LocationIconAsset = "RS_DATA/PfUiPartiesList.unity3d/IcoPartyLocationMyNeighborhood"; + party.AssetBundle = "RS_DATA/PfMyNeighborhoodParty.unity3d/PfMyNeighborhoodParty"; + } } else if (partyType == "VIPRoom") { party.Location = "MyVIPRoomInt"; party.LocationIconAsset = "RS_DATA/PfUiPartiesList.unity3d/IcoPartyDefault"; party.AssetBundle = "RS_DATA/PfMyVIPRoomIntPartyGroup.unity3d/PfMyVIPRoomIntPartyGroup"; + } else if (partyType == "Birthday") { + party.Location = "MyPodInt"; + party.LocationIconAsset = "RS_DATA/PfUiPartiesListMB.unity3d/IcoMbPartyBirthday"; + party.AssetBundle = "RS_DATA/PfMyPodBirthdayParty.unity3d/PfMyPodBirthdayParty"; } else { Console.WriteLine($"Unsupported partyType = {partyType}"); return Ok(null);