feat(bp): /battle_pass/buy — crystal-cost + retroactive premium grants
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.BattlePass;
|
||||
|
||||
/// <summary>
|
||||
/// achieved_info wrapper inside /battle_pass/buy response
|
||||
/// (Wizard/BattlePassBuyTask.cs:37-40).
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class BattlePassAchievedInfoDto
|
||||
{
|
||||
[JsonPropertyName("battle_pass_reward_list")]
|
||||
[Key("battle_pass_reward_list")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<BattlePassReceivedRewardDto> BattlePassRewardList { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.BattlePass;
|
||||
|
||||
/// <summary>
|
||||
/// /battle_pass/buy request (Wizard/BattlePassBuyTask.cs:8-13). Inherits viewer_id, steam_id,
|
||||
/// steam_session_ticket from BaseRequest. Per memory feedback_msgpack_request_dtos, the
|
||||
/// [MessagePackObject] + [Key] attrs are required even though integration tests post JSON.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class BattlePassBuyRequest : BaseRequest
|
||||
{
|
||||
[JsonPropertyName("season_id")]
|
||||
[Key("season_id")]
|
||||
public int SeasonId { get; set; }
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
[Key("id")]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.BattlePass;
|
||||
|
||||
/// <summary>
|
||||
/// /battle_pass/buy response (Wizard/BattlePassBuyTask.cs:30-52). result_code carries the
|
||||
/// envelope failure path: 22 = insufficient crystals, 23 = already premium,
|
||||
/// 24 = outside BP period / season mismatch.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class BattlePassBuyResponse
|
||||
{
|
||||
[JsonPropertyName("result_code")]
|
||||
[Key("result_code")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public int ResultCode { get; set; } = 1;
|
||||
|
||||
[JsonPropertyName("achieved_info")]
|
||||
[Key("achieved_info")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public BattlePassAchievedInfoDto AchievedInfo { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("reward_list")]
|
||||
[Key("reward_list")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<BattlePassRewardListEntryDto> RewardList { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.BattlePass;
|
||||
|
||||
/// <summary>
|
||||
/// One entry in /battle_pass/buy → achieved_info.battle_pass_reward_list[]
|
||||
/// (Wizard/BattlePassBuyTask.cs:42-48). Delta entries; numerics are int here, not string-typed.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class BattlePassReceivedRewardDto
|
||||
{
|
||||
[JsonPropertyName("reward_type")]
|
||||
[Key("reward_type")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public int RewardType { get; set; }
|
||||
|
||||
[JsonPropertyName("reward_detail_id")]
|
||||
[Key("reward_detail_id")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public long RewardDetailId { get; set; }
|
||||
|
||||
[JsonPropertyName("reward_number")]
|
||||
[Key("reward_number")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public int RewardNumber { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.BattlePass;
|
||||
|
||||
/// <summary>
|
||||
/// One entry in /battle_pass/buy → reward_list[]. POST-STATE TOTALS for affected goods +
|
||||
/// currency, per memory project_wire_reward_list_post_state. Matches RewardListEntry shape
|
||||
/// used by /pack/open etc.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class BattlePassRewardListEntryDto
|
||||
{
|
||||
[JsonPropertyName("reward_type")]
|
||||
[Key("reward_type")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public int RewardType { get; set; }
|
||||
|
||||
[JsonPropertyName("reward_id")]
|
||||
[Key("reward_id")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public long RewardId { get; set; }
|
||||
|
||||
[JsonPropertyName("reward_num")]
|
||||
[Key("reward_num")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public int RewardNum { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user