feat(pack): gacha-point endpoint DTOs
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
/// <summary>
|
||||
/// One entry inside <c>gacha_point_rewards[i].reward_list</c>. Different shape from the
|
||||
/// post-state-totals <see cref="RewardListEntry"/> used by /pack/open: this is a catalog
|
||||
/// declaration ("here's what you'd get if you exchanged"), not a viewer-state assignment.
|
||||
/// Wire keys verified against prod capture data_dumps/traffic_prod_tradeables_capture.ndjson.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GachaPointRewardDetailEntry
|
||||
{
|
||||
[JsonPropertyName("reward_type")]
|
||||
[Key("reward_type")]
|
||||
public int RewardType { get; set; }
|
||||
|
||||
[JsonPropertyName("reward_detail_id")]
|
||||
[Key("reward_detail_id")]
|
||||
public long RewardDetailId { get; set; }
|
||||
|
||||
[JsonPropertyName("reward_number")]
|
||||
[Key("reward_number")]
|
||||
public int RewardNumber { get; set; } = 1;
|
||||
}
|
||||
33
SVSim.EmulatedEntrypoint/Models/Dtos/GachaPointRewardDto.cs
Normal file
33
SVSim.EmulatedEntrypoint/Models/Dtos/GachaPointRewardDto.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
/// <summary>
|
||||
/// One row of <c>gacha_point_rewards[]</c>. The client groups by <see cref="ClassId"/>
|
||||
/// (CardBasePrm.ClanType, stringified on the wire) inside GachaPointExchangeInfoTask.Parse.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GachaPointRewardDto
|
||||
{
|
||||
/// <summary>Stringified on the wire (e.g. "0", "1"). CardBasePrm.ClanType value.</summary>
|
||||
[JsonPropertyName("class_id")]
|
||||
[Key("class_id")]
|
||||
public string ClassId { get; set; } = "0";
|
||||
|
||||
[JsonPropertyName("card_id")]
|
||||
[Key("card_id")]
|
||||
public long CardId { get; set; }
|
||||
|
||||
[JsonPropertyName("reward_list")]
|
||||
[Key("reward_list")]
|
||||
public List<GachaPointRewardDetailEntry> RewardList { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("is_received")]
|
||||
[Key("is_received")]
|
||||
public bool IsReceived { get; set; }
|
||||
|
||||
[JsonPropertyName("is_display_prize")]
|
||||
[Key("is_display_prize")]
|
||||
public bool IsDisplayPrize { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Pack;
|
||||
|
||||
[MessagePackObject]
|
||||
public class ExchangeGachaPointRequest : BaseRequest
|
||||
{
|
||||
[JsonPropertyName("card_id")]
|
||||
[Key("card_id")]
|
||||
public long CardId { get; set; }
|
||||
|
||||
[JsonPropertyName("parent_gacha_id")]
|
||||
[Key("parent_gacha_id")]
|
||||
public int ParentGachaId { get; set; }
|
||||
|
||||
[JsonPropertyName("odds_gacha_id")]
|
||||
[Key("odds_gacha_id")]
|
||||
public int OddsGachaId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Pack;
|
||||
|
||||
/// <summary>
|
||||
/// Inbound /pack/get_gacha_point_rewards body. Capture shows odds_gacha_id and parent_gacha_id
|
||||
/// are always the same value (the pack id); we only consume parent_gacha_id for the lookup.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GetGachaPointRewardsRequest : BaseRequest
|
||||
{
|
||||
[JsonPropertyName("odds_gacha_id")]
|
||||
[Key("odds_gacha_id")]
|
||||
public int OddsGachaId { get; set; }
|
||||
|
||||
[JsonPropertyName("parent_gacha_id")]
|
||||
[Key("parent_gacha_id")]
|
||||
public int ParentGachaId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Responses.Pack;
|
||||
|
||||
[MessagePackObject]
|
||||
public class ExchangeGachaPointResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// POST-STATE TOTALS dispatched through PlayerStaticData.UpdateHaveUserGoodsNumByJsonData
|
||||
/// on the client (see project_wire_reward_list_post_state memory). The granted card,
|
||||
/// any cascading cosmetics, and the updated gacha-point balance entry all appear here.
|
||||
/// </summary>
|
||||
[JsonPropertyName("reward_list")]
|
||||
[Key("reward_list")]
|
||||
public List<RewardListEntry> RewardList { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Responses.Pack;
|
||||
|
||||
[MessagePackObject]
|
||||
public class GetGachaPointRewardsResponse
|
||||
{
|
||||
[JsonPropertyName("gacha_point_rewards")]
|
||||
[Key("gacha_point_rewards")]
|
||||
public List<GachaPointRewardDto> GachaPointRewards { get; set; } = new();
|
||||
}
|
||||
Reference in New Issue
Block a user