Lots of data and model setup
This commit is contained in:
@@ -5,13 +5,22 @@ namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
[MessagePackObject]
|
||||
public class AvatarAbility
|
||||
{
|
||||
[Key("leader_skin_id")]
|
||||
public int LeaderSkinId { get; set; }
|
||||
[Key("battle_start_firstplayerturn_bp")]
|
||||
public int BattleStartFirstPlayerBp { get; set; }
|
||||
[Key("battle_start_secondplayerturn_bp")]
|
||||
public int BattleStartSecondPlayerBp { get; set; }
|
||||
[Key("battle_start_max_life")]
|
||||
public int BattleStartMaxLife { get; set; }
|
||||
[Key("ability_cost")]
|
||||
public string AbilityCost { get; set; }
|
||||
[Key("ability")]
|
||||
public string Ability { get; set; }
|
||||
[Key("passive_ability")]
|
||||
public string PassiveAbility { get; set; }
|
||||
[Key("ability_desc")]
|
||||
public string AbilityDesc { get; set; }
|
||||
[Key("passive_ability_desc")]
|
||||
public string PassiveAbilityDesc { get; set; }
|
||||
}
|
||||
@@ -5,6 +5,8 @@ namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
[MessagePackObject]
|
||||
public class AvatarInfo
|
||||
{
|
||||
[Key("abilities")]
|
||||
public Dictionary<string, AvatarAbility> Abilities { get; set; } = new Dictionary<string, AvatarAbility>();
|
||||
[Key("schedules")]
|
||||
public SpecialRotationSchedule Schedules { get; set; } = new SpecialRotationSchedule();
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using MessagePack;
|
||||
using SVSim.Database.Models;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
@@ -6,9 +7,20 @@ namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
public class DefaultSettings
|
||||
{
|
||||
[Key("default_emblem_id")]
|
||||
public ulong DefaultEmblemId { get; set; }
|
||||
public int DefaultEmblemId { get; set; }
|
||||
[Key("default_degree_id")]
|
||||
public int DefaultDegreeId { get; set; }
|
||||
[Key("default_mypage_id")]
|
||||
public ulong DefaultMyPageBackground { get; set; }
|
||||
public int DefaultMyPageBackground { get; set; }
|
||||
|
||||
public DefaultSettings(GameConfiguration config)
|
||||
{
|
||||
this.DefaultMyPageBackground = config.DefaultMyPageBackground.Id;
|
||||
this.DefaultDegreeId = config.DefaultDegree.Id;
|
||||
this.DefaultEmblemId = config.DefaultEmblem.Id;
|
||||
}
|
||||
|
||||
public DefaultSettings()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ namespace SVSim.EmulatedEntrypoint.Models.Dtos.Internal;
|
||||
public class DataHeaders
|
||||
{
|
||||
[Key("short_udid")]
|
||||
public ulong ShortUdid { get; set; }
|
||||
public long ShortUdid { get; set; }
|
||||
[Key("viewer_id")]
|
||||
public ulong ViewerId { get; set; }
|
||||
public long ViewerId { get; set; }
|
||||
[Key("sid")]
|
||||
public string Sid { get; set; }
|
||||
[Key("servertime")]
|
||||
|
||||
@@ -5,11 +5,18 @@ namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
[MessagePackObject()]
|
||||
public class MyRotationAbility
|
||||
{
|
||||
[Key("ability_id")]
|
||||
public int AbilityId { get; set; }
|
||||
[Key("add_start_pp")]
|
||||
public int AddStartPp { get; set; }
|
||||
[Key("add_start_life")]
|
||||
public int AddStartLife { get; set; }
|
||||
[Key("increase_add_pptotal_amount")]
|
||||
public int IncreaseAddPpTotalAmount { get; set; }
|
||||
[Key("increase_add_pptotal_turn")]
|
||||
public int IncreaseAddPpTotalTurn { get; set; }
|
||||
[Key("ability")]
|
||||
public string Ability { get; set; } = string.Empty;
|
||||
public string AbilityDesc { get; set; } = String.Empty;
|
||||
[Key("ability_desc")]
|
||||
public string AbilityDesc { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using MessagePack;
|
||||
using SVSim.Database.Models;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
@@ -39,4 +40,29 @@ public class RankInfo
|
||||
public int ResetLose { get; set; }
|
||||
[Key("accumulate_master_point")]
|
||||
public int AccumulateMasterPoints { get; set; }
|
||||
|
||||
public RankInfo(RankInfoEntry rankEntry)
|
||||
{
|
||||
RankId = rankEntry.Id;
|
||||
RankName = rankEntry.Name;
|
||||
NecessaryPoints = rankEntry.NecessaryPoint;
|
||||
AccumulatePoints = rankEntry.AccumulatePoint;
|
||||
LowerLimitPoints = rankEntry.LowerLimitPoint;
|
||||
BaseAddBp = rankEntry.BaseAddBp;
|
||||
BaseDropBp = rankEntry.BaseDropBp;
|
||||
StreakBonusPoints = rankEntry.StreakBonusPt;
|
||||
WinBonus = rankEntry.WinBonus;
|
||||
LoseBonus = rankEntry.LoseBonus;
|
||||
MaxWinBonus = rankEntry.MaxWinBonus;
|
||||
MaxLoseBonus = rankEntry.MaxLoseBonus;
|
||||
IsPromotionWar = rankEntry.IsPromotionWar;
|
||||
MatchCount = rankEntry.MatchCount;
|
||||
NecessaryWins = rankEntry.NecessaryWin;
|
||||
ResetLose = rankEntry.ResetLose;
|
||||
AccumulateMasterPoints = rankEntry.AccumulateMasterPoint;
|
||||
}
|
||||
|
||||
public RankInfo()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,28 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
/// <summary>
|
||||
/// An indication that a specific card has had it's red ether amounts overriden from the normal amounts.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class RedEtherOverride
|
||||
{
|
||||
/// <summary>
|
||||
/// The id of the affected card.
|
||||
/// </summary>
|
||||
[Key("card_id")]
|
||||
public ulong CardId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How much red ether is now provided from dusting the card.
|
||||
/// </summary>
|
||||
[Key("get_red_ether")]
|
||||
public int GetRedEther { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How much red ether is now required to craft the card.
|
||||
/// </summary>
|
||||
[Key("use_red_ether")]
|
||||
public int UseRedEther { get; set; }
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace SVSim.EmulatedEntrypoint.Models.Dtos.Responses;
|
||||
public class GameStartResponse
|
||||
{
|
||||
[Key("now_viewer_id")]
|
||||
public ulong NowViewerId { get; set; }
|
||||
public long NowViewerId { get; set; }
|
||||
[Key("is_set_transition_password")]
|
||||
public bool IsSetTransitionPassword { get; set; }
|
||||
[Key("now_name")]
|
||||
|
||||
@@ -117,7 +117,7 @@ public class IndexResponse
|
||||
/// Backgrounds for 'My Page' the user has collected.
|
||||
/// </summary>
|
||||
[Key("user_mypage_list")]
|
||||
public List<ulong> MyPageBackgrounds { get; set; } = new List<ulong>();
|
||||
public List<int> MyPageBackgrounds { get; set; } = new List<int>();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MessagePack;
|
||||
using SVSim.Database.Models;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
@@ -19,4 +20,15 @@ public class UserCard : CardIdentifier
|
||||
/// </summary>
|
||||
[Key("is_protected")]
|
||||
public int IsProtected { get; set; }
|
||||
|
||||
public UserCard(OwnedCardEntry card)
|
||||
{
|
||||
this.CardId = card.Card.Id;
|
||||
this.Count = card.Count;
|
||||
this.IsProtected = card.IsProtected ? 1 : 0;
|
||||
}
|
||||
|
||||
public UserCard()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using MessagePack;
|
||||
using SVSim.Database.Models;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
@@ -28,4 +29,19 @@ public class UserClass
|
||||
|
||||
[Key("default_leader_skin_id")]
|
||||
public int DefaultLeaderSkinId { get; set; }
|
||||
|
||||
public UserClass(ViewerClassData viewerClass)
|
||||
{
|
||||
this.ClassId = viewerClass.Class.Id;
|
||||
this.IsAvailable = 1;
|
||||
this.Level = viewerClass.Level;
|
||||
this.Exp = viewerClass.Exp;
|
||||
this.IsRandomLeaderSkin = 0;
|
||||
this.LeaderSkinId = viewerClass.LeaderSkin.Id;
|
||||
this.DefaultLeaderSkinId = viewerClass.Class.DefaultLeaderSkin.Id;
|
||||
}
|
||||
|
||||
public UserClass()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
public class UserCurrency
|
||||
{
|
||||
[Key("viewer_id")]
|
||||
public ulong ViewerId { get; set; }
|
||||
public long ViewerId { get; set; }
|
||||
[Key("crystal")]
|
||||
public ulong Crystals { get; set; }
|
||||
[Key("crystal_android")]
|
||||
@@ -40,7 +40,7 @@ public class UserCurrency
|
||||
this.Crystals = currency.Crystals;
|
||||
this.RedEther = currency.RedEther;
|
||||
this.LifeTotalCrystals = currency.LifeTotalCrystals;
|
||||
this.TotalCrystals = currency.LifeTotalCrystals;
|
||||
this.TotalCrystals = currency.Crystals;
|
||||
this.Rupees = currency.Rupees;
|
||||
this.FreeCrystals = currency.FreeCrystals;
|
||||
this.AndroidCrystals = currency.AndroidCrystals;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MessagePack;
|
||||
using SVSim.Database.Models;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
@@ -17,9 +18,9 @@ public class UserDeck
|
||||
[Key("leader_skin_id")]
|
||||
public int LeaderSkinId { get; set; }
|
||||
[Key("deck_name")]
|
||||
public string DeckName { get; set; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
[Key("card_id_array")]
|
||||
public List<int> Cards { get; set; } = new List<int>();
|
||||
public List<long> Cards { get; set; } = new List<long>();
|
||||
[Key("is_complete_deck")]
|
||||
public int IsCompleteDeck { get; set; }
|
||||
[Key("restricted_card_exists")]
|
||||
@@ -27,7 +28,7 @@ public class UserDeck
|
||||
[Key("is_available_deck")]
|
||||
public int IsAvailable { get; set; }
|
||||
[Key("maintenance_card_ids")]
|
||||
public List<int> MaintenanceCards { get; set; } = new List<int>();
|
||||
public List<long> MaintenanceCards { get; set; } = new List<long>();
|
||||
[Key("is_include_un_possession_card")]
|
||||
public bool IncludesNonCollectibleCards { get; set; }
|
||||
[Key("is_random_leader_skin")]
|
||||
@@ -38,4 +39,30 @@ public class UserDeck
|
||||
public int Order { get; set; }
|
||||
[Key("create_deck_time")]
|
||||
public DateTime DeckCreateTime { get; set; }
|
||||
|
||||
public UserDeck(ShadowverseDeckEntry deck)
|
||||
{
|
||||
this.DeckNumber = deck.Number;
|
||||
this.ClassId = deck.Class.Id;
|
||||
this.LeaderSkinId = deck.LeaderSkin.Id;
|
||||
this.SleeveId = deck.Sleeve.Id;
|
||||
this.Name = deck.Name;
|
||||
this.Cards = deck.Cards.SelectMany(card => Enumerable.Range(0, card.Count).Select(count => card.Card.Id))
|
||||
.ToList();
|
||||
this.IsRandomLeaderSkin = deck.RandomLeaderSkin ? 1 : 0;
|
||||
this.Order = deck.Number;
|
||||
this.DeckCreateTime = deck.DateCreated;
|
||||
|
||||
//TODO probably want to calc some of these on demand
|
||||
this.IsCompleteDeck = 1;
|
||||
this.RestrictedCardExists = false;
|
||||
this.IsAvailable = 1;
|
||||
this.MaintenanceCards = new();
|
||||
this.IncludesNonCollectibleCards = false;
|
||||
|
||||
}
|
||||
|
||||
public UserDeck()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using MessagePack;
|
||||
using SVSim.Database.Models;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
@@ -10,4 +11,14 @@ public class UserItem
|
||||
|
||||
[Key("number")]
|
||||
public int Number { get; set; }
|
||||
|
||||
public UserItem(OwnedItemEntry item)
|
||||
{
|
||||
this.ItemId = item.Item.Id;
|
||||
this.Number = item.Count;
|
||||
}
|
||||
|
||||
public UserItem()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using MessagePack;
|
||||
using SVSim.Database.Models;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
|
||||
@@ -15,4 +16,17 @@ public class UserLeaderSkin
|
||||
public int EmoteId { get; set; }
|
||||
[Key("is_owned")]
|
||||
public bool IsOwned { get; set; }
|
||||
|
||||
public UserLeaderSkin(LeaderSkinEntry leaderSkin, bool isOwned)
|
||||
{
|
||||
this.Id = leaderSkin.Id;
|
||||
this.Name = leaderSkin.Name;
|
||||
this.ClassId = leaderSkin.Class.Id;
|
||||
this.EmoteId = leaderSkin.EmoteId;
|
||||
this.IsOwned = isOwned;
|
||||
}
|
||||
|
||||
public UserLeaderSkin()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user