Prebuilt deck purchasing and fixes

This commit is contained in:
gamer147
2026-05-26 09:16:21 -04:00
parent fa0901b776
commit b6966ece6e
39 changed files with 7392 additions and 15 deletions

View File

@@ -0,0 +1,21 @@
using System.Text.Json.Serialization;
using MessagePack;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.BuildDeck;
/// <summary>
/// /build_deck/buy request body. sales_type is ShopCommonUtility.SalesType:
/// 0=free, 1=crystal, 2=rupy, 3=ticket (v1: 3 returns 501).
/// </summary>
[MessagePackObject]
public class BuildDeckBuyRequest : BaseRequest
{
[JsonPropertyName("product_id")]
[Key("product_id")]
public int ProductId { get; set; }
[JsonPropertyName("sales_type")]
[Key("sales_type")]
public int SalesType { get; set; }
}

View File

@@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
using MessagePack;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.BuildDeck;
[MessagePackObject]
public class BuildDeckGetPurchaseCountRequest : BaseRequest
{
[JsonPropertyName("product_id")]
[Key("product_id")]
public int ProductId { get; set; }
}

View File

@@ -0,0 +1,17 @@
using System.Text.Json.Serialization;
using MessagePack;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.BuildDeck;
/// <summary>
/// /build_deck/info request body. <c>add_series_id == 0</c> means "return all"; non-zero filters
/// to the single matching series (used by the client to re-fetch after a purchase).
/// </summary>
[MessagePackObject]
public class BuildDeckInfoRequest : BaseRequest
{
[JsonPropertyName("add_series_id")]
[Key("add_series_id")]
public int AddSeriesId { get; set; }
}

View File

@@ -0,0 +1,33 @@
using System.Text.Json.Serialization;
using MessagePack;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.LeaderSkin;
/// <summary>
/// POST /leader_skin/set — the per-class "current leader skin" preference used as a fallback
/// when a deck has <c>leader_skin_id == 0</c>. Two modes:
/// - Non-random: <c>is_random_leader_skin=false</c>, <c>leader_skin_id</c> is the chosen skin id.
/// - Random: <c>is_random_leader_skin=true</c>, <c>leader_skin_id_list</c> is the shuffle pool
/// (server picks per-match). Random mode is not implemented in v1 (returns 501).
/// Source: <c>Wizard/LeaderSkinUpdateTask.cs</c>.
/// </summary>
[MessagePackObject]
public class LeaderSkinSetRequest : BaseRequest
{
[JsonPropertyName("class_id")]
[Key("class_id")]
public int ClassId { get; set; }
[JsonPropertyName("leader_skin_id")]
[Key("leader_skin_id")]
public int LeaderSkinId { get; set; }
[JsonPropertyName("is_random_leader_skin")]
[Key("is_random_leader_skin")]
public bool IsRandomLeaderSkin { get; set; }
[JsonPropertyName("leader_skin_id_list")]
[Key("leader_skin_id_list")]
public int[] LeaderSkinIdList { get; set; } = Array.Empty<int>();
}