diff --git a/SCHALE.Common/Database/Models/Game/Account.cs b/SCHALE.Common/Database/Models/Game/Account.cs index 0dd2a7b..ad2d3bc 100644 --- a/SCHALE.Common/Database/Models/Game/Account.cs +++ b/SCHALE.Common/Database/Models/Game/Account.cs @@ -1,13 +1,39 @@ using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; +using SCHALE.Common.FlatData; +using MongoDB.Bson.Serialization.Attributes; +using MongoDB.Driver.Core.Servers; namespace SCHALE.Common.Database.Models.Game { #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. - public class Account : AccountDB + public class Account { [Key] [Column("_id")] - public new uint ServerId { get; set; } + public uint ServerId { get; set; } + + public AccountDB AccountDB { get; set; } + + public static Account Create(uint guest_account_uid) // make sure ServerId matches GuestAccount UID + { + Account account = new() + { + ServerId = guest_account_uid, + AccountDB = new AccountDB() + { + ServerId = guest_account_uid, + State = AccountState.Normal, + Level = 0, + Exp = 0, + RepresentCharacterServerId = 1037810385, // i think this is the default + LastConnectTime = DateTime.Now, + CreateDate = DateTime.Now, + } + }; + + return account; + } + } } diff --git a/SCHALE.Common/Database/Models/GuestAccount.cs b/SCHALE.Common/Database/Models/GuestAccount.cs index 80f04cc..11e89d0 100644 --- a/SCHALE.Common/Database/Models/GuestAccount.cs +++ b/SCHALE.Common/Database/Models/GuestAccount.cs @@ -6,10 +6,12 @@ namespace SCHALE.Common.Database.Models #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public class GuestAccount { + public uint Uid { get; set; } + + public string DeviceId { get; set; } + [Key] [Column("_id")] - public uint Uid { get; set; } - public string DeviceId { get; set; } public string Token { get; set; } } } diff --git a/SCHALE.Common/Database/SCHALEContext.cs b/SCHALE.Common/Database/SCHALEContext.cs index ca87e14..1d55e4b 100644 --- a/SCHALE.Common/Database/SCHALEContext.cs +++ b/SCHALE.Common/Database/SCHALEContext.cs @@ -19,23 +19,16 @@ namespace SCHALE.Common.Database protected override void OnModelCreating(ModelBuilder modelBuilder) { - base.OnModelCreating(modelBuilder); modelBuilder.Entity().Property(x => x.Uid).HasValueGenerator(); modelBuilder.Entity().ToCollection("guest_accounts"); - modelBuilder.Entity().Property(x => x.ServerId).HasValueGenerator(); modelBuilder.Entity().ToCollection("accounts"); modelBuilder.Entity().ToCollection("counters"); } - private class AccountAutoIncrementValueGenerator : AutoIncrementValueGenerator - { - protected override string Collection => "account"; - } - private class GuestAccountAutoIncrementValueGenerator : AutoIncrementValueGenerator { protected override string Collection => "guest_account"; @@ -68,19 +61,5 @@ namespace SCHALE.Common.Database return counter.Seq; } } - - public override void Dispose() - { - GC.SuppressFinalize(this); - SaveChanges(); - base.Dispose(); - } - - public override ValueTask DisposeAsync() - { - GC.SuppressFinalize(this); - SaveChanges(); - return base.DisposeAsync(); - } } } diff --git a/SCHALE.Common/Database/dbs.cs b/SCHALE.Common/Database/dbs.cs index a7fb7c3..2105c0b 100644 --- a/SCHALE.Common/Database/dbs.cs +++ b/SCHALE.Common/Database/dbs.cs @@ -1,205 +1,69 @@ +using SCHALE.Common.FlatData; using SCHALE.Common.NetworkProtocol; using SCHALE.Common.Parcel; +using System.Text.Json.Serialization; -namespace SCHALE.Common.Database { - - // Battle? probably need to implement these our selves - public class BattleSummary - { - - } - - // probably just a simple json wrapper - public class TypedJsonWrapper - { - - } - - // Enums from FlatData (not importing whole namespace yet) - public enum StageDifficulty +namespace SCHALE.Common.Database +{ + // Battle? probably need to implement these our selves + public class BattleSummary { - None, - - Normal, - - Hard, - - VeryHard, - - VeryHard_Ex } - public enum AccountState + // probably just a simple json wrapper + public class TypedJsonWrapper { - WaitingSignIn, - - Normal, - - Dormant, - - Comeback, - - Newbie } - public enum ContentType + public class AttendanceBookReward { + public long UniqueId { get; set; } - None, + public AttendanceType Type { get; set; } - CampaignMainStage, + public AccountState AccountType { get; set; } - CampaignSubStage, + public long DisplayOrder { get; set; } - WeekDungeon, + public long AccountLevelLimit { get; set; } - EventContentMainStage, + public string Title { get; set; } - EventContentSubStage, + public string TitleImagePath { get; set; } - CampaignTutorialStage, + public AttendanceCountRule CountRule { get; set; } - EventContentMainGroundStage, + public AttendanceResetType CountReset { get; set; } - SchoolDungeon, + public long BookSize { get; set; } - TimeAttackDungeon, + public DateTime StartDate { get; set; } - Raid, + public DateTime StartableEndDate { get; set; } - Conquest, + public DateTime EndDate { get; set; } - EventContentStoryStage, + public long ExpiryDate { get; set; } - CampaignExtraStage, + public MailType MailType { get; set; } - StoryStrategyStage, + public Dictionary DailyRewardIcons { get; set; } - ScenarioMode, - - EventContent, - - WorldRaid, - - EliminateRaid, - - Chaser, - - FieldContentStage, - - MultiFloorRaid + public Dictionary> DailyRewards { get; set; } } - public enum CurrencyTypes + public enum OpenConditionLockReason { - - Invalid, - - Gold, - - GemPaid, - - GemBonus, - - Gem, - - ActionPoint, - - AcademyTicket, - - ArenaTicket, - - RaidTicket, - - WeekDungeonChaserATicket, - - WeekDungeonFindGiftTicket, - - WeekDungeonBloodTicket, - - WeekDungeonChaserBTicket, - - WeekDungeonChaserCTicket, - - SchoolDungeonATicket, - - SchoolDungeonBTicket, - - SchoolDungeonCTicket, - - TimeAttackDungeonTicket, - - MasterCoin, - - WorldRaidTicketA, - - WorldRaidTicketB, - - WorldRaidTicketC, - - ChaserTotalTicket, - - SchoolDungeonTotalTicket, - - EliminateTicketA, - - EliminateTicketB, - - EliminateTicketC, - - Max - } - - public enum ParcelType - { - - None, - - Character, - - Currency, - - Equipment, - - Item, - - GachaGroup, - - Product, - - Shop, - - MemoryLobby, - - AccountExp, - - CharacterExp, - - FavorExp, - - TSS, - - Furniture, - - ShopRefresh, - - LocationExp, - - Recipe, - - CharacterWeapon, - - CharacterGear, - - IdCardBackground, - - Emblem, - - Sticker, - - Costume + None = 0, + Level = 1, + StageClear = 2, + Time = 4, + Day = 8, + CafeRank = 16, + ScenarioModeClear = 32, + CafeOpen = 64 } public enum ParcelChangeType @@ -214,477 +78,362 @@ namespace SCHALE.Common.Database { Converted } - public enum EventTargetType - { - - WeekDungeon, - - Chaser, - - Campaign_Normal, - - Campaign_Hard, - - SchoolDungeon, - - AcademySchedule, - - TimeAttackDungeon, - - AccountLevelExpIncrease, - - Raid, - - EliminateRaid - } - - public enum Rarity - { - - N, - - R, - - SR, - - SSR - } - - public enum Tag { } - - public enum EventContentType - { - - Stage, - - Gacha, - - Mission, - - Shop, - - Raid, - - Arena, - - BoxGacha, - - Collection, - - Recollection, - - MiniGameRhythm, - - CardShop, - - EventLocation, - - MinigameRhythmEvent, - - FortuneGachaShop, - - SubEvent, - - EventMeetup, - - BoxGachaResult, - - Conquest, - - WorldRaid, - - DiceRace, - - MiniGameRhythmMission, - - WorldRaidEntrance, - - MiniEvent, - - MiniGameShooting, - - MiniGameShootingMission, - - MiniGameTBG, - - TimeAttackDungeon, - - EliminateRaid, - - Treasure, - - Field, - - MultiFloorRaid - } - - public enum EchelonExtensionType - { - - Base, - - Extension - } - - public enum Difficulty - { - - Normal, - - Hard, - - VeryHard, - - Hardcore, - - Extreme, - - Insane, - - Torment - } - - // Above enums and classes are ones references a lot in either dbs or protos, for the rest i just commented them out for now - // DB - public class WorldRaidLocalBossDB { - public long SeasonId { get; set; } - public long GroupId { get; set; } - public long UniqueId { get; set; } - public bool IsScenario { get; set; } - public bool IsCleardEver { get; set; } - public long TacticMscSum { get; set; } - public RaidBattleDB RaidBattleDB { get; set; } - public bool IsContinue { get; set; } - } - - - public class WorldRaidSnapshot { - public List WorldRaidLocalBossDBs { get; set; } - public List WorldRaidClearHistoryDBs { get; set; } - public List CampaignStageHistoryDBs { get; set; } - } - - - public class WorldRaidWorldBossDB { - public long GroupId { get; set; } - public long HP { get; set; } - public long Participants { get; set; } - } - - - public class AcademyDB { - public long AccountId { get; set; } - public DateTime LastUpdate { get; set; } - public Dictionary> ZoneVisitCharacterDBs { get; set; } - public Dictionary> ZoneScheduleGroupRecords { get; set; } - } - - - public class AcademyLocationDB { - public long AccountId { get; set; } - public long LocationId { get; set; } - public long Rank { get; set; } - public long Exp { get; set; } - } - - - public class AcademyMessageDB { - public long MessageServerId { get; set; } - public long MessageGroupId { get; set; } - public long MessageUniqueId { get; set; } - public long SelectedMessageUniqueId { get; set; } - public long CharacterServerId { get; set; } - public long CharacterUniqueId { get; set; } - public bool IsRead { get; set; } - } - - - public class AcademyMessageOutLineDB { - public long CharacterUniqueId { get; set; } - public long NewMessageCount { get; set; } - public long LastMessageUniqueId { get; set; } - public long LastMessageServerId { get; set; } - } - - - public class AcademyScheduleDB { - public long AccountServerId { get; set; } - public long ScheduleUniqueId { get; set; } - public long ScheduleGroupId { get; set; } - public long ZoneUniqueId { get; set; } - public DateTime LastUpdateDate { get; set; } - public int CompleteCount { get; set; } - } - - - public class AccountAchievementDB { - public long AccountServerId { get; set; } - public long AchievementUniqueId { get; set; } - public long AchievementValue { get; set; } - } - - - public class AccountAttachmentDB { - public long AccountId { get; set; } - public long EmblemUniqueId { get; set; } - } - - - public class AccountCurrencyDB { - public long AccountLevel { get; set; } - public long AcademyLocationRankSum { get; set; } - public Dictionary CurrencyDict { get; set; } - public Dictionary UpdateTimeDict { get; set; } - } - - public class AccountDB { - public long ServerId { get; set; } - public string Nickname { get; set; } - public string CallName { get; set; } - public string DevId { get; set; } - public AccountState State { get; set; } - public int Level { get; set; } - public long Exp { get; set; } - public string Comment { get; set; } - public int LobbyMode { get; set; } - public int RepresentCharacterServerId { get; set; } - public long MemoryLobbyUniqueId { get; set; } - public DateTime LastConnectTime { get; set; } - public DateTime BirthDay { get; set; } - public DateTime CallNameUpdateTime { get; set; } - public long PublisherAccountId { get; set; } - public int? RetentionDays { get; set; } - public int? VIPLevel { get; set; } - public DateTime CreateDate { get; set; } - public int? UnReadMailCount { get; set; } - public DateTime? LinkRewardDate { get; set; } - } - - - public class ArenaBattleDB { - public long ArenaBattleServerId { get; set; } - public long Season { get; set; } - public long Group { get; set; } - public DateTime BattleStartTime { get; set; } - public DateTime BattleEndTime { get; set; } - public long Seed { get; set; } - public ArenaUserDB AttackingUserDB { get; set; } - public ArenaUserDB DefendingUserDB { get; set; } - public BattleSummary BattleSummary { get; set; } - } - - - public class ArenaCharacterDB { - public long ServerId { get; set; } - public long UniqueId { get; set; } - public int StarGrade { get; set; } - public int Level { get; set; } - public int PublicSkillLevel { get; set; } - public int ExSkillLevel { get; set; } - public int PassiveSkillLevel { get; set; } - public int ExtraPassiveSkillLevel { get; set; } - public int LeaderSkillLevel { get; set; } - public List EquipmentDBs { get; set; } - public Dictionary FavorRankInfo { get; set; } - public Dictionary PotentialStats { get; set; } - public WeaponDB WeaponDB { get; set; } - public GearDB GearDB { get; set; } - public CostumeDB CostumeDB { get; set; } - } - - - public class ArenaDamageReportDB { - public long ArenaBattleServerId { get; set; } - public long WinnerAccountServerId { get; set; } - public ArenaUserDB AttackerUserDB { get; set; } - public ArenaUserDB DefenderUserDB { get; set; } - public DateTime BattleEndTime { get; set; } - public Dictionary AttackerDamageReport { get; set; } - public Dictionary DefenderDamageReport { get; set; } - } - - - public class ArenaHistoryDB { - public ArenaBattleDB ArenaBattleDB { get; set; } - public DateTime BattleEndTime { get; set; } - public BattleSummary BattleSummary { get; set; } - public ArenaUserDB AttackingUserDB { get; set; } - public ArenaUserDB DefendingUserDB { get; set; } - public long WinnerAccountServerId { get; set; } - } - - - public class ArenaPlayerInfoDB { - public long CurrentSeasonId { get; set; } - public long PlayerGroupId { get; set; } - public long CurrentRank { get; set; } - public long SeasonRecord { get; set; } - public long AllTimeRecord { get; set; } - public long CumulativeTimeReward { get; set; } - public DateTime TimeRewardLastUpdateTime { get; set; } - public DateTime BattleEnterActiveTime { get; set; } - public DateTime DailyRewardActiveTime { get; set; } - } - - public enum EchelonType + public class WorldRaidLocalBossDB { - // Token: 0x04007DE3 RID: 32227 - None, - // Token: 0x04007DE4 RID: 32228 - Adventure, - // Token: 0x04007DE5 RID: 32229 - Raid, - // Token: 0x04007DE6 RID: 32230 - ArenaAttack, - // Token: 0x04007DE7 RID: 32231 - ArenaDefence, - // Token: 0x04007DE8 RID: 32232 - WeekDungeonChaserA, - // Token: 0x04007DE9 RID: 32233 - Scenario, - // Token: 0x04007DEA RID: 32234 - WeekDungeonBlood, - // Token: 0x04007DEB RID: 32235 - WeekDungeonChaserB, - // Token: 0x04007DEC RID: 32236 - WeekDungeonChaserC, - // Token: 0x04007DED RID: 32237 - WeekDungeonFindGift, - // Token: 0x04007DEE RID: 32238 - EventContent, - // Token: 0x04007DEF RID: 32239 - SchoolDungeonA, - // Token: 0x04007DF0 RID: 32240 - SchoolDungeonB, - // Token: 0x04007DF1 RID: 32241 - SchoolDungeonC, - // Token: 0x04007DF2 RID: 32242 - TimeAttack, - // Token: 0x04007DF3 RID: 32243 - WorldRaid, - // Token: 0x04007DF4 RID: 32244 - Conquest, - // Token: 0x04007DF5 RID: 32245 - ConquestManage, - // Token: 0x04007DF6 RID: 32246 - StoryStrategyStage, - // Token: 0x04007DF7 RID: 32247 - EliminateRaid01, - // Token: 0x04007DF8 RID: 32248 - EliminateRaid02, - // Token: 0x04007DF9 RID: 32249 - EliminateRaid03, - // Token: 0x04007DFA RID: 32250 - Field, - // Token: 0x04007DFB RID: 32251 - MultiFloorRaid + public long SeasonId { get; set; } + public long GroupId { get; set; } + public long UniqueId { get; set; } + public bool IsScenario { get; set; } + public bool IsCleardEver { get; set; } + public long TacticMscSum { get; set; } + public RaidBattleDB RaidBattleDB { get; set; } + public bool IsContinue { get; set; } } - public class ArenaTeamSettingDB { - public EchelonType EchelonType { get; set; } - public long LeaderCharacterId { get; set; } - public long TSSInteractionCharacterId { get; set; } - public long TSSInteractionCharacterServerId { get; set; } - public IList MainCharacters { get; set; } - public IList SupportCharacters { get; set; } - public ArenaCharacterDB TSSCharacterDB { get; set; } - public int SquadCount { get; set; } - public long MapId { get; set; } - } + + public class WorldRaidSnapshot + { + public List WorldRaidLocalBossDBs { get; set; } + public List WorldRaidClearHistoryDBs { get; set; } + public List CampaignStageHistoryDBs { get; set; } + } - public class ArenaUserDB { - public long AccountServerId { get; set; } - public long RepresentCharacterUniqueId { get; set; } - public long RepresentCharacterCostumeId { get; set; } - public string NickName { get; set; } - public long Rank { get; set; } - public long Level { get; set; } - public long Exp { get; set; } - public ArenaTeamSettingDB TeamSettingDB { get; set; } - public AccountAttachmentDB AccountAttachmentDB { get; set; } - public string UserName { get; set; } - } + public class WorldRaidWorldBossDB + { + public long GroupId { get; set; } + public long HP { get; set; } + public long Participants { get; set; } + } - public class AssistCharacterDB { - public EchelonType EchelonType { get; set; } - public int SlotNumber { get; set; } - public long AccountId { get; set; } - //public AssistRelation AssistRelation { get; set; } - public long AssistCharacterServerId { get; set; } - public string NickName { get; set; } - public List EquipmentDBs { get; set; } - public WeaponDB WeaponDB { get; set; } - public GearDB GearDB { get; set; } - public long CostumeId { get; set; } - public CostumeDB CostumeDB { get; set; } - public bool IsMulligan { get; set; } - public bool IsTSAInteraction { get; set; } - public bool HasWeapon { get; set; } - public bool HasGear { get; set; } - } + public class AcademyDB + { + public long AccountId { get; set; } + public DateTime LastUpdate { get; set; } + public Dictionary> ZoneVisitCharacterDBs { get; set; } + public Dictionary> ZoneScheduleGroupRecords { get; set; } + } - public class AttendanceHistoryDB { - public long ServerId { get; set; } - public long AccountServerId { get; set; } - public long AttendanceBookUniqueId { get; set; } - public Dictionary AttendedDay { get; set; } - public bool Expired { get; set; } - public long LastAttendedDay { get; set; } - public DateTime LastAttendedDate { get; set; } - public Dictionary AttendedDayNullable { get; set; } - } + public class AcademyLocationDB + { + public long AccountId { get; set; } + public long LocationId { get; set; } + public long Rank { get; set; } + public long Exp { get; set; } + } - public class BanDB { - public long ServerId { get; set; } - public long UniqueId { get; set; } - public DateTime BanStartDate { get; set; } - public DateTime BanEndDate { get; set; } - public DateTime RegisterDate { get; set; } - public byte CancelFlag { get; set; } - public DateTime CancelDate { get; set; } - public string Reason { get; set; } - } + public class AcademyMessageDB + { + public long MessageServerId { get; set; } + public long MessageGroupId { get; set; } + public long MessageUniqueId { get; set; } + public long SelectedMessageUniqueId { get; set; } + public long CharacterServerId { get; set; } + public long CharacterUniqueId { get; set; } + public bool IsRead { get; set; } + } - public class BeforehandGachaSnapshotDB { - public long ShopUniqueId { get; set; } - public long GoodsId { get; set; } - public long LastIndex { get; set; } - public List LastResults { get; set; } - public long? SavedIndex { get; set; } - public List SavedResults { get; set; } - public long? PickedIndex { get; set; } - } + public class AcademyMessageOutLineDB + { + public long CharacterUniqueId { get; set; } + public long NewMessageCount { get; set; } + public long LastMessageUniqueId { get; set; } + public long LastMessageServerId { get; set; } + } - public class BlockedProductDB { - public long CashProductId { get; set; } - //public ShopCashBlockType MarketBlockType { get; set; } - public DateTime BeginDate { get; set; } - public DateTime EndDate { get; set; } - } + public class AcademyScheduleDB + { + public long AccountServerId { get; set; } + public long ScheduleUniqueId { get; set; } + public long ScheduleGroupId { get; set; } + public long ZoneUniqueId { get; set; } + public DateTime LastUpdateDate { get; set; } + public int CompleteCount { get; set; } + } - public class CafeDB { - public long CafeDBId { get; set; } - public long CafeId { get; set; } - public long AccountId { get; set; } - public int CafeRank { get; set; } - public DateTime LastUpdate { get; set; } - public DateTime? LastSummonDate { get; set; } - public bool IsNew { get; set; } - public Dictionary CafeVisitCharacterDBs { get; set; } - public List FurnitureDBs { get; set; } - public DateTime ProductionAppliedTime { get; set; } - public CafeProductionDB ProductionDB { get; set; } - public Dictionary CurrencyDict_Obsolete { get; set; } - public Dictionary UpdateTimeDict_Obsolete { get; set; } - } + public class AccountAchievementDB + { + public long AccountServerId { get; set; } + public long AchievementUniqueId { get; set; } + public long AchievementValue { get; set; } + } + + + public class AccountAttachmentDB + { + public long AccountId { get; set; } + public long EmblemUniqueId { get; set; } + } + + + public class AccountCurrencyDB + { + public long AccountLevel { get; set; } + public long AcademyLocationRankSum { get; set; } + public Dictionary CurrencyDict { get; set; } + public Dictionary UpdateTimeDict { get; set; } + } + + public class AccountDB + { + public long ServerId { get; set; } + + public string Nickname { get; set; } + + public string CallName { get; set; } + + public string DevId { get; set; } + + public AccountState State { get; set; } + + public int Level { get; set; } + + public long Exp { get; set; } + + public string Comment { get; set; } + + public int LobbyMode { get; set; } + + public int RepresentCharacterServerId { get; set; } + + public long MemoryLobbyUniqueId { get; set; } + + public DateTime LastConnectTime { get; set; } + + public DateTime BirthDay { get; set; } + + public DateTime CallNameUpdateTime { get; set; } + + public long PublisherAccountId { get; set; } + + public int? RetentionDays { get; set; } + + public int? VIPLevel { get; set; } + + public DateTime CreateDate { get; set; } + + public int? UnReadMailCount { get; set; } + + public DateTime? LinkRewardDate { get; set; } + } + + + public class ArenaBattleDB + { + public long ArenaBattleServerId { get; set; } + public long Season { get; set; } + public long Group { get; set; } + public DateTime BattleStartTime { get; set; } + public DateTime BattleEndTime { get; set; } + public long Seed { get; set; } + public ArenaUserDB AttackingUserDB { get; set; } + public ArenaUserDB DefendingUserDB { get; set; } + public BattleSummary BattleSummary { get; set; } + } + + + public class ArenaCharacterDB + { + public long ServerId { get; set; } + public long UniqueId { get; set; } + public int StarGrade { get; set; } + public int Level { get; set; } + public int PublicSkillLevel { get; set; } + public int ExSkillLevel { get; set; } + public int PassiveSkillLevel { get; set; } + public int ExtraPassiveSkillLevel { get; set; } + public int LeaderSkillLevel { get; set; } + public List EquipmentDBs { get; set; } + public Dictionary FavorRankInfo { get; set; } + public Dictionary PotentialStats { get; set; } + public WeaponDB WeaponDB { get; set; } + public GearDB GearDB { get; set; } + public CostumeDB CostumeDB { get; set; } + } + + + public class ArenaDamageReportDB + { + public long ArenaBattleServerId { get; set; } + public long WinnerAccountServerId { get; set; } + public ArenaUserDB AttackerUserDB { get; set; } + public ArenaUserDB DefenderUserDB { get; set; } + public DateTime BattleEndTime { get; set; } + public Dictionary AttackerDamageReport { get; set; } + public Dictionary DefenderDamageReport { get; set; } + } + + + public class ArenaHistoryDB + { + public ArenaBattleDB ArenaBattleDB { get; set; } + public DateTime BattleEndTime { get; set; } + public BattleSummary BattleSummary { get; set; } + public ArenaUserDB AttackingUserDB { get; set; } + public ArenaUserDB DefendingUserDB { get; set; } + public long WinnerAccountServerId { get; set; } + } + + + public class ArenaPlayerInfoDB + { + public long CurrentSeasonId { get; set; } + public long PlayerGroupId { get; set; } + public long CurrentRank { get; set; } + public long SeasonRecord { get; set; } + public long AllTimeRecord { get; set; } + public long CumulativeTimeReward { get; set; } + public DateTime TimeRewardLastUpdateTime { get; set; } + public DateTime BattleEnterActiveTime { get; set; } + public DateTime DailyRewardActiveTime { get; set; } + } + + public class ArenaTeamSettingDB + { + public EchelonType EchelonType { get; set; } + public long LeaderCharacterId { get; set; } + public long TSSInteractionCharacterId { get; set; } + public long TSSInteractionCharacterServerId { get; set; } + public IList MainCharacters { get; set; } + public IList SupportCharacters { get; set; } + public ArenaCharacterDB TSSCharacterDB { get; set; } + public int SquadCount { get; set; } + public long MapId { get; set; } + } + + + public class ArenaUserDB + { + public long AccountServerId { get; set; } + public long RepresentCharacterUniqueId { get; set; } + public long RepresentCharacterCostumeId { get; set; } + public string NickName { get; set; } + public long Rank { get; set; } + public long Level { get; set; } + public long Exp { get; set; } + public ArenaTeamSettingDB TeamSettingDB { get; set; } + public AccountAttachmentDB AccountAttachmentDB { get; set; } + public string UserName { get; set; } + } + + [Flags] + public enum AssistRelation + { + None = 0, + Clan = 1, + Friend = 2, + Cheat = 4 + } + + public class AssistCharacterDB + { + public EchelonType EchelonType { get; set; } + public int SlotNumber { get; set; } + public long AccountId { get; set; } + public AssistRelation AssistRelation { get; set; } + public long AssistCharacterServerId { get; set; } + public string NickName { get; set; } + public List EquipmentDBs { get; set; } + public WeaponDB WeaponDB { get; set; } + public GearDB GearDB { get; set; } + public long CostumeId { get; set; } + public CostumeDB CostumeDB { get; set; } + public bool IsMulligan { get; set; } + public bool IsTSAInteraction { get; set; } + public bool HasWeapon { get; set; } + public bool HasGear { get; set; } + } + + + public class AttendanceHistoryDB + { + public long ServerId { get; set; } + public long AccountServerId { get; set; } + public long AttendanceBookUniqueId { get; set; } + public Dictionary AttendedDay { get; set; } + public bool Expired { get; set; } + public long LastAttendedDay { get; set; } + public DateTime LastAttendedDate { get; set; } + public Dictionary AttendedDayNullable { get; set; } + } + + + public class BanDB + { + public long ServerId { get; set; } + public long UniqueId { get; set; } + public DateTime BanStartDate { get; set; } + public DateTime BanEndDate { get; set; } + public DateTime RegisterDate { get; set; } + public byte CancelFlag { get; set; } + public DateTime CancelDate { get; set; } + public string Reason { get; set; } + } + + + public class BeforehandGachaSnapshotDB + { + public long ShopUniqueId { get; set; } + public long GoodsId { get; set; } + public long LastIndex { get; set; } + public List LastResults { get; set; } + public long? SavedIndex { get; set; } + public List SavedResults { get; set; } + public long? PickedIndex { get; set; } + } + + public enum ShopCashBlockType : long + { + All = -1L, + AppStore = -2L, + GooglePlay = -3L, + None = -9999L + } + + public class BlockedProductDB + { + public long CashProductId { get; set; } + public ShopCashBlockType MarketBlockType { get; set; } + public DateTime BeginDate { get; set; } + public DateTime EndDate { get; set; } + } + + + public class CafeDB + { + public long CafeDBId { get; set; } + public long CafeId { get; set; } + public long AccountId { get; set; } + public int CafeRank { get; set; } + public DateTime LastUpdate { get; set; } + public DateTime? LastSummonDate { get; set; } + public bool IsNew { get; set; } + public Dictionary CafeVisitCharacterDBs { get; set; } + public List FurnitureDBs { get; set; } + public DateTime ProductionAppliedTime { get; set; } + public CafeProductionDB ProductionDB { get; set; } + public Dictionary CurrencyDict_Obsolete { get; set; } + public Dictionary UpdateTimeDict_Obsolete { get; set; } + } + + public class CafeProductionParcelInfo + { + public ParcelKeyPair Key { get; set; } + // new ParcelKeyPair() + //{ + // Id = 1, + // Type = ParcelType.Currency + //}; + + public long Amount { get; set; } + } public class CafeCharacterDB : VisitingCharacterDB { @@ -694,770 +443,856 @@ namespace SCHALE.Common.Database { } - public class CafePresetDB { - public long ServerId { get; set; } - public int SlotId { get; set; } - public string PresetName { get; set; } - public bool IsEmpty { get; set; } - } + public class CafePresetDB + { + public long ServerId { get; set; } + public int SlotId { get; set; } + public string PresetName { get; set; } + public bool IsEmpty { get; set; } + } - public class CafeProductionDB { - public long CafeDBId { get; set; } - public long ComfortValue { get; set; } - public DateTime AppliedDate { get; set; } - //public List ProductionParcelInfos { get; set; } - } + public class CafeProductionDB + { + public long CafeDBId { get; set; } + public long ComfortValue { get; set; } + public DateTime AppliedDate { get; set; } + public List ProductionParcelInfos { get; set; } + } - public class CampaignChapterClearRewardHistoryDB { - public long AccountServerId { get; set; } - public long ChapterUniqueId { get; set; } - public StageDifficulty RewardType { get; set; } - public DateTime ReceiveDate { get; set; } - } + public class CampaignChapterClearRewardHistoryDB + { + public long AccountServerId { get; set; } + public long ChapterUniqueId { get; set; } + public StageDifficulty RewardType { get; set; } + public DateTime ReceiveDate { get; set; } + } - public class CampaignExtraStageSaveDB { - public ContentType ContentType { get; set; } - } + public class CampaignExtraStageSaveDB + { + public ContentType ContentType { get; set; } + } - public class CampaignMainStageSaveDB { - public ContentType ContentType { get; set; } - public CampaignState CampaignState { get; set; } - public int CurrentTurn { get; set; } - public int EnemyClearCount { get; set; } - public int LastEnemyEntityId { get; set; } - public int TacticRankSCount { get; set; } - //public Dictionary EnemyInfos { get; set; } - //public Dictionary EchelonInfos { get; set; } - public Dictionary> WithdrawInfos { get; set; } - //public Dictionary StrategyObjects { get; set; } - public Dictionary> StrategyObjectRewards { get; set; } - public List StrategyObjectHistory { get; set; } - public Dictionary> ActivatedHexaEventsAndConditions { get; set; } - public Dictionary> HexaEventDelayedExecutions { get; set; } - //public Dictionary TileMapStates { get; set; } - //public List DisplayInfos { get; set; } - //public List DeployedEchelonInfos { get; set; } - } + public class CampaignMainStageSaveDB + { + public ContentType ContentType { get; set; } + public CampaignState CampaignState { get; set; } + public int CurrentTurn { get; set; } + public int EnemyClearCount { get; set; } + public int LastEnemyEntityId { get; set; } + public int TacticRankSCount { get; set; } + //public Dictionary EnemyInfos { get; set; } + //public Dictionary EchelonInfos { get; set; } + public Dictionary> WithdrawInfos { get; set; } + //public Dictionary StrategyObjects { get; set; } + public Dictionary> StrategyObjectRewards { get; set; } + public List StrategyObjectHistory { get; set; } + public Dictionary> ActivatedHexaEventsAndConditions { get; set; } + public Dictionary> HexaEventDelayedExecutions { get; set; } + //public Dictionary TileMapStates { get; set; } + //public List DisplayInfos { get; set; } + //public List DeployedEchelonInfos { get; set; } + } - public class CampaignStageHistoryDB { - public long AccountServerId { get; set; } - public long StoryUniqueId { get; set; } - public long ChapterUniqueId { get; set; } - public long StageUniqueId { get; set; } - public long TacticClearCountWithRankSRecord { get; set; } - public long ClearTurnRecord { get; set; } - public long BestStarRecord { get; set; } - public bool Star1Flag { get; set; } - public bool Star2Flag { get; set; } - public bool Star3Flag { get; set; } - public DateTime LastPlay { get; set; } - public long TodayPlayCount { get; set; } - public long TodayPurchasePlayCountHardStage { get; set; } - public DateTime? FirstClearRewardReceive { get; set; } - public DateTime? StarRewardReceive { get; set; } - public bool IsClearedEver { get; set; } - public long TodayPlayCountForUI { get; set; } - } + public class CampaignStageHistoryDB + { + public long AccountServerId { get; set; } + public long StoryUniqueId { get; set; } + public long ChapterUniqueId { get; set; } + public long StageUniqueId { get; set; } + public long TacticClearCountWithRankSRecord { get; set; } + public long ClearTurnRecord { get; set; } + public long BestStarRecord { get; set; } + public bool Star1Flag { get; set; } + public bool Star2Flag { get; set; } + public bool Star3Flag { get; set; } + public DateTime LastPlay { get; set; } + public long TodayPlayCount { get; set; } + public long TodayPurchasePlayCountHardStage { get; set; } + public DateTime? FirstClearRewardReceive { get; set; } + public DateTime? StarRewardReceive { get; set; } + public bool IsClearedEver { get; set; } + public long TodayPlayCountForUI { get; set; } + } - public class CampaignSubStageSaveDB { - public ContentType ContentType { get; set; } - } + public class CampaignSubStageSaveDB + { + public ContentType ContentType { get; set; } + } - public class CampaignTutorialStageSaveDB { - public ContentType ContentType { get; set; } - } + public class CampaignTutorialStageSaveDB + { + public ContentType ContentType { get; set; } + } - public class CardShopElementDB { - public long EventContentId { get; set; } - public int SlotNumber { get; set; } - public long CardShopElementId { get; set; } - public bool SoldOut { get; set; } - } + public class CardShopElementDB + { + public long EventContentId { get; set; } + public int SlotNumber { get; set; } + public long CardShopElementId { get; set; } + public bool SoldOut { get; set; } + } - public class CardShopPurchaseHistoryDB { - public long EventContentId { get; set; } - public Rarity Rarity { get; set; } - public long PurchaseCount { get; set; } - } + public class CardShopPurchaseHistoryDB + { + public long EventContentId { get; set; } + public Rarity Rarity { get; set; } + public long PurchaseCount { get; set; } + } - public class CharacterDB { - public ParcelType Type { get; set; } - public IEnumerable ParcelInfos { get; set; } - public long ServerId { get; set; } - public long UniqueId { get; set; } - public int StarGrade { get; set; } - public int Level { get; set; } - public long Exp { get; set; } - public int FavorRank { get; set; } - public long FavorExp { get; set; } - public int PublicSkillLevel { get; set; } - public int ExSkillLevel { get; set; } - public int PassiveSkillLevel { get; set; } - public int ExtraPassiveSkillLevel { get; set; } - public int LeaderSkillLevel { get; set; } - public bool IsNew { get; set; } - public bool IsLocked { get; set; } - public bool IsFavorite { get; set; } - public List EquipmentServerIds { get; set; } - public Dictionary PotentialStats { get; set; } - public Dictionary EquipmentSlotAndDBIds { get; set; } - } + public class CharacterDB + { + public ParcelType Type { get; set; } + public IEnumerable ParcelInfos { get; set; } + public long ServerId { get; set; } + public long UniqueId { get; set; } + public int StarGrade { get; set; } + public int Level { get; set; } + public long Exp { get; set; } + public int FavorRank { get; set; } + public long FavorExp { get; set; } + public int PublicSkillLevel { get; set; } + public int ExSkillLevel { get; set; } + public int PassiveSkillLevel { get; set; } + public int ExtraPassiveSkillLevel { get; set; } + public int LeaderSkillLevel { get; set; } + public bool IsNew { get; set; } + public bool IsLocked { get; set; } + public bool IsFavorite { get; set; } + public List EquipmentServerIds { get; set; } + public Dictionary PotentialStats { get; set; } = new() { }; + public Dictionary EquipmentSlotAndDBIds { get; set; } + } - public class ClanAssistRentHistoryDB { - public long AssistCharacterAccountId { get; set; } - public long AssistCharacterDBId { get; set; } - public DateTime RentDate { get; set; } - } + public class ClanAssistRentHistoryDB + { + public long AssistCharacterAccountId { get; set; } + public long AssistCharacterDBId { get; set; } + public DateTime RentDate { get; set; } + } - public class ClanAssistRewardInfo { - public long CharacterDBId { get; set; } - public DateTime DeployDate { get; set; } - public long RentCount { get; set; } - public List CumultativeRewardParcels { get; set; } - public List RentRewardParcels { get; set; } - } + public class ClanAssistRewardInfo + { + public long CharacterDBId { get; set; } + public DateTime DeployDate { get; set; } + public long RentCount { get; set; } + public List CumultativeRewardParcels { get; set; } + public List RentRewardParcels { get; set; } + } - public class ClanAssistSlotDB { - public EchelonType EchelonType { get; set; } - public long SlotNumber { get; set; } - public long CharacterDBId { get; set; } - public DateTime DeployDate { get; set; } - public long TotalRentCount { get; set; } - } + public class ClanAssistSlotDB + { + public EchelonType EchelonType { get; set; } + public long SlotNumber { get; set; } + public long CharacterDBId { get; set; } + public DateTime DeployDate { get; set; } + public long TotalRentCount { get; set; } + } - public class ClanAssistUseInfo { - public long CharacterAccountId { get; set; } - public long CharacterDBId { get; set; } - public EchelonType EchelonType { get; set; } - public int SlotNumber { get; set; } - //public AssistRelation AssistRelation { get; set; } - public int EchelonSlotType { get; set; } - public int EchelonSlotIndex { get; set; } - public long DecodedShardId { get; set; } - public long DecodedCharacterDBId { get; set; } - public bool IsMulligan { get; set; } - public bool IsTSAInteraction { get; set; } - } + public class ClanAssistUseInfo + { + public long CharacterAccountId { get; set; } + public long CharacterDBId { get; set; } + public EchelonType EchelonType { get; set; } + public int SlotNumber { get; set; } + //public AssistRelation AssistRelation { get; set; } + public int EchelonSlotType { get; set; } + public int EchelonSlotIndex { get; set; } + public long DecodedShardId { get; set; } + public long DecodedCharacterDBId { get; set; } + public bool IsMulligan { get; set; } + public bool IsTSAInteraction { get; set; } + } - public class ClanDB { - public long ClanDBId { get; set; } - public string ClanName { get; set; } - public string ClanChannelName { get; set; } - public string ClanPresidentNickName { get; set; } - public long ClanPresidentRepresentCharacterUniqueId { get; set; } - public long ClanPresidentRepresentCharacterCostumeId { get; set; } - public string ClanNotice { get; set; } - public long ClanMemberCount { get; set; } - //public ClanJoinOption ClanJoinOption { get; set; } - } + public class ClanDB + { + public long ClanDBId { get; set; } + public string ClanName { get; set; } + public string ClanChannelName { get; set; } + public string ClanPresidentNickName { get; set; } + public long ClanPresidentRepresentCharacterUniqueId { get; set; } + public long ClanPresidentRepresentCharacterCostumeId { get; set; } + public string ClanNotice { get; set; } + public long ClanMemberCount { get; set; } + public ClanJoinOption ClanJoinOption { get; set; } + } - public class ClanMemberDB { - public long AccountId { get; set; } - public long AccountLevel { get; set; } - public string AccountNickName { get; set; } - public long ClanDBId { get; set; } - public long RepresentCharacterUniqueId { get; set; } - public long RepresentCharacterCostumeId { get; set; } - public long AttendanceCount { get; set; } - //public ClanSocialGrade ClanSocialGrade { get; set; } - public DateTime JoinDate { get; set; } - public DateTime SocialGradeUpdateTime { get; set; } - public DateTime LastLoginDate { get; set; } - public DateTime GameLoginDate { get; set; } - public DateTime AppliedDate { get; set; } - public AccountAttachmentDB AttachmentDB { get; set; } - } + public class ClanMemberDB + { + public long AccountId { get; set; } + public long AccountLevel { get; set; } + public string AccountNickName { get; set; } + public long ClanDBId { get; set; } + public long RepresentCharacterUniqueId { get; set; } + public long RepresentCharacterCostumeId { get; set; } + public long AttendanceCount { get; set; } + //public ClanSocialGrade ClanSocialGrade { get; set; } + public DateTime JoinDate { get; set; } + public DateTime SocialGradeUpdateTime { get; set; } + public DateTime LastLoginDate { get; set; } + public DateTime GameLoginDate { get; set; } + public DateTime AppliedDate { get; set; } + public AccountAttachmentDB AttachmentDB { get; set; } + } - public class ClanMemberDescriptionDB { - public long Exp { get; set; } - public string Comment { get; set; } - public int CollectedCharactersCount { get; set; } - public long ArenaSeasonBestRanking { get; set; } - public long ArenaSeasonCurrentRanking { get; set; } - } + public class ClanMemberDescriptionDB + { + public long Exp { get; set; } + public string Comment { get; set; } + public int CollectedCharactersCount { get; set; } + public long ArenaSeasonBestRanking { get; set; } + public long ArenaSeasonCurrentRanking { get; set; } + } - public class ClearDeckCharacterDB { - public long UniqueId { get; set; } - public int StarGrade { get; set; } - public int Level { get; set; } - public int SlotNumber { get; set; } - public bool HasWeapon { get; set; } - //public SquadType SquadType { get; set; } - public int WeaponStarGrade { get; set; } - } + public class ClearDeckCharacterDB + { + public long UniqueId { get; set; } + public int StarGrade { get; set; } + public int Level { get; set; } + public int SlotNumber { get; set; } + public bool HasWeapon { get; set; } + //public SquadType SquadType { get; set; } + public int WeaponStarGrade { get; set; } + } - public class ClearDeckDB { - public List ClearDeckCharacterDBs { get; set; } - public List MulliganUniqueIds { get; set; } - public long LeaderUniqueId { get; set; } - public long TSSInteractionUniqueId { get; set; } - public EchelonType EchelonType { get; set; } - public long EchelonExtensionType { get; set; } - } + public class ClearDeckDB + { + public List ClearDeckCharacterDBs { get; set; } + public List MulliganUniqueIds { get; set; } + public long LeaderUniqueId { get; set; } + public long TSSInteractionUniqueId { get; set; } + public EchelonType EchelonType { get; set; } + public long EchelonExtensionType { get; set; } + } - public class ClearDeckKey { - public ContentType ContentType { get; set; } + public class ClearDeckKey + { + public ContentType ContentType { get; set; } public long[] Arguments { get; private set; } } - public class ConquestEchelonDB { - public long EventContentId { get; set; } - public StageDifficulty Difficulty { get; set; } - public long TileUniqueId { get; set; } - public EchelonDB EchelonDB { get; set; } - public long AssistCharacterUniqueId { get; set; } - public ClanAssistUseInfo AssistUseInfo { get; set; } - } + public class ConquestEchelonDB + { + public long EventContentId { get; set; } + public StageDifficulty Difficulty { get; set; } + public long TileUniqueId { get; set; } + public EchelonDB EchelonDB { get; set; } + public long AssistCharacterUniqueId { get; set; } + public ClanAssistUseInfo AssistUseInfo { get; set; } + } - public class ConquestErosionDB { - //public ConquestEventObjectType ObjectType { get; set; } - public long ErosionId { get; set; } - public long ConditionSnapshot { get; set; } - public DateTime CreateDate { get; set; } - } + public class ConquestErosionDB + { + //public ConquestEventObjectType ObjectType { get; set; } + public long ErosionId { get; set; } + public long ConditionSnapshot { get; set; } + public DateTime CreateDate { get; set; } + } - public class ConquestEventObjectDB { - public long ConquestObjectDBId { get; set; } - public long EventContentId { get; set; } - public StageDifficulty Difficulty { get; set; } - public long TileUniqueId { get; set; } - public long ObjectId { get; set; } - //public ConquestEventObjectType ObjectType { get; set; } - public bool IsAlive { get; set; } - } + public class ConquestEventObjectDB + { + public long ConquestObjectDBId { get; set; } + public long EventContentId { get; set; } + public StageDifficulty Difficulty { get; set; } + public long TileUniqueId { get; set; } + public long ObjectId { get; set; } + //public ConquestEventObjectType ObjectType { get; set; } + public bool IsAlive { get; set; } + } - public class ConquestInfoDB { - public long AccountId { get; set; } - public long EventContentId { get; set; } - public int EventGauge { get; set; } - public int EventSpawnCount { get; set; } - public int EchelonChangeCount { get; set; } - public int TodayConquestRentCount { get; set; } - public int TodayOperationRentCount { get; set; } - public long CumulatedConditionValue { get; set; } - public long ReceivedCalculateRewardConditionAmount { get; set; } - public long CalculateRewardConditionValue { get; set; } - public long? AlertMassErosionId { get; set; } - } + public class ConquestInfoDB + { + public long AccountId { get; set; } + public long EventContentId { get; set; } + public int EventGauge { get; set; } + public int EventSpawnCount { get; set; } + public int EchelonChangeCount { get; set; } + public int TodayConquestRentCount { get; set; } + public int TodayOperationRentCount { get; set; } + public long CumulatedConditionValue { get; set; } + public long ReceivedCalculateRewardConditionAmount { get; set; } + public long CalculateRewardConditionValue { get; set; } + public long? AlertMassErosionId { get; set; } + } - public class ConquestMainStoryStepSummary { - public long ConqueredTileCount { get; set; } - public long AllTileCount { get; set; } - public bool IsStepOpen { get; set; } - } + public class ConquestMainStoryStepSummary + { + public long ConqueredTileCount { get; set; } + public long AllTileCount { get; set; } + public bool IsStepOpen { get; set; } + } - public class ConquestMainStorySummary { - public long EventContentId { get; set; } - public StageDifficulty Difficulty { get; set; } - public Dictionary ConquestStepSummaryDict { get; set; } - } + public class ConquestMainStorySummary + { + public long EventContentId { get; set; } + public StageDifficulty Difficulty { get; set; } + public Dictionary ConquestStepSummaryDict { get; set; } + } - public class ConquestStageSaveDB { - public ContentType ContentType { get; set; } - public long? ConquestEventObjectDBId { get; set; } - public long EventContentId { get; set; } - public StageDifficulty Difficulty { get; set; } - public long TileUniqueId { get; set; } - public long TilePresetId { get; set; } - //public ConquestTileType ConquestTileType { get; set; } - public bool UseManageEchelon { get; set; } - public AssistCharacterDB AssistCharacterDB { get; set; } - public int EchelonSlotType { get; set; } - public int EchelonSlotIndex { get; set; } - } + public class ConquestStageSaveDB + { + public ContentType ContentType { get; set; } + public long? ConquestEventObjectDBId { get; set; } + public long EventContentId { get; set; } + public StageDifficulty Difficulty { get; set; } + public long TileUniqueId { get; set; } + public long TilePresetId { get; set; } + public ConquestTileType ConquestTileType { get; set; } + public bool UseManageEchelon { get; set; } + public AssistCharacterDB AssistCharacterDB { get; set; } + public int EchelonSlotType { get; set; } + public int EchelonSlotIndex { get; set; } + } - public class ConquestStepSummary { - public long ConqueredTileCount { get; set; } - public long AllTileCount { get; set; } - public long ErosionRemainingCount { get; set; } - public bool HasPhaseComplete { get; set; } - public bool IsErosionPhaseStart { get; set; } - public bool IsStepOpen { get; set; } - } + public class ConquestStepSummary + { + public long ConqueredTileCount { get; set; } + public long AllTileCount { get; set; } + public long ErosionRemainingCount { get; set; } + public bool HasPhaseComplete { get; set; } + public bool IsErosionPhaseStart { get; set; } + public bool IsStepOpen { get; set; } + } - public class ConquestSummary { - public long EventContentId { get; set; } - public StageDifficulty Difficulty { get; set; } - public Dictionary ConquestStepSummaryDict { get; set; } - } + public class ConquestSummary + { + public long EventContentId { get; set; } + public StageDifficulty Difficulty { get; set; } + public Dictionary ConquestStepSummaryDict { get; set; } + } - public class ConquestTileDB { - public long EventContentId { get; set; } - public StageDifficulty Difficulty { get; set; } - public long TileUniqueId { get; set; } - //public TileState TileState { get; set; } - public long Level { get; set; } - public DateTime CreateTime { get; set; } - public bool IsThreeStarClear { get; set; } - public bool IsAnyStarClear { get; set; } - public long BestStarRecord { get; set; } + public class ConquestTileDB + { + public long EventContentId { get; set; } + public StageDifficulty Difficulty { get; set; } + public long TileUniqueId { get; set; } + public TileState TileState { get; set; } + public long Level { get; set; } + public DateTime CreateTime { get; set; } + public bool IsThreeStarClear { get; set; } + public bool IsAnyStarClear { get; set; } + public long BestStarRecord { get; set; } public bool[] StarFlags { get; set; } } - public class ConquestTreasureBoxDB { - //public ConquestEventObjectType ObjectType { get; set; } - } - - - public class ConquestUnexpectedEnemyDB { - public long UnitId { get; set; } - //public ConquestEventObjectType ObjectType { get; set; } - } - - - public class ConsumableItemBaseDB { - public ParcelKeyPair Key { get; set; } - public long ServerId { get; set; } - public long UniqueId { get; set; } - public long StackCount { get; set; } - public bool CanConsume { get; set; } - } - - - public class ConsumeRequestDB { - public Dictionary ConsumeItemServerIdAndCounts { get; set; } - public Dictionary ConsumeEquipmentServerIdAndCounts { get; set; } - public Dictionary ConsumeFurnitureServerIdAndCounts { get; set; } - public bool IsItemsValid { get; set; } - public bool IsEquipmentsValid { get; set; } - public bool IsFurnituresValid { get; set; } - public bool IsValid { get; set; } - } - - - public class ConsumeResultDB { - public List RemovedItemServerIds { get; set; } - public List RemovedEquipmentServerIds { get; set; } - public List RemovedFurnitureServerIds { get; set; } - public Dictionary UsedItemServerIdAndRemainingCounts { get; set; } - public Dictionary UsedEquipmentServerIdAndRemainingCounts { get; set; } - public Dictionary UsedFurnitureServerIdAndRemainingCounts { get; set; } - } - - - public class ContentSaveDB { - public ContentType ContentType { get; set; } - public long AccountServerId { get; set; } - public DateTime CreateTime { get; set; } - public long StageUniqueId { get; set; } - public long LastEnterStageEchelonNumber { get; set; } - public List StageEntranceFee { get; set; } - public Dictionary EnemyKillCountByUniqueId { get; set; } - public long TacticClearTimeMscSum { get; set; } - public long AccountLevelWhenCreateDB { get; set; } - public string BIEchelon { get; set; } - public string BIEchelon1 { get; set; } - public string BIEchelon2 { get; set; } - public string BIEchelon3 { get; set; } - public string BIEchelon4 { get; set; } - } - - - public class ContentsValueChangeDB { - //public ContentsChangeType ContentsChangeType { get; set; } - } - - - public class CostumeDB { - public ParcelType Type { get; set; } - public IEnumerable ParcelInfos { get; set; } - public long UniqueId { get; set; } - public long BoundCharacterServerId { get; set; } - } - - - public class CraftInfoDB { - public long SlotSequence { get; set; } - public DateTime StartTime { get; set; } - public DateTime EndTime { get; set; } - public DateTime CraftSlotOpenDate { get; set; } - public List Nodes { get; set; } - public IEnumerable ResultIds { get; set; } - public IEnumerable RewardParcelInfos { get; set; } - } - - - public class CraftNodeDB { - //public CraftNodeTier NodeTier { get; set; } - public long SlotSequence { get; set; } - public long NodeId { get; set; } - public long NodeQuality { get; set; } - public long NodeLevel { get; set; } - public int NodeRandomSeed { get; set; } - public int NodeRandomSequence { get; set; } - public List LeafNodeIds { get; set; } - public long ResultId { get; set; } - public CraftNodeResult CraftNodeResult { get; set; } - public ParcelInfo RewardParcelInfo { get; set; } - } - - - public class CraftNodeResult { - //public CraftNodeTier NodeTier { get; set; } - public ParcelInfo ParcelInfo { get; set; } - } - - - public class CraftPresetNodeDB { - //public CraftNodeTier NodeTier { get; set; } - public bool IsActivated { get; set; } - public long PriortyNodeId { get; set; } - public ConsumeRequestDB ConsumeRequestDB { get; set; } - } - - - public class CraftPresetSlotDB { - public List PresetNodeDBs { get; set; } - } - - - public class DailyResetCount { - public long AccountId { get; set; } - public DateTime UpdateDate { get; set; } - public long ResetContentCode { get; set; } - public long ResetCount { get; set; } - //public ResetContentType ResetContentType { get; set; } - } - - - public class DailyResetCountDB { - public long AccountServerId { get; set; } - //public Dictionary ResetCount { get; set; } - } - - - public class DetailedAccountInfoDB { - public string Nickname { get; set; } - public long Level { get; set; } - public string ClanName { get; set; } - public string Comment { get; set; } - public long FriendCount { get; set; } - public string FriendCode { get; set; } - public long RepresentCharacterUniqueId { get; set; } - public long CharacterCount { get; set; } - public long? LastNormalCampaignClearStageId { get; set; } - public long? LastHardCampaignClearStageId { get; set; } - public long? ArenaRanking { get; set; } - public long? RaidRanking { get; set; } - public int? RaidTier { get; set; } - public long? EliminateRaidRanking { get; set; } - public int? EliminateRaidTier { get; set; } - public AssistCharacterDB[] AssistCharacterDBs { get; set; } + public class ConquestTreasureBoxDB + { + //public ConquestEventObjectType ObjectType { get; set; } } - public class EchelonDB { - public long AccountServerId { get; set; } - public EchelonType EchelonType { get; set; } - public long EchelonNumber { get; set; } - public EchelonExtensionType ExtensionType { get; set; } - public long LeaderServerId { get; set; } - public int MainSlotCount { get; set; } - public int SupportSlotCount { get; set; } - public List MainSlotServerIds { get; set; } - public List SupportSlotServerIds { get; set; } - public long TSSInteractionServerId { get; set; } - //public EchelonStatusFlag UsingFlag { get; set; } - public bool IsUsing { get; set; } - public List AllCharacterServerIds { get; set; } - public List AllCharacterWithoutTSSServerIds { get; set; } - public List BattleCharacterServerIds { get; set; } - public List SkillCardMulliganCharacterIds { get; set; } - } + public class ConquestUnexpectedEnemyDB + { + public long UnitId { get; set; } + //public ConquestEventObjectType ObjectType { get; set; } + } - public class EchelonPresetDB { - public int GroupIndex { get; set; } - public int Index { get; set; } - public string Label { get; set; } - public long LeaderUniqueId { get; set; } - public long TSSInteractionUniqueId { get; set; } - public List MulliganUniqueIds { get; set; } - public EchelonExtensionType ExtensionType { get; set; } - public int StrikerSlotCount { get; set; } - public int SpecialSlotCount { get; set; } + public class ConsumableItemBaseDB : ParcelBase + { + public ParcelKeyPair Key { get; set; } + public long ServerId { get; set; } + public long UniqueId { get; set; } + public long StackCount { get; set; } + public bool CanConsume { get; set; } + } + + + public class ConsumeRequestDB + { + public Dictionary ConsumeItemServerIdAndCounts { get; set; } + public Dictionary ConsumeEquipmentServerIdAndCounts { get; set; } + public Dictionary ConsumeFurnitureServerIdAndCounts { get; set; } + public bool IsItemsValid { get; set; } + public bool IsEquipmentsValid { get; set; } + public bool IsFurnituresValid { get; set; } + public bool IsValid { get; set; } + } + + + public class ConsumeResultDB + { + public List RemovedItemServerIds { get; set; } + public List RemovedEquipmentServerIds { get; set; } + public List RemovedFurnitureServerIds { get; set; } + public Dictionary UsedItemServerIdAndRemainingCounts { get; set; } + public Dictionary UsedEquipmentServerIdAndRemainingCounts { get; set; } + public Dictionary UsedFurnitureServerIdAndRemainingCounts { get; set; } + } + + + public class ContentSaveDB + { + public ContentType ContentType { get; set; } + public long AccountServerId { get; set; } + public DateTime CreateTime { get; set; } + public long StageUniqueId { get; set; } + public long LastEnterStageEchelonNumber { get; set; } + public List StageEntranceFee { get; set; } + public Dictionary EnemyKillCountByUniqueId { get; set; } + public long TacticClearTimeMscSum { get; set; } + public long AccountLevelWhenCreateDB { get; set; } + public string BIEchelon { get; set; } + public string BIEchelon1 { get; set; } + public string BIEchelon2 { get; set; } + public string BIEchelon3 { get; set; } + public string BIEchelon4 { get; set; } + } + + + public class ContentsValueChangeDB + { + public ContentsChangeType ContentsChangeType { get; set; } + } + + + public class CostumeDB : ParcelBase + { + public ParcelType Type { get; set; } + public IEnumerable ParcelInfos { get; set; } + public long UniqueId { get; set; } + public long BoundCharacterServerId { get; set; } + } + + + public class CraftInfoDB + { + public long SlotSequence { get; set; } + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } + public DateTime CraftSlotOpenDate { get; set; } + public List Nodes { get; set; } + public IEnumerable ResultIds { get; set; } + public IEnumerable RewardParcelInfos { get; set; } + } + + + public class CraftNodeDB + { + public CraftNodeTier NodeTier { get; set; } + public long SlotSequence { get; set; } + public long NodeId { get; set; } + public long NodeQuality { get; set; } + public long NodeLevel { get; set; } + public int NodeRandomSeed { get; set; } + public int NodeRandomSequence { get; set; } + public List LeafNodeIds { get; set; } + public long ResultId { get; set; } + public CraftNodeResult CraftNodeResult { get; set; } + public ParcelInfo RewardParcelInfo { get; set; } + } + + + public class CraftNodeResult + { + public CraftNodeTier NodeTier { get; set; } + public ParcelInfo ParcelInfo { get; set; } + } + + + public class CraftPresetNodeDB + { + public CraftNodeTier NodeTier { get; set; } + public bool IsActivated { get; set; } + public long PriortyNodeId { get; set; } + public ConsumeRequestDB ConsumeRequestDB { get; set; } + } + + + public class CraftPresetSlotDB + { + public List PresetNodeDBs { get; set; } + } + + + public class DailyResetCount + { + public long AccountId { get; set; } + public DateTime UpdateDate { get; set; } + public long ResetContentCode { get; set; } + public long ResetCount { get; set; } + public ResetContentType ResetContentType { get; set; } + } + + + public class DailyResetCountDB + { + public long AccountServerId { get; set; } + public Dictionary ResetCount { get; set; } + } + + + public class DetailedAccountInfoDB + { + public string Nickname { get; set; } + public long Level { get; set; } + public string ClanName { get; set; } + public string Comment { get; set; } + public long FriendCount { get; set; } + public string FriendCode { get; set; } + public long RepresentCharacterUniqueId { get; set; } + public long CharacterCount { get; set; } + public long? LastNormalCampaignClearStageId { get; set; } + public long? LastHardCampaignClearStageId { get; set; } + public long? ArenaRanking { get; set; } + public long? RaidRanking { get; set; } + public int? RaidTier { get; set; } + public long? EliminateRaidRanking { get; set; } + public int? EliminateRaidTier { get; set; } + public AssistCharacterDB[] AssistCharacterDBs { get; set; } + } + + public enum EchelonStatusFlag + { + None, + BeforeDeploy, + OnDuty + } + + public class EchelonDB + { + public long AccountServerId { get; set; } + public EchelonType EchelonType { get; set; } + public long EchelonNumber { get; set; } + public EchelonExtensionType ExtensionType { get; set; } + public long LeaderServerId { get; set; } + public int MainSlotCount { get; set; } + public int SupportSlotCount { get; set; } + public List MainSlotServerIds { get; set; } + public List SupportSlotServerIds { get; set; } + public long TSSInteractionServerId { get; set; } + public EchelonStatusFlag UsingFlag { get; set; } + public bool IsUsing { get; set; } + public List AllCharacterServerIds { get; set; } + public List AllCharacterWithoutTSSServerIds { get; set; } + public List BattleCharacterServerIds { get; set; } + public List SkillCardMulliganCharacterIds { get; set; } + } + + + public class EchelonPresetDB + { + public int GroupIndex { get; set; } + public int Index { get; set; } + public string Label { get; set; } + public long LeaderUniqueId { get; set; } + public long TSSInteractionUniqueId { get; set; } + public List MulliganUniqueIds { get; set; } + public EchelonExtensionType ExtensionType { get; set; } + public int StrikerSlotCount { get; set; } + public int SpecialSlotCount { get; set; } public long[] SpecialUniqueIds { get; set; } public long[] StrikerUniqueIds { get; set; } } - public class EchelonPresetGroupDB { - public int GroupIndex { get; set; } - public EchelonExtensionType ExtensionType { get; set; } - public string GroupLabel { get; set; } - public Dictionary PresetDBs { get; set; } - public EchelonPresetDB Item { get; set; } - } + public class EchelonPresetGroupDB + { + public int GroupIndex { get; set; } + public EchelonExtensionType ExtensionType { get; set; } + public string GroupLabel { get; set; } + public Dictionary PresetDBs { get; set; } + public EchelonPresetDB Item { get; set; } + } - public class EliminateRaidLobbyInfoDB { - public List OpenedBossGroups { get; set; } - public Dictionary BestRankingPointPerBossGroup { get; set; } - } + public class EliminateRaidLobbyInfoDB + { + public List OpenedBossGroups { get; set; } + public Dictionary BestRankingPointPerBossGroup { get; set; } + } - public class EmblemDB { - public ParcelType Type { get; set; } - public long UniqueId { get; set; } - public DateTime ReceiveDate { get; set; } - public IEnumerable ParcelInfos { get; set; } - } + public class EmblemDB + { + public ParcelType Type { get; set; } + public long UniqueId { get; set; } + public DateTime ReceiveDate { get; set; } + public IEnumerable ParcelInfos { get; set; } + } - public class EquipmentBatchGrowthRequestDB { - public long TargetServerId { get; set; } - public List ConsumeRequestDBs { get; set; } - public long AfterTier { get; set; } - public long AfterLevel { get; set; } - public long AfterExp { get; set; } - public List ReplaceInfos { get; set; } - } + public class EquipmentBatchGrowthRequestDB + { + public long TargetServerId { get; set; } + public List ConsumeRequestDBs { get; set; } + public long AfterTier { get; set; } + public long AfterLevel { get; set; } + public long AfterExp { get; set; } + public List ReplaceInfos { get; set; } + } - public class EquipmentDB { - public ParcelType Type { get; set; } - public IEnumerable ParcelInfos { get; set; } - public int Level { get; set; } - public long Exp { get; set; } - public int Tier { get; set; } - public long BoundCharacterServerId { get; set; } - public bool IsNew { get; set; } - public bool IsLocked { get; set; } - public bool CanConsume { get; set; } - } + public class EquipmentDB : ConsumableItemBaseDB + { + public ParcelType Type { get; set; } + public IEnumerable ParcelInfos { get; set; } + public int Level { get; set; } + public long Exp { get; set; } + public int Tier { get; set; } + public long BoundCharacterServerId { get; set; } + public bool IsNew { get; set; } + public bool IsLocked { get; set; } + public bool CanConsume { get; set; } + } - public class EquipmentExcelData { - public ParcelType Type { get; set; } - public long UniqueId { get; set; } - public long ShiftingCraftQuality { get; set; } - public long StackableMax { get; set; } - public Rarity Rarity { get; set; } - public IReadOnlyList Tags { get; set; } - //public IReadOnlyDictionary CraftQualityDict { get; set; } - //public EquipmentExcel _excel { get; set; } - } + public class EquipmentExcelData + { + public ParcelType Type { get; set; } + public long UniqueId { get; set; } + public long ShiftingCraftQuality { get; set; } + public long StackableMax { get; set; } + public Rarity Rarity { get; set; } + public IReadOnlyList Tags { get; set; } + public IReadOnlyDictionary CraftQualityDict { get; set; } + public EquipmentExcel _excel { get; set; } + } - public class EventContentBonusRewardDB { - public long EventContentId { get; set; } - public long EventStageUniqueId { get; set; } - public ParcelInfo BonusParcelInfo { get; set; } - } + public class EventContentBonusRewardDB + { + public long EventContentId { get; set; } + public long EventStageUniqueId { get; set; } + public ParcelInfo BonusParcelInfo { get; set; } + } - public class EventContentBoxGachaData { - public long EventContentId { get; set; } - public Dictionary Variations { get; set; } - } + public class EventContentBoxGachaData + { + public long EventContentId { get; set; } + public Dictionary Variations { get; set; } + } - public class EventContentBoxGachaDB { - public long AccountId { get; set; } - public long EventContentId { get; set; } - public long Seed { get; set; } - public long Round { get; set; } - public int PurchaseCount { get; set; } - } + public class EventContentBoxGachaDB + { + public long AccountId { get; set; } + public long EventContentId { get; set; } + public long Seed { get; set; } + public long Round { get; set; } + public int PurchaseCount { get; set; } + } - public class EventContentBoxGachaElement { - public long EventContentId { get; set; } - public long VariationId { get; set; } - public long Round { get; set; } - public long GroupId { get; set; } - public long UniqueId { get; set; } - public bool IsPrize { get; set; } - public List Rewards { get; set; } - } + public class EventContentBoxGachaElement + { + public long EventContentId { get; set; } + public long VariationId { get; set; } + public long Round { get; set; } + public long GroupId { get; set; } + public long UniqueId { get; set; } + public bool IsPrize { get; set; } + public List Rewards { get; set; } + } - public class EventContentBoxGachaRoundElement { - public long EventContentId { get; set; } - public long VariationId { get; set; } - public long Round { get; set; } - public List Elements { get; set; } - } + public class EventContentBoxGachaRoundElement + { + public long EventContentId { get; set; } + public long VariationId { get; set; } + public long Round { get; set; } + public List Elements { get; set; } + } - public class EventContentBoxGachaVariation { - public long EventContentId { get; set; } - public long VariationId { get; set; } - public Dictionary GachaRoundElements { get; set; } - } + public class EventContentBoxGachaVariation + { + public long EventContentId { get; set; } + public long VariationId { get; set; } + public Dictionary GachaRoundElements { get; set; } + } - public class EventContentChangeDB { - public long AccountId { get; set; } - public long EventContentId { get; set; } - public long UseAmount { get; set; } - public long ChangeCount { get; set; } - public long AccumulateChangeCount { get; set; } - public DateTime LastUpdateDate { get; set; } - public bool ChangeFlag { get; set; } - } + public class EventContentChangeDB + { + public long AccountId { get; set; } + public long EventContentId { get; set; } + public long UseAmount { get; set; } + public long ChangeCount { get; set; } + public long AccumulateChangeCount { get; set; } + public DateTime LastUpdateDate { get; set; } + public bool ChangeFlag { get; set; } + } - public class EventContentCollectionDB { - public long EventContentId { get; set; } - public long GroupId { get; set; } - public long UniqueId { get; set; } - public DateTime ReceiveDate { get; set; } - } + public class EventContentCollectionDB + { + public long EventContentId { get; set; } + public long GroupId { get; set; } + public long UniqueId { get; set; } + public DateTime ReceiveDate { get; set; } + } - public class EventContentDiceRaceDB { - public long EventContentId { get; set; } - public long Node { get; set; } - public long LapCount { get; set; } - public long DiceRollCount { get; set; } - public long ReceiveRewardLapCount { get; set; } - } + public class EventContentDiceRaceDB + { + public long EventContentId { get; set; } + public long Node { get; set; } + public long LapCount { get; set; } + public long DiceRollCount { get; set; } + public long ReceiveRewardLapCount { get; set; } + } - public class EventContentDiceResult { - public int Index { get; set; } - public int MoveAmount { get; set; } - public List Rewards { get; set; } - } + public class EventContentDiceResult + { + public int Index { get; set; } + public int MoveAmount { get; set; } + public List Rewards { get; set; } + } - public class EventContentFortuneGachaStackCountDB { - public long AccountId { get; set; } - public long EventContentId { get; set; } - public int GachaStackCount { get; set; } - } + public class EventContentFortuneGachaStackCountDB + { + public long AccountId { get; set; } + public long EventContentId { get; set; } + public int GachaStackCount { get; set; } + } - public class EventContentLocationDB { - public long AccountId { get; set; } - public long LocationId { get; set; } - public long Rank { get; set; } - public long Exp { get; set; } - public long ScheduleCount { get; set; } - public Dictionary> ZoneVisitCharacterDBs { get; set; } - } + public class EventContentLocationDB + { + public long AccountId { get; set; } + public long LocationId { get; set; } + public long Rank { get; set; } + public long Exp { get; set; } + public long ScheduleCount { get; set; } + public Dictionary> ZoneVisitCharacterDBs { get; set; } + } - public class EventContentMainGroundStageSaveDB { - public ContentType ContentType { get; set; } - } + public class EventContentMainGroundStageSaveDB + { + public ContentType ContentType { get; set; } + } - public class EventContentMainStageSaveDB { - public ContentType ContentType { get; set; } - public Dictionary SelectedBuffDict { get; set; } - public bool IsBuffSelectPopupOpen { get; set; } - public long CurrentAppearedBuffGroupId { get; set; } - } + public class EventContentMainStageSaveDB + { + public ContentType ContentType { get; set; } + public Dictionary SelectedBuffDict { get; set; } + public bool IsBuffSelectPopupOpen { get; set; } + public long CurrentAppearedBuffGroupId { get; set; } + } - public class EventContentPermanentDB { - public long EventContentId { get; set; } - public bool IsStageAllClear { get; set; } - } + public class EventContentPermanentDB + { + public long EventContentId { get; set; } + public bool IsStageAllClear { get; set; } + } - public class EventContentStoryStageSaveDB { - public ContentType ContentType { get; set; } - } + public class EventContentStoryStageSaveDB + { + public ContentType ContentType { get; set; } + } - public class EventContentSubStageSaveDB { - public ContentType ContentType { get; set; } - } + public class EventContentSubStageSaveDB + { + public ContentType ContentType { get; set; } + } - public class EventContentTreasureBoardHistory { - public List TreasureIds { get; set; } - public List NormalCells { get; set; } - public List Treasures { get; set; } - } + public class EventContentTreasureBoardHistory + { + public List TreasureIds { get; set; } + public List NormalCells { get; set; } + public List Treasures { get; set; } + } - public class EventContentTreasureCell { - public int X { get; set; } - public int Y { get; set; } - } + public class EventContentTreasureCell + { + public int X { get; set; } + public int Y { get; set; } + } - public class EventContentTreasureHistoryDB { - public long EventContentId { get; set; } - public int Round { get; set; } - public EventContentTreasureBoardHistory Board { get; set; } - public bool IsComplete { get; set; } - public List HintTreasures { get; set; } - public int MetaRound { get; set; } - public bool CanComplete { get; set; } - public bool CanFlip { get; set; } - //public EventContentTreasureInfo TreasureInfo { get; set; } - //public EventContentTreasureRoundInfo TreasureRoundInfo { get; set; } - } + public class EventContentTreasureHistoryDB + { + public long EventContentId { get; set; } + public int Round { get; set; } + public EventContentTreasureBoardHistory Board { get; set; } + public bool IsComplete { get; set; } + public List HintTreasures { get; set; } + public int MetaRound { get; set; } + public bool CanComplete { get; set; } + public bool CanFlip { get; set; } + //public EventContentTreasureInfo TreasureInfo { get; set; } + //public EventContentTreasureRoundInfo TreasureRoundInfo { get; set; } + } - public class EventContentTreasureObject { - public long ServerId { get; set; } - public long RewardId { get; set; } - public int Rotation { get; set; } - public bool IsHiddenImage { get; set; } - public List Cells { get; set; } - } + public class EventContentTreasureObject + { + public long ServerId { get; set; } + public long RewardId { get; set; } + public int Rotation { get; set; } + public bool IsHiddenImage { get; set; } + public List Cells { get; set; } + } - public class EventContentTreasureSaveBoard { - public long VariationId { get; set; } - public int Round { get; set; } - public List TreasureObjects { get; set; } - } + public class EventContentTreasureSaveBoard + { + public long VariationId { get; set; } + public int Round { get; set; } + public List TreasureObjects { get; set; } + } - public class EventInfoDB { - public long EventId { get; set; } - public uint ImageNameHash { get; set; } - } + public class EventInfoDB + { + public long EventId { get; set; } + public uint ImageNameHash { get; set; } + } - public class EventRewardIncreaseDB { - public EventTargetType EventTargetType { get; set; } - //public BasisPoint Multiplier { get; set; } - public DateTime BeginDate { get; set; } - public DateTime EndDate { get; set; } - } + public class EventRewardIncreaseDB + { + public EventTargetType EventTargetType { get; set; } + //public BasisPoint Multiplier { get; set; } + public DateTime BeginDate { get; set; } + public DateTime EndDate { get; set; } + } - public class FieldStageSaveDB { - public ContentType ContentType { get; set; } - } + public class FieldStageSaveDB + { + public ContentType ContentType { get; set; } + } public class FriendDB { @@ -1478,813 +1313,902 @@ namespace SCHALE.Common.Database { public AccountAttachmentDB AttachmentDB; } - public class FriendIdCardDB { - public int Level { get; set; } - public string FriendCode { get; set; } - public string Comment { get; set; } - public DateTime LastConnectTime { get; set; } - public long RepresentCharacterUniqueId { get; set; } - public long RepresentCharacterCostumeId { get; set; } - public bool SearchPermission { get; set; } - public bool AutoAcceptFriendRequest { get; set; } - public long CardBackgroundId { get; set; } - public bool ShowAccountLevel { get; set; } - public bool ShowFriendCode { get; set; } - public bool ShowRaidRanking { get; set; } - public bool ShowArenaRanking { get; set; } - public bool ShowEliminateRaidRanking { get; set; } - public long? ArenaRanking { get; set; } - public long? RaidRanking { get; set; } - public int? RaidTier { get; set; } - public long? EliminateRaidRanking { get; set; } - public int? EliminateRaidTier { get; set; } - public long EmblemId { get; set; } - } - - - public class FurnitureDB { - public ParcelType Type { get; set; } - public IEnumerable ParcelInfos { get; set; } - //public FurnitureLocation Location { get; set; } - public long CafeDBId { get; set; } - public float PositionX { get; set; } - public float PositionY { get; set; } - public float Rotation { get; set; } - public long ItemDeploySequence { get; set; } - public bool CanConsume { get; set; } - } - - - public class FurnitureExcelData { - public ParcelType Type { get; set; } - public long UniqueId { get; set; } - public long ShiftingCraftQuality { get; set; } - public long StackableMax { get; set; } - public Rarity Rarity { get; set; } - public IReadOnlyList Tags { get; set; } - //public IReadOnlyDictionary CraftQualityDict { get; set; } - //public FurnitureExcel _excel { get; set; } - } - - - public class GachaLogDB { - public long CharacterId { get; set; } - } - - - public class GearDB { - public ParcelType Type { get; set; } - public IEnumerable ParcelInfos { get; set; } - public long ServerId { get; set; } - public long UniqueId { get; set; } - public int Level { get; set; } - public long Exp { get; set; } - public int Tier { get; set; } - public long SlotIndex { get; set; } - public long BoundCharacterServerId { get; set; } - public EquipmentDB ToEquipmentDB { get; set; } - } - - - public class GearTierUpRequestDB { - public long TargetServerId { get; set; } - public long AfterTier { get; set; } - public List ReplaceInfos { get; set; } - } - - - public class GuideMissionSeasonDB { - public long SeasonId { get; set; } - public long LoginCount { get; set; } - public DateTime StartDate { get; set; } - public DateTime LoginDate { get; set; } - public bool IsComplete { get; set; } - public bool IsFinalMissionComplete { get; set; } - public DateTime? CollectionItemReceiveDate { get; set; } - } - - - public class IConsumableItemBaseExcel { - public ParcelType Type { get; set; } - public long UniqueId { get; set; } - public long ShiftingCraftQuality { get; set; } - public long StackableMax { get; set; } - public Rarity Rarity { get; set; } - public IReadOnlyList Tags { get; set; } - //public IReadOnlyDictionary CraftQualityDict { get; set; } - } - - - public class IdCardBackgroundDB { - public ParcelType Type { get; set; } - public long ServerId { get; set; } - public long UniqueId { get; set; } - public IEnumerable ParcelInfos { get; set; } - } - - - public class ItemDB { - public ParcelType Type { get; set; } - public IEnumerable ParcelInfos { get; set; } - public bool IsNew { get; set; } - public bool IsLocked { get; set; } - public bool CanConsume { get; set; } - } - - - public class ItemExcelData { - public ParcelType Type { get; set; } - public long UniqueId { get; set; } - public long ShiftingCraftQuality { get; set; } - public long StackableMax { get; set; } - public Rarity Rarity { get; set; } - public IReadOnlyList Tags { get; set; } - //public IReadOnlyDictionary CraftQualityDict { get; set; } - //public ItemExcel _excel { get; set; } - } - - - public class MailDB { - public long ServerId { get; set; } - public long AccountServerId { get; set; } - //public MailType Type { get; set; } - public long UniqueId { get; set; } - public string Sender { get; set; } - public string Comment { get; set; } - public DateTime SendDate { get; set; } - public DateTime? ReceiptDate { get; set; } - public DateTime? ExpireDate { get; set; } - public List ParcelInfos { get; set; } - public List RemainParcelInfos { get; set; } - } - - - public class MemoryLobbyDB { - public ParcelType Type { get; set; } - public IEnumerable ParcelInfos { get; set; } - public long AccountServerId { get; set; } - public long MemoryLobbyUniqueId { get; set; } - } - - - public class MiniGameHistoryDB { - public long EventContentId { get; set; } - public long UniqueId { get; set; } - public long HighScore { get; set; } - public long AccumulatedScore { get; set; } - public DateTime ClearDate { get; set; } - public bool IsFullCombo { get; set; } - } - - - public class MiniGameResult { - public EventContentType ContentType { get; set; } - public long EventContentId { get; set; } - public long UniqueId { get; set; } - public long TotalScore { get; set; } - public long ComboCount { get; set; } - public long FeverCount { get; set; } - public bool AllCombo { get; set; } - public long HPBonusScore { get; set; } - public long NoteCount { get; set; } - public long CriticalCount { get; set; } - } - - - public class MiniGameShootingHistoryDB { - public long EventContentId { get; set; } - public long UniqueId { get; set; } - public long ArriveSection { get; set; } - public DateTime LastUpdateDate { get; set; } - public bool IsClearToday { get; set; } - } - - - public class MissionHistoryDB { - public long ServerId { get; set; } - public long AccountServerId { get; set; } - public long MissionUniqueId { get; set; } - public DateTime CompleteTime { get; set; } - public bool Expired { get; set; } - } - - - public class MissionProgressDB { - public long ServerId { get; set; } - public long AccountServerId { get; set; } - public long MissionUniqueId { get; set; } - public bool Complete { get; set; } - public DateTime StartTime { get; set; } - public Dictionary ProgressParameters { get; set; } - } - - - public class MissionSnapshot { - public long AccountId { get; set; } - public List MissionHistoryDBs { get; set; } - public List MissionProgressDBs { get; set; } - public List GuideMissionSeasonDBs { get; set; } - public DailyResetCount DailyResetMissionPivotDate { get; set; } - public DailyResetCount WeeklyResetMissionPivotDate { get; set; } - } - - - public class MomoTalkChoiceDB { - public long CharacterDBId { get; set; } - public long MessageGroupId { get; set; } - public long ChosenMessageId { get; set; } - public DateTime ChosenDate { get; set; } - } - - - public class MomoTalkOutLineDB { - public long CharacterDBId { get; set; } - public long CharacterId { get; set; } - public long LatestMessageGroupId { get; set; } - public long? ChosenMessageId { get; set; } - public DateTime LastUpdateDate { get; set; } - } - - - public class MonthlyProductPurchaseDB { - public long ProductId { get; set; } - public DateTime PurchaseDate { get; set; } - public DateTime? LastDailyRewardDate { get; set; } - public DateTime? RewardEndDate { get; set; } - //public ProductTagType ProductTagType { get; set; } - } - - - public class MultiFloorRaidDB { - public long SeasonId { get; set; } - public int ClearedDifficulty { get; set; } - public DateTime LastClearDate { get; set; } - public int RewardDifficulty { get; set; } - public DateTime LastRewardDate { get; set; } - public int ClearBattleFrame { get; set; } - public bool AllCleared { get; set; } - public bool HasReceivableRewards { get; set; } - public List TotalReceivableRewards { get; set; } - public List TotalReceivedRewards { get; set; } - } - - - public class MultiSweepPresetDB { - public long PresetId { get; set; } - public string PresetName { get; set; } - public IEnumerable StageIds { get; set; } - } - - - public class OpenConditionDB { - //public OpenConditionContent ContentType { get; set; } - public bool HideWhenLocked { get; set; } - public long AccountLevel { get; set; } - public long ScenarioModeId { get; set; } - public long CampaignStageUniqueId { get; set; } - //public MultipleConditionCheckType MultipleConditionCheckType { get; set; } - //public WeekDay OpenDayOfWeek { get; set; } - public long OpenHour { get; set; } - //public WeekDay CloseDayOfWeek { get; set; } - public long CloseHour { get; set; } - public long CafeIdForCafeRank { get; set; } - public long CafeRank { get; set; } - public long OpenedCafeId { get; set; } - } - - - public class PotentialGrowthRequestDB { - //public PotentialStatBonusRateType Type { get; set; } - public int Level { get; set; } - } - - - public class ProductPurchaseCountDB { - public long EventContentId { get; set; } - public long AccountId { get; set; } - public long ShopExcelId { get; set; } - public int PurchaseCount { get; set; } - public DateTime LastPurchaseDate { get; set; } - //public PurchaseCountResetType PurchaseCountResetType { get; set; } - public DateTime ResetDate { get; set; } - } - - - public class PurchaseCountDB { - public long ShopCashId { get; set; } - public int PurchaseCount { get; set; } - public DateTime ResetDate { get; set; } - public DateTime? PurchaseDate { get; set; } - public DateTime? ManualResetDate { get; set; } - } - - - public class PurchaseOrderDB { - public long ShopCashId { get; set; } - //public PurchaseStatusCode StatusCode { get; set; } - public long PurchaseOrderId { get; set; } - } - - - public class RaidBattleDB { - public ContentType ContentType { get; set; } - public long RaidUniqueId { get; set; } - public int RaidBossIndex { get; set; } - public long CurrentBossHP { get; set; } - public long CurrentBossGroggy { get; set; } - public long CurrentBossAIPhase { get; set; } - public string BIEchelon { get; set; } - public bool IsClear { get; set; } - //public RaidMemberCollection RaidMembers { get; set; } - public List SubPartsHPs { get; set; } - } - - - public class RaidBossDB { - public ContentType ContentType { get; set; } - public int BossIndex { get; set; } - public long BossCurrentHP { get; set; } - public long BossGroggyPoint { get; set; } - } - - - public class RaidCharacterDB { - public long ServerId { get; set; } - public long UniqueId { get; set; } - public int StarGrade { get; set; } - public int Level { get; set; } - public int SlotIndex { get; set; } - public long AccountId { get; set; } - public bool IsAssist { get; set; } - public bool HasWeapon { get; set; } - public int WeaponStarGrade { get; set; } - public long CostumeId { get; set; } - } - - - public class RaidDB { - //public RaidMemberDescription Owner { get; set; } - public ContentType ContentType { get; set; } - public long ServerId { get; set; } - public long UniqueId { get; set; } - public long SeasonId { get; set; } - public DateTime Begin { get; set; } - public DateTime End { get; set; } - public long OwnerAccountServerId { get; set; } - public string OwnerNickname { get; set; } - public long PlayerCount { get; set; } - public string BossGroup { get; set; } - public Difficulty BossDifficulty { get; set; } - public int LastBossIndex { get; set; } - public List Tags { get; set; } - public string SecretCode { get; set; } - //public RaidStatus RaidState { get; set; } - public bool IsPractice { get; set; } - public List RaidBossDBs { get; set; } - public Dictionary> ParticipateCharacterServerIds { get; set; } - public bool IsEnterRoom { get; set; } - public long SessionHitPoint { get; set; } - public long AccountLevelWhenCreateDB { get; set; } - public bool ClanAssistUsed { get; set; } - } - - - public class RaidDetailDB { - public long RaidUniqueId { get; set; } - public DateTime EndDate { get; set; } - public List DamageTable { get; set; } - } - - - public class RaidGiveUpDB { - public long Ranking { get; set; } - public long RankingPoint { get; set; } - public long BestRankingPoint { get; set; } - } - - - public class RaidLimitedRewardHistoryDB { - public ContentType ContentType { get; set; } - public long AccountId { get; set; } - public long SeasonId { get; set; } - public long RewardId { get; set; } - public DateTime ReceiveDate { get; set; } - } - - - public class RaidLobbyInfoDB { - public long SeasonId { get; set; } - public int Tier { get; set; } - public long Ranking { get; set; } - public long BestRankingPoint { get; set; } - public long TotalRankingPoint { get; set; } - public long ReceivedRankingRewardId { get; set; } - public bool CanReceiveRankingReward { get; set; } - public RaidDB PlayingRaidDB { get; set; } - public List ReceiveRewardIds { get; set; } - public List ReceiveLimitedRewardIds { get; set; } - public List ParticipateCharacterServerIds { get; set; } - public Dictionary PlayableHighestDifficulty { get; set; } - public Dictionary SweepPointByRaidUniqueId { get; set; } - public DateTime SeasonStartDate { get; set; } - public DateTime SeasonEndDate { get; set; } - public DateTime SettlementEndDate { get; set; } - public long NextSeasonId { get; set; } - public DateTime NextSeasonStartDate { get; set; } - public DateTime NextSeasonEndDate { get; set; } - public DateTime NextSettlementEndDate { get; set; } - public ClanAssistUseInfo ClanAssistUseInfo { get; set; } - } - - - public class RaidParticipateCharactersDB { - public long RaidServerId { get; set; } - public long AccountServerId { get; set; } - public List ParticipateCharacterServerIds { get; set; } - } - - - public class RaidPlayerInfoDB { - public long RaidServerId { get; set; } - public long AccountId { get; set; } - public DateTime JoinDate { get; set; } - public long DamageAmount { get; set; } - public int RaidEndRewardFlag { get; set; } - public int RaidPlayCount { get; set; } - public string Nickname { get; set; } - public long CharacterId { get; set; } - public long CostumeId { get; set; } - public long? AccountLevel { get; set; } - } - - - public class RaidRankingInfo { - public long SeasonId { get; set; } - public long AccountId { get; set; } - public long Ranking { get; set; } - public long Score { get; set; } - public double ScoreDetail { get; set; } - } - - - public class RaidSeasonHistoryDB { - public long SeasonServerId { get; set; } - public DateTime ReceiveDateTime { get; set; } - public long SeasonRewardGauage { get; set; } - } - - - public class RaidSeasonManageDB { - public long SeasonId { get; set; } - public DateTime SeasonStartDate { get; set; } - public DateTime SeasonEndDate { get; set; } - public DateTime SeasonSettlementEndDate { get; set; } - public DateTime UpdateDate { get; set; } - } - - - public class RaidSeasonPointRewardHistoryDB { - public ContentType ContentType { get; set; } - public long AccountId { get; set; } - public long SeasonId { get; set; } - public long LastReceivedSeasonRewardId { get; set; } - public DateTime SeasonRewardReceiveDate { get; set; } - } - - - public class RaidSeasonRankingHistoryDB { - public ContentType ContentType { get; set; } - public long AccountId { get; set; } - public long SeasonId { get; set; } - public long Ranking { get; set; } - public long BestRankingPoint { get; set; } - public int Tier { get; set; } - public DateTime ReceivedDate { get; set; } - } - - - public class RaidTeamSettingDB { - public long AccountId { get; set; } - public long TryNumber { get; set; } - public EchelonType EchelonType { get; set; } - public EchelonExtensionType EchelonExtensionType { get; set; } - public IList MainCharacterDBs { get; set; } - public IList SupportCharacterDBs { get; set; } - public IList SkillCardMulliganCharacterIds { get; set; } - public long TSSInteractionUniqueId { get; set; } - public long LeaderCharacterUniqueId { get; set; } - } - - - public class RaidUserDB { - public long AccountId { get; set; } - public long RepresentCharacterUniqueId { get; set; } - public long RepresentCharacterCostumeId { get; set; } - public long Level { get; set; } - public string Nickname { get; set; } - public int Tier { get; set; } - public long Rank { get; set; } - public long BestRankingPoint { get; set; } - public double BestRankingPointDetail { get; set; } - public AccountAttachmentDB AccountAttachmentDB { get; set; } - } - - - public class ResetableContentId { - //public ResetContentType Type { get; set; } - public long Mapped { get; set; } - } - - - public class ResetableContentValueDB { - public ResetableContentId ResetableContentId { get; set; } - public long ContentValue { get; set; } - public DateTime LastUpdateTime { get; set; } - } - - - public class ScenarioGroupHistoryDB { - public long AccountServerId { get; set; } - public long ScenarioGroupUqniueId { get; set; } - public long ScenarioType { get; set; } - public long? EventContentId { get; set; } - public DateTime ClearDateTime { get; set; } - public bool IsReturn { get; set; } - public bool IsPermanent { get; set; } - } - - - public class ScenarioHistoryDB { - public long AccountServerId { get; set; } - public long ScenarioUniqueId { get; set; } - public DateTime ClearDateTime { get; set; } - } - - - public class SchoolDungeonStageHistoryDB { - public long AccountServerId { get; set; } - public long StageUniqueId { get; set; } - public long BestStarRecord { get; set; } - public bool Star1Flag { get; set; } - public bool Star2Flag { get; set; } - public bool Star3Flag { get; set; } - public bool IsClearedEver { get; set; } + public class FriendIdCardDB + { + public int Level { get; set; } + public string FriendCode { get; set; } + public string Comment { get; set; } + public DateTime LastConnectTime { get; set; } + public long RepresentCharacterUniqueId { get; set; } + public long RepresentCharacterCostumeId { get; set; } + public bool SearchPermission { get; set; } + public bool AutoAcceptFriendRequest { get; set; } + public long CardBackgroundId { get; set; } + public bool ShowAccountLevel { get; set; } + public bool ShowFriendCode { get; set; } + public bool ShowRaidRanking { get; set; } + public bool ShowArenaRanking { get; set; } + public bool ShowEliminateRaidRanking { get; set; } + public long? ArenaRanking { get; set; } + public long? RaidRanking { get; set; } + public int? RaidTier { get; set; } + public long? EliminateRaidRanking { get; set; } + public int? EliminateRaidTier { get; set; } + public long EmblemId { get; set; } + } + + + public class FurnitureDB : ConsumableItemBaseDB + { + public ParcelType Type { get; set; } + public IEnumerable ParcelInfos { get; set; } + public FurnitureLocation Location { get; set; } + public long CafeDBId { get; set; } + public float PositionX { get; set; } + public float PositionY { get; set; } + public float Rotation { get; set; } + public long ItemDeploySequence { get; set; } + public bool CanConsume { get; set; } + } + + + public class FurnitureExcelData + { + public ParcelType Type { get; set; } + public long UniqueId { get; set; } + public long ShiftingCraftQuality { get; set; } + public long StackableMax { get; set; } + public Rarity Rarity { get; set; } + public IReadOnlyList Tags { get; set; } + public IReadOnlyDictionary CraftQualityDict { get; set; } + public FurnitureExcel _excel { get; set; } + } + + + public class GachaLogDB + { + public long CharacterId { get; set; } + } + + + public class GearDB : ParcelBase + { + public ParcelType Type { get; set; } + public IEnumerable ParcelInfos { get; set; } + public long ServerId { get; set; } + public long UniqueId { get; set; } + public int Level { get; set; } + public long Exp { get; set; } + public int Tier { get; set; } + public long SlotIndex { get; set; } + public long BoundCharacterServerId { get; set; } + public EquipmentDB ToEquipmentDB { get; set; } + } + + + public class GearTierUpRequestDB + { + public long TargetServerId { get; set; } + public long AfterTier { get; set; } + public List ReplaceInfos { get; set; } + } + + + public class GuideMissionSeasonDB + { + public long SeasonId { get; set; } + public long LoginCount { get; set; } + public DateTime StartDate { get; set; } + public DateTime LoginDate { get; set; } + public bool IsComplete { get; set; } + public bool IsFinalMissionComplete { get; set; } + public DateTime? CollectionItemReceiveDate { get; set; } + } + + + public class IConsumableItemBaseExcel + { + public ParcelType Type { get; set; } + public long UniqueId { get; set; } + public long ShiftingCraftQuality { get; set; } + public long StackableMax { get; set; } + public Rarity Rarity { get; set; } + public IReadOnlyList Tags { get; set; } + public IReadOnlyDictionary CraftQualityDict { get; set; } + } + + + public class IdCardBackgroundDB + { + public ParcelType Type { get; set; } + public long ServerId { get; set; } + public long UniqueId { get; set; } + public IEnumerable ParcelInfos { get; set; } + } + + + public class ItemDB : ConsumableItemBaseDB + { + public ParcelType Type { get; set; } + public IEnumerable ParcelInfos { get; set; } + public bool IsNew { get; set; } + public bool IsLocked { get; set; } + public bool CanConsume { get; set; } + } + + + public class ItemExcelData + { + public ParcelType Type { get; set; } + public long UniqueId { get; set; } + public long ShiftingCraftQuality { get; set; } + public long StackableMax { get; set; } + public Rarity Rarity { get; set; } + public IReadOnlyList Tags { get; set; } + public IReadOnlyDictionary CraftQualityDict { get; set; } + public ItemExcel _excel { get; set; } + } + + + public class MailDB + { + public long ServerId { get; set; } + public long AccountServerId { get; set; } + //public MailType Type { get; set; } + public long UniqueId { get; set; } + public string Sender { get; set; } + public string Comment { get; set; } + public DateTime SendDate { get; set; } + public DateTime? ReceiptDate { get; set; } + public DateTime? ExpireDate { get; set; } + public List ParcelInfos { get; set; } + public List RemainParcelInfos { get; set; } + } + + + public class MemoryLobbyDB : ParcelBase + { + public ParcelType Type { get; set; } + public IEnumerable ParcelInfos { get; set; } + public long AccountServerId { get; set; } + public long MemoryLobbyUniqueId { get; set; } + } + + + public class MiniGameHistoryDB + { + public long EventContentId { get; set; } + public long UniqueId { get; set; } + public long HighScore { get; set; } + public long AccumulatedScore { get; set; } + public DateTime ClearDate { get; set; } + public bool IsFullCombo { get; set; } + } + + + public class MiniGameResult + { + public EventContentType ContentType { get; set; } + public long EventContentId { get; set; } + public long UniqueId { get; set; } + public long TotalScore { get; set; } + public long ComboCount { get; set; } + public long FeverCount { get; set; } + public bool AllCombo { get; set; } + public long HPBonusScore { get; set; } + public long NoteCount { get; set; } + public long CriticalCount { get; set; } + } + + + public class MiniGameShootingHistoryDB + { + public long EventContentId { get; set; } + public long UniqueId { get; set; } + public long ArriveSection { get; set; } + public DateTime LastUpdateDate { get; set; } + public bool IsClearToday { get; set; } + } + + + public class MissionHistoryDB + { + public long ServerId { get; set; } + public long AccountServerId { get; set; } + public long MissionUniqueId { get; set; } + public DateTime CompleteTime { get; set; } + public bool Expired { get; set; } + } + + + public class MissionProgressDB + { + [JsonIgnore] + public long ServerId { get; set; } + + [JsonIgnore] + public long AccountServerId { get; set; } + public long MissionUniqueId { get; set; } + public bool Complete { get; set; } + public DateTime StartTime { get; set; } + public Dictionary ProgressParameters { get; set; } + } + + + public class MissionSnapshot + { + public long AccountId { get; set; } + public List MissionHistoryDBs { get; set; } + public List MissionProgressDBs { get; set; } + public List GuideMissionSeasonDBs { get; set; } + public DailyResetCount DailyResetMissionPivotDate { get; set; } + public DailyResetCount WeeklyResetMissionPivotDate { get; set; } + } + + + public class MomoTalkChoiceDB + { + public long CharacterDBId { get; set; } + public long MessageGroupId { get; set; } + public long ChosenMessageId { get; set; } + public DateTime ChosenDate { get; set; } + } + + + public class MomoTalkOutLineDB + { + public long CharacterDBId { get; set; } + public long CharacterId { get; set; } + public long LatestMessageGroupId { get; set; } + public long? ChosenMessageId { get; set; } + public DateTime LastUpdateDate { get; set; } + } + + + public class MonthlyProductPurchaseDB + { + public long ProductId { get; set; } + public DateTime PurchaseDate { get; set; } + public DateTime? LastDailyRewardDate { get; set; } + public DateTime? RewardEndDate { get; set; } + public ProductTagType ProductTagType { get; set; } + } + + + public class MultiFloorRaidDB + { + public long SeasonId { get; set; } + public int ClearedDifficulty { get; set; } + public DateTime LastClearDate { get; set; } + public int RewardDifficulty { get; set; } + public DateTime LastRewardDate { get; set; } + public int ClearBattleFrame { get; set; } + public bool AllCleared { get; set; } + public bool HasReceivableRewards { get; set; } + public List TotalReceivableRewards { get; set; } + public List TotalReceivedRewards { get; set; } + } + + + public class MultiSweepPresetDB + { + public long PresetId { get; set; } + public string PresetName { get; set; } + public IEnumerable StageIds { get; set; } + } + + + public class OpenConditionDB + { + public OpenConditionContent ContentType { get; set; } + public bool HideWhenLocked { get; set; } + public long AccountLevel { get; set; } + public long ScenarioModeId { get; set; } + public long CampaignStageUniqueId { get; set; } + public MultipleConditionCheckType MultipleConditionCheckType { get; set; } + public WeekDay OpenDayOfWeek { get; set; } + public long OpenHour { get; set; } + public WeekDay CloseDayOfWeek { get; set; } + public long CloseHour { get; set; } + public long CafeIdForCafeRank { get; set; } + public long CafeRank { get; set; } + public long OpenedCafeId { get; set; } + } + + + public class PotentialGrowthRequestDB + { + public PotentialStatBonusRateType Type { get; set; } + public int Level { get; set; } + } + + + public class ProductPurchaseCountDB + { + public long EventContentId { get; set; } + public long AccountId { get; set; } + public long ShopExcelId { get; set; } + public int PurchaseCount { get; set; } + public DateTime LastPurchaseDate { get; set; } + public PurchaseCountResetType PurchaseCountResetType { get; set; } + public DateTime ResetDate { get; set; } + } + + + public class PurchaseCountDB + { + public long ShopCashId { get; set; } + public int PurchaseCount { get; set; } + public DateTime ResetDate { get; set; } + public DateTime? PurchaseDate { get; set; } + public DateTime? ManualResetDate { get; set; } + } + + + public class PurchaseOrderDB + { + public long ShopCashId { get; set; } + public PurchaseStatusCode StatusCode { get; set; } + public long PurchaseOrderId { get; set; } + } + + + public class RaidBattleDB + { + public ContentType ContentType { get; set; } + public long RaidUniqueId { get; set; } + public int RaidBossIndex { get; set; } + public long CurrentBossHP { get; set; } + public long CurrentBossGroggy { get; set; } + public long CurrentBossAIPhase { get; set; } + public string BIEchelon { get; set; } + public bool IsClear { get; set; } + //public RaidMemberCollection RaidMembers { get; set; } + public List SubPartsHPs { get; set; } + } + + + public class RaidBossDB + { + public ContentType ContentType { get; set; } + public int BossIndex { get; set; } + public long BossCurrentHP { get; set; } + public long BossGroggyPoint { get; set; } + } + + + public class RaidCharacterDB + { + public long ServerId { get; set; } + public long UniqueId { get; set; } + public int StarGrade { get; set; } + public int Level { get; set; } + public int SlotIndex { get; set; } + public long AccountId { get; set; } + public bool IsAssist { get; set; } + public bool HasWeapon { get; set; } + public int WeaponStarGrade { get; set; } + public long CostumeId { get; set; } + } + + + public class RaidDB + { + //public RaidMemberDescription Owner { get; set; } + public ContentType ContentType { get; set; } + public long ServerId { get; set; } + public long UniqueId { get; set; } + public long SeasonId { get; set; } + public DateTime Begin { get; set; } + public DateTime End { get; set; } + public long OwnerAccountServerId { get; set; } + public string OwnerNickname { get; set; } + public long PlayerCount { get; set; } + public string BossGroup { get; set; } + public Difficulty BossDifficulty { get; set; } + public int LastBossIndex { get; set; } + public List Tags { get; set; } + public string SecretCode { get; set; } + public RaidStatus RaidState { get; set; } + public bool IsPractice { get; set; } + public List RaidBossDBs { get; set; } + public Dictionary> ParticipateCharacterServerIds { get; set; } + public bool IsEnterRoom { get; set; } + public long SessionHitPoint { get; set; } + public long AccountLevelWhenCreateDB { get; set; } + public bool ClanAssistUsed { get; set; } + } + + + public class RaidDetailDB + { + public long RaidUniqueId { get; set; } + public DateTime EndDate { get; set; } + public List DamageTable { get; set; } + } + + + public class RaidGiveUpDB + { + public long Ranking { get; set; } + public long RankingPoint { get; set; } + public long BestRankingPoint { get; set; } + } + + + public class RaidLimitedRewardHistoryDB + { + public ContentType ContentType { get; set; } + public long AccountId { get; set; } + public long SeasonId { get; set; } + public long RewardId { get; set; } + public DateTime ReceiveDate { get; set; } + } + + + public class RaidLobbyInfoDB + { + public long SeasonId { get; set; } + public int Tier { get; set; } + public long Ranking { get; set; } + public long BestRankingPoint { get; set; } + public long TotalRankingPoint { get; set; } + public long ReceivedRankingRewardId { get; set; } + public bool CanReceiveRankingReward { get; set; } + public RaidDB PlayingRaidDB { get; set; } + public List ReceiveRewardIds { get; set; } + public List ReceiveLimitedRewardIds { get; set; } + public List ParticipateCharacterServerIds { get; set; } + public Dictionary PlayableHighestDifficulty { get; set; } + public Dictionary SweepPointByRaidUniqueId { get; set; } + public DateTime SeasonStartDate { get; set; } + public DateTime SeasonEndDate { get; set; } + public DateTime SettlementEndDate { get; set; } + public long NextSeasonId { get; set; } + public DateTime NextSeasonStartDate { get; set; } + public DateTime NextSeasonEndDate { get; set; } + public DateTime NextSettlementEndDate { get; set; } + public ClanAssistUseInfo ClanAssistUseInfo { get; set; } + } + + + public class RaidParticipateCharactersDB + { + public long RaidServerId { get; set; } + public long AccountServerId { get; set; } + public List ParticipateCharacterServerIds { get; set; } + } + + + public class RaidPlayerInfoDB + { + public long RaidServerId { get; set; } + public long AccountId { get; set; } + public DateTime JoinDate { get; set; } + public long DamageAmount { get; set; } + public int RaidEndRewardFlag { get; set; } + public int RaidPlayCount { get; set; } + public string Nickname { get; set; } + public long CharacterId { get; set; } + public long CostumeId { get; set; } + public long? AccountLevel { get; set; } + } + + + public class RaidRankingInfo + { + public long SeasonId { get; set; } + public long AccountId { get; set; } + public long Ranking { get; set; } + public long Score { get; set; } + public double ScoreDetail { get; set; } + } + + + public class RaidSeasonHistoryDB + { + public long SeasonServerId { get; set; } + public DateTime ReceiveDateTime { get; set; } + public long SeasonRewardGauage { get; set; } + } + + + public class RaidSeasonManageDB + { + public long SeasonId { get; set; } + public DateTime SeasonStartDate { get; set; } + public DateTime SeasonEndDate { get; set; } + public DateTime SeasonSettlementEndDate { get; set; } + public DateTime UpdateDate { get; set; } + } + + + public class RaidSeasonPointRewardHistoryDB + { + public ContentType ContentType { get; set; } + public long AccountId { get; set; } + public long SeasonId { get; set; } + public long LastReceivedSeasonRewardId { get; set; } + public DateTime SeasonRewardReceiveDate { get; set; } + } + + + public class RaidSeasonRankingHistoryDB + { + public ContentType ContentType { get; set; } + public long AccountId { get; set; } + public long SeasonId { get; set; } + public long Ranking { get; set; } + public long BestRankingPoint { get; set; } + public int Tier { get; set; } + public DateTime ReceivedDate { get; set; } + } + + + public class RaidTeamSettingDB + { + public long AccountId { get; set; } + public long TryNumber { get; set; } + public EchelonType EchelonType { get; set; } + public EchelonExtensionType EchelonExtensionType { get; set; } + public IList MainCharacterDBs { get; set; } + public IList SupportCharacterDBs { get; set; } + public IList SkillCardMulliganCharacterIds { get; set; } + public long TSSInteractionUniqueId { get; set; } + public long LeaderCharacterUniqueId { get; set; } + } + + + public class RaidUserDB + { + public long AccountId { get; set; } + public long RepresentCharacterUniqueId { get; set; } + public long RepresentCharacterCostumeId { get; set; } + public long Level { get; set; } + public string Nickname { get; set; } + public int Tier { get; set; } + public long Rank { get; set; } + public long BestRankingPoint { get; set; } + public double BestRankingPointDetail { get; set; } + public AccountAttachmentDB AccountAttachmentDB { get; set; } + } + + + public class ResetableContentId + { + public ResetContentType Type { get; set; } + public long Mapped { get; set; } + } + + + public class ResetableContentValueDB + { + public ResetableContentId ResetableContentId { get; set; } + public long ContentValue { get; set; } + public DateTime LastUpdateTime { get; set; } + } + + + public class ScenarioGroupHistoryDB + { + public long AccountServerId { get; set; } + public long ScenarioGroupUqniueId { get; set; } + public long ScenarioType { get; set; } + public long? EventContentId { get; set; } + public DateTime ClearDateTime { get; set; } + public bool IsReturn { get; set; } + public bool IsPermanent { get; set; } + } + + + public class ScenarioHistoryDB + { + public long AccountServerId { get; set; } + public long ScenarioUniqueId { get; set; } + public DateTime ClearDateTime { get; set; } + } + + + public class SchoolDungeonStageHistoryDB + { + public long AccountServerId { get; set; } + public long StageUniqueId { get; set; } + public long BestStarRecord { get; set; } + public bool Star1Flag { get; set; } + public bool Star2Flag { get; set; } + public bool Star3Flag { get; set; } + public bool IsClearedEver { get; set; } public bool[] StarFlags { get; set; } } - public class SchoolDungeonStageSaveDB { - public ContentType ContentType { get; set; } - } + public class SchoolDungeonStageSaveDB + { + public ContentType ContentType { get; set; } + } - public class SelectGachaSnapshotDB { - public long ShopUniqueId { get; set; } - public long LastIndex { get; set; } - public List LastResults { get; set; } - public long? SavedIndex { get; set; } - public List SavedResults { get; set; } - public long? PickedIndex { get; set; } - } + public class SelectGachaSnapshotDB + { + public long ShopUniqueId { get; set; } + public long LastIndex { get; set; } + public List LastResults { get; set; } + public long? SavedIndex { get; set; } + public List SavedResults { get; set; } + public long? PickedIndex { get; set; } + } - public class SelectTicketReplaceInfo { - public ParcelType MaterialType { get; set; } - public long MaterialId { get; set; } - public long TicketItemId { get; set; } - public int Amount { get; set; } - } + public class SelectTicketReplaceInfo + { + public ParcelType MaterialType { get; set; } + public long MaterialId { get; set; } + public long TicketItemId { get; set; } + public int Amount { get; set; } + } - public class SessionDB { - public SessionKey SessionKey { get; set; } - public DateTime LastConnect { get; set; } - public int ConnectionTime { get; set; } - } + public class SessionDB + { + public SessionKey SessionKey { get; set; } + public DateTime LastConnect { get; set; } + public int ConnectionTime { get; set; } + } - public class SessionKey { - public long AccountServerId { get; set; } - public string MxToken { get; set; } - } + //public class SessionKey { + // public long AccountServerId { get; set; } + // public string MxToken { get; set; } + //} - public class ShiftingCraftInfoDB { - public long SlotSequence { get; set; } - public long CraftRecipeId { get; set; } - public long CraftAmount { get; set; } - public DateTime StartTime { get; set; } - public DateTime EndTime { get; set; } - } + public class ShiftingCraftInfoDB + { + public long SlotSequence { get; set; } + public long CraftRecipeId { get; set; } + public long CraftAmount { get; set; } + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } + } - public class ShopEligmaHistoryDB { - public long CharacterUniqueId { get; set; } - public long PurchaseCount { get; set; } - } + public class ShopEligmaHistoryDB + { + public long CharacterUniqueId { get; set; } + public long PurchaseCount { get; set; } + } - public class ShopFreeRecruitHistoryDB { - public long UniqueId { get; set; } - public int RecruitCount { get; set; } - public DateTime LastUpdateDate { get; set; } - } + public class ShopFreeRecruitHistoryDB + { + public long UniqueId { get; set; } + public int RecruitCount { get; set; } + public DateTime LastUpdateDate { get; set; } + } - public class ShopInfoDB { - public long EventContentId { get; set; } - //public ShopCategoryType Category { get; set; } - public long? ManualRefreshCount { get; set; } - public bool IsRefresh { get; set; } - public DateTime? NextAutoRefreshDate { get; set; } - public DateTime? LastAutoRefreshDate { get; set; } - public List ShopProductList { get; set; } - } + public class ShopInfoDB + { + public long EventContentId { get; set; } + //public ShopCategoryType Category { get; set; } + public long? ManualRefreshCount { get; set; } + public bool IsRefresh { get; set; } + public DateTime? NextAutoRefreshDate { get; set; } + public DateTime? LastAutoRefreshDate { get; set; } + public List ShopProductList { get; set; } + } - public class ShopProductDB { - public long EventContentId { get; set; } - public long ShopExcelId { get; set; } - //public ShopCategoryType Category { get; set; } - public long DisplayOrder { get; set; } - public long PurchaseCount { get; set; } - public bool SoldOut { get; set; } - public long PurchaseCountLimit { get; set; } - public long Price { get; set; } - //public ShopProductType ProductType { get; set; } - } + public class ShopProductDB + { + public long EventContentId { get; set; } + public long ShopExcelId { get; set; } + //public ShopCategoryType Category { get; set; } + public long DisplayOrder { get; set; } + public long PurchaseCount { get; set; } + public bool SoldOut { get; set; } + public long PurchaseCountLimit { get; set; } + public long Price { get; set; } + //public ShopProductType ProductType { get; set; } + } - public class ShopRecruitDB { - public long Id { get; set; } - public DateTime SalesStartDate { get; set; } - public DateTime SalesEndDate { get; set; } - public DateTime UpdateDate { get; set; } - } + public class ShopRecruitDB + { + public long Id { get; set; } + public DateTime SalesStartDate { get; set; } + public DateTime SalesEndDate { get; set; } + public DateTime UpdateDate { get; set; } + } - public class SingleRaidUserDB { - public RaidTeamSettingDB RaidTeamSettingDB { get; set; } - } + public class SingleRaidUserDB + { + public RaidTeamSettingDB RaidTeamSettingDB { get; set; } + } - public class SkillLevelBatchGrowthRequestDB { - //public SkillSlot SkillSlot { get; set; } - public int Level { get; set; } - public List ReplaceInfos { get; set; } - } + public class SkillLevelBatchGrowthRequestDB + { + //public SkillSlot SkillSlot { get; set; } + public int Level { get; set; } + public List ReplaceInfos { get; set; } + } - public class SkipHistoryDB { - public long AccountServerId { get; set; } - public int Prologue { get; set; } - public Dictionary Tutorial { get; set; } - } + public class SkipHistoryDB + { + public long AccountServerId { get; set; } + public int Prologue { get; set; } + public Dictionary Tutorial { get; set; } + } - public class StickerBookDB { - public long AccountId { get; set; } - public IEnumerable UnusedStickerDBs { get; set; } - public IEnumerable UsedStickerDBs { get; set; } - } + public class StickerBookDB + { + public long AccountId { get; set; } + public IEnumerable UnusedStickerDBs { get; set; } + public IEnumerable UsedStickerDBs { get; set; } + } - public class StickerDB { - public ParcelType Type { get; set; } - public long StickerUniqueId { get; set; } - public IEnumerable ParcelInfos { get; set; } - } + public class StickerDB : ParcelBase, IEquatable + { + public ParcelType Type { get; set; } + public long StickerUniqueId { get; set; } + public IEnumerable ParcelInfos { get; set; } + + public bool Equals(StickerDB? other) + { + return this.StickerUniqueId == other.StickerUniqueId; + } + } - public class StoryStrategyStageSaveDB { - public ContentType ContentType { get; set; } - } + public class StoryStrategyStageSaveDB + { + public ContentType ContentType { get; set; } + } - public class StrategyObjectHistoryDB { - public long AccountId { get; set; } - public long StrategyObjectId { get; set; } - } + public class StrategyObjectHistoryDB + { + public long AccountId { get; set; } + public long StrategyObjectId { get; set; } + } - public class TimeAttackDungeonBattleHistoryDB { - //public TimeAttackDungeonType DungeonType { get; set; } - public long GeasId { get; set; } - public long DefaultPoint { get; set; } - public long ClearTimePoint { get; set; } - public long EndFrame { get; set; } - public long TotalPoint { get; set; } - public List MainCharacterDBs { get; set; } - public List SupportCharacterDBs { get; set; } - } + public class TimeAttackDungeonBattleHistoryDB + { + public TimeAttackDungeonType DungeonType { get; set; } + public long GeasId { get; set; } + public long DefaultPoint { get; set; } + public long ClearTimePoint { get; set; } + public long EndFrame { get; set; } + public long TotalPoint { get; set; } + public List MainCharacterDBs { get; set; } + public List SupportCharacterDBs { get; set; } + } - public class TimeAttackDungeonCharacterDB { - public long ServerId { get; set; } - public long UniqueId { get; set; } - public long CostumeId { get; set; } - public int StarGrade { get; set; } - public int Level { get; set; } - public bool HasWeapon { get; set; } - public WeaponDB WeaponDB { get; set; } - public bool IsAssist { get; set; } - } + public class TimeAttackDungeonCharacterDB + { + public long ServerId { get; set; } + public long UniqueId { get; set; } + public long CostumeId { get; set; } + public int StarGrade { get; set; } + public int Level { get; set; } + public bool HasWeapon { get; set; } + public WeaponDB WeaponDB { get; set; } + public bool IsAssist { get; set; } + } - public class TimeAttackDungeonRewardHistoryDB { - public DateTime Date { get; set; } - public TimeAttackDungeonRoomDB RoomDB { get; set; } - public bool IsSweep { get; set; } - } + public class TimeAttackDungeonRewardHistoryDB + { + public DateTime Date { get; set; } + public TimeAttackDungeonRoomDB RoomDB { get; set; } + public bool IsSweep { get; set; } + } - public class TimeAttackDungeonRoomDB { - public long AccountId { get; set; } - public long SeasonId { get; set; } - public long RoomId { get; set; } - public DateTime CreateDate { get; set; } - public DateTime RewardDate { get; set; } - public bool IsPractice { get; set; } - public List SweepHistoryDates { get; set; } - public List BattleHistoryDBs { get; set; } - public int PlayCount { get; set; } - public long TotalPointSum { get; set; } - public bool IsRewardReceived { get; set; } - public bool IsOpened { get; set; } - public bool CanUseAssist { get; set; } - public bool IsPlayCountOver { get; set; } - } + public class TimeAttackDungeonRoomDB + { + public long AccountId { get; set; } + public long SeasonId { get; set; } + public long RoomId { get; set; } + public DateTime CreateDate { get; set; } + public DateTime RewardDate { get; set; } + public bool IsPractice { get; set; } + public List SweepHistoryDates { get; set; } + public List BattleHistoryDBs { get; set; } + public int PlayCount { get; set; } + public long TotalPointSum { get; set; } + public bool IsRewardReceived { get; set; } + public bool IsOpened { get; set; } + public bool CanUseAssist { get; set; } + public bool IsPlayCountOver { get; set; } + } - public class ToastDB { - public long UniqueId { get; set; } - public string Text { get; set; } - public string ToastId { get; set; } - public DateTime BeginDate { get; set; } - public DateTime EndDate { get; set; } - public int LifeTime { get; set; } - public int Delay { get; set; } - } + public class ToastDB + { + public long UniqueId { get; set; } + public string Text { get; set; } + public string ToastId { get; set; } + public DateTime BeginDate { get; set; } + public DateTime EndDate { get; set; } + public int LifeTime { get; set; } + public int Delay { get; set; } + } - public class VisitingCharacterDB { - public long UniqueId { get; set; } - public long ServerId { get; set; } - } + public class VisitingCharacterDB + { + public long UniqueId { get; set; } + public long ServerId { get; set; } + } - public class WeaponDB { - public ParcelType Type { get; set; } - public IEnumerable ParcelInfos { get; set; } - public long UniqueId { get; set; } - public int Level { get; set; } - public long Exp { get; set; } - public int StarGrade { get; set; } - public long BoundCharacterServerId { get; set; } - public bool IsLocked { get; set; } - } + public class WeaponDB : ParcelBase + { + public ParcelType Type { get; set; } + public IEnumerable ParcelInfos { get; set; } + public long UniqueId { get; set; } + public int Level { get; set; } + public long Exp { get; set; } + public int StarGrade { get; set; } + public long BoundCharacterServerId { get; set; } + public bool IsLocked { get; set; } + } - public class WeekDungeonSaveDB { - public ContentType ContentType { get; set; } - //public WeekDungeonType WeekDungeonType { get; set; } - public int Seed { get; set; } - public int Sequence { get; set; } - } + public class WeekDungeonSaveDB + { + public ContentType ContentType { get; set; } + //public WeekDungeonType WeekDungeonType { get; set; } + public int Seed { get; set; } + public int Sequence { get; set; } + } - public class WeekDungeonStageHistoryDB { - public long AccountServerId { get; set; } - public long StageUniqueId { get; set; } - //public Dictionary StarGoalRecord { get; set; } - public bool IsCleardEver { get; set; } - } + public class WeekDungeonStageHistoryDB + { + public long AccountServerId { get; set; } + public long StageUniqueId { get; set; } + //public Dictionary StarGoalRecord { get; set; } + public bool IsCleardEver { get; set; } + } - public class WorldRaidBossDamageRatio { - //public ContentsChangeType ContentsChangeType { get; set; } - //public BasisPoint DamageRatio { get; set; } - } + public class WorldRaidBossDamageRatio + { + //public ContentsChangeType ContentsChangeType { get; set; } + //public BasisPoint DamageRatio { get; set; } + } - public class WorldRaidBossGroup { - //public ContentsChangeType ContentsChangeType { get; set; } - public long GroupId { get; set; } - public DateTime BossSpawnTime { get; set; } - public DateTime EliminateTime { get; set; } - } + public class WorldRaidBossGroup + { + //public ContentsChangeType ContentsChangeType { get; set; } + public long GroupId { get; set; } + public DateTime BossSpawnTime { get; set; } + public DateTime EliminateTime { get; set; } + } - public class WorldRaidBossListInfoDB { - public long GroupId { get; set; } - public WorldRaidWorldBossDB WorldBossDB { get; set; } - public List LocalBossDBs { get; set; } - } + public class WorldRaidBossListInfoDB + { + public long GroupId { get; set; } + public WorldRaidWorldBossDB WorldBossDB { get; set; } + public List LocalBossDBs { get; set; } + } - public class WorldRaidClearHistoryDB { - public long SeasonId { get; set; } - public long GroupId { get; set; } - public DateTime RewardReceiveDate { get; set; } - } + public class WorldRaidClearHistoryDB + { + public long SeasonId { get; set; } + public long GroupId { get; set; } + public DateTime RewardReceiveDate { get; set; } + } } \ No newline at end of file diff --git a/SCHALE.Common/NetworkProtocol/protos.cs b/SCHALE.Common/NetworkProtocol/protos.cs index 8602732..4411e01 100644 --- a/SCHALE.Common/NetworkProtocol/protos.cs +++ b/SCHALE.Common/NetworkProtocol/protos.cs @@ -1,6 +1,9 @@ using SCHALE.Common.Database; using System.Text.Json.Serialization; using SCHALE.Common.Parcel; +using SCHALE.Common.FlatData; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; namespace SCHALE.Common.NetworkProtocol { @@ -137,16 +140,16 @@ namespace SCHALE.Common.NetworkProtocol } - //public class AccountAuth2Request : AccountAuthRequest - //{ - // public override Protocol Protocol - // { - // get - // { - // return NetworkProtocol.Protocol.Account_Auth2; - // } - // } - //} + public class AccountAuth2Request : AccountAuthRequest + { + public override Protocol Protocol + { + get + { + return NetworkProtocol.Protocol.Account_Auth2; + } + } + } public class AccountAuth2Response : AccountAuthResponse @@ -6578,8 +6581,8 @@ namespace SCHALE.Common.NetworkProtocol public long RepresentCharacterCostumeId { get; set; } public long CharacterCount { get; set; } public long? LastNormalCampaignClearStageId { get; set; } - public long? LastHardCampaignClearStageId { get; set; } - public long? ArenaRanking{ get; set; } + public long? LastHardCampaignClearStageId { get; set; } + public long? ArenaRanking { get; set; } public long? RaidRanking { get; set; } public int? RaidTier { get; set; } public DetailedAccountInfoDB DetailedAccountInfoDB { get; set; } @@ -7980,8 +7983,8 @@ namespace SCHALE.Common.NetworkProtocol return NetworkProtocol.Protocol.ProofToken_RequestQuestion; } } - public long Hint; - public string Question; + public long Hint { get; set; } + public string Question { get; set; } } @@ -8855,7 +8858,80 @@ namespace SCHALE.Common.NetworkProtocol public long StageUniqueId { get; set; } } + public interface IMissionConstraint + { + bool CanComplete(DateTime serverTime); + bool CanReceiveReward(DateTime serverTime); + } + + public class MissionInfo : IMissionConstraint + { + public long Id { get; set; } + + public MissionCategory Category { get; set; } + + public MissionResetType ResetType { get; set; } + + public MissionToastDisplayConditionType ToastDisplayType { get; set; } + + public string Description { get; set; } + + public bool IsVisible { get; set; } + + public bool IsLimited { get; set; } + + public DateTime StartDate { get; set; } + + public DateTime StartableEndDate { get; set; } + + public DateTime EndDate { get; set; } + + public long EndDday { get; set; } + + public AccountState AccountState { get; set; } + + public long AccountLevel { get; set; } + + public List PreMissionIds { get; set; } + + public long NextMissionId { get; set; } + + public SuddenMissionContentType[] SuddenMissionContentTypes { get; set; } + + public MissionCompleteConditionType CompleteConditionType { get; set; } + + public long CompleteConditionCount { get; set; } + + public List CompleteConditionParameters { get; set; } + + public string RewardIcon { get; set; } + + public List Rewards { get; set; } + + public ContentType DateAutoRefer { get; set; } + + public string ToastImagePath { get; set; } + + public long DisplayOrder { get; set; } + + public bool HasFollowingMission { get; set; } + + public string[] Shortcuts { get; set; } + + public long ChallengeStageId { get; set; } + + public virtual bool CanComplete(DateTime serverTime) + { + return true; + } + + public virtual bool CanReceiveReward(DateTime serverTime) + { + return false; + } + + } public class MissionListResponse : ResponsePacket { public override Protocol Protocol @@ -8867,7 +8943,7 @@ namespace SCHALE.Common.NetworkProtocol } public List MissionHistoryUniqueIds { get; set; } public List ProgressDBs { get; set; } - //public MissionInfo DailySuddenMissionInfo { get; set; } + public MissionInfo DailySuddenMissionInfo { get; set; } public List ClearedOrignalMissionIds { get; set; } } @@ -10319,7 +10395,7 @@ namespace SCHALE.Common.NetworkProtocol } } [JsonIgnore] - public AccountCurrencyDB AccountCurrencyDB{ get; set; } + public AccountCurrencyDB AccountCurrencyDB { get; set; } public ConsumeResultDB ConsumeResultDB { get; set; } public ParcelResultDB ParcelResultDB { get; set; } } diff --git a/SCHALE.Common/Parcel/parcel.cs b/SCHALE.Common/Parcel/parcel.cs index 7e2bb13..a66f0e5 100644 --- a/SCHALE.Common/Parcel/parcel.cs +++ b/SCHALE.Common/Parcel/parcel.cs @@ -1,5 +1,6 @@  using SCHALE.Common.Database; +using SCHALE.Common.FlatData; namespace SCHALE.Common.Parcel { @@ -96,17 +97,54 @@ namespace SCHALE.Common.Parcel public ParcelChangeType ParcelChangeType { get; set; } } - - public class ParcelInfo + public struct BasisPoint : IEquatable, IComparable { - public ParcelKeyPair Key { get; set; } - public long Amount { get; set; } - //public BasisPoint Multiplier { get; set; } - public long MultipliedAmount { get; set; } - //public BasisPoint Probability { get; set; } + public long RawValue { get; set; } + + public static readonly double DoubleEpsilon; + + public static readonly BasisPoint Epsilon; + + private static readonly long Multiplier; + + public static readonly BasisPoint One; + + private static readonly double OneOver10_4; + + private long rawValue; + + public static readonly BasisPoint Zero; + + public bool Equals(BasisPoint other) + { + throw new NotImplementedException(); + } + + public int CompareTo(BasisPoint other) + { + throw new NotImplementedException(); + } } + public class ParcelInfo : IEquatable + { + public ParcelKeyPair Key { get; set; } + + public long Amount { get; set; } + + public BasisPoint Multiplier { get; set; } + + public long MultipliedAmount { get; set; } + + public BasisPoint Probability { get; set; } + + public bool Equals(ParcelInfo? other) + { + return this.Key.Id.Equals(other.Key.Id); + } + } + public class ParcelKeyPair { public ParcelType Type { get; set; } diff --git a/SCHALE.GameServer/Controllers/Api/GatewayController.cs b/SCHALE.GameServer/Controllers/Api/GatewayController.cs index e9ee76a..ba2f1ba 100644 --- a/SCHALE.GameServer/Controllers/Api/GatewayController.cs +++ b/SCHALE.GameServer/Controllers/Api/GatewayController.cs @@ -44,6 +44,7 @@ namespace SCHALE.GameServer.Controllers.Api var payloadStr = Encoding.UTF8.GetString(payloadMs.ToArray()); var jsonNode = JsonSerializer.Deserialize(payloadStr); var protocol = (Protocol?)jsonNode?["Protocol"]?.GetValue() ?? Protocol.None; + if (protocol == Protocol.None) { logger.LogWarning("Failed to read protocol from JsonNode, {Payload:j}", payloadStr); @@ -60,6 +61,8 @@ namespace SCHALE.GameServer.Controllers.Api var payload = (JsonSerializer.Deserialize(payloadStr, requestType) as RequestPacket)!; var rsp = protocolHandlerFactory.Invoke(protocol, payload); + + if (rsp is null) { logger.LogDebug("{Protocol} {Payload:j}", payload.Protocol, payloadStr); @@ -67,11 +70,11 @@ namespace SCHALE.GameServer.Controllers.Api goto protocolErrorRet; } - + return Results.Json(new { packet = JsonSerializer.Serialize(rsp), - protocol = payload.Protocol.ToString() + protocol = ((BasePacket)rsp).Protocol.ToString() }); protocolErrorRet: diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Academy.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Academy.cs new file mode 100644 index 0000000..5170cce --- /dev/null +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Academy.cs @@ -0,0 +1,22 @@ +using SCHALE.Common.NetworkProtocol; + +namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers +{ + public class Academy : ProtocolHandlerBase + { + public Academy(IServiceScopeFactory scopeFactory, IProtocolHandlerFactory protocolHandlerFactory) : base(scopeFactory, protocolHandlerFactory) { } + + [ProtocolHandler(Protocol.Academy_GetInfo)] + public ResponsePacket GetInfoHandler(AcademyGetInfoRequest req) + { + return new AcademyGetInfoResponse() + { + AcademyDB = new() + { + AccountId = 1 + }, + AcademyLocationDBs = [], + }; + } + } +} diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Account.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Account.cs index 2c38ad0..47a69e1 100644 --- a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Account.cs +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Account.cs @@ -1,15 +1,23 @@ -using SCHALE.Common.NetworkProtocol; +using SCHALE.Common.Database; +using SCHALE.Common.FlatData; +using SCHALE.Common.NetworkProtocol; +using SCHALE.Common.Parcel; +using Serilog; namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers -{ +{ public class Account : ProtocolHandlerBase { public Account(IServiceScopeFactory scopeFactory, IProtocolHandlerFactory protocolHandlerFactory) : base(scopeFactory, protocolHandlerFactory) { } + // most handlers empty [ProtocolHandler(Protocol.Account_CheckYostar)] public ResponsePacket CheckYostarHandler(AccountCheckYostarRequest req) { - var account = Context.GuestAccounts.SingleOrDefault(x => x.Uid == uint.Parse(req.EnterTicket.Split(":", StringSplitOptions.None).First()) && x.Token == req.EnterTicket.Split(":", StringSplitOptions.None).Last()); + string[] uid_token = req.EnterTicket.Split(':'); + + var account = Context.GuestAccounts.SingleOrDefault(x => x.Uid == uint.Parse(uid_token[0]) && x.Token == uid_token[1]); + if (account is null) { return new AccountCheckYostarResponse() @@ -24,8 +32,8 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers ResultState = 1, SessionKey = new() { + AccountServerId = account.Uid, MxToken = req.EnterTicket, - AccountServerId = account.Uid } }; } @@ -33,10 +41,151 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers [ProtocolHandler(Protocol.Account_Auth)] public ResponsePacket AuthHandler(AccountAuthRequest req) { - return new ErrorPacket() + var account = Context.Accounts.SingleOrDefault(x => x.ServerId == req.AccountId); + + if (account == null) { - ErrorCode = WebAPIErrorCode.AccountAuthNotCreated + return new ErrorPacket() + { + ErrorCode = WebAPIErrorCode.AccountAuthNotCreated + }; + } + else + { + return new AccountAuthResponse() + { + CurrentVersion = req.Version, + AccountDB = account.AccountDB, + + SessionKey = new() + { + AccountServerId = account.ServerId, + MxToken = req.SessionKey.MxToken, + } + }; + } + } + + [ProtocolHandler(Protocol.Account_Create)] + public ResponsePacket CreateHandler(AccountCreateRequest req) + { + var account = Common.Database.Models.Game.Account.Create((uint)req.AccountId); + + Context.Accounts.Add(account); + Context.SaveChanges(); + + Log.Information("Account Created " + Context.Accounts.Count()); + + return new AccountCreateResponse() + { + SessionKey = new() + { + AccountServerId = account.ServerId, + MxToken = req.SessionKey.MxToken, + }, + }; + } + + [ProtocolHandler(Protocol.Account_Nickname)] + public ResponsePacket NicknameHandler(AccountNicknameRequest req) + { + var account = Context.Accounts.SingleOrDefault(x => x.ServerId == req.AccountId); + + account.AccountDB.Nickname = req.Nickname; + Context.SaveChanges(); + + return new AccountNicknameResponse() + { + AccountDB = account.AccountDB + }; + + } + + [ProtocolHandler(Protocol.Account_LoginSync)] + public ResponsePacket LoginSyncHandler(AccountLoginSyncRequest req) + { + return new AccountLoginSyncResponse() + { + + }; + } + + [ProtocolHandler(Protocol.Account_GetTutorial)] + public ResponsePacket GetTutorialHandler(AccountGetTutorialRequest req) + { + + return new AccountGetTutorialResponse() + { + + }; + } + + [ProtocolHandler(Protocol.Account_SetTutorial)] + public ResponsePacket SetTutorialHandler(AccountSetTutorialRequest req) + { + + return new AccountSetTutorialResponse() + { + + }; + } + + // others handlers, move to different handler group later + [ProtocolHandler(Protocol.Item_List)] + public ResponsePacket Item_ListRequestHandler(ItemListRequest req) + { + return new ItemListResponse() + { + ItemDBs = [], + ExpiryItemDBs = [], + ServerNotification = ServerNotificationFlag.HasUnreadMail, + }; + } + + [ProtocolHandler(Protocol.NetworkTime_Sync)] + public ResponsePacket NetworkTime_Sync(NetworkTimeSyncRequest req) + { + long received_tick = DateTimeOffset.Now.Ticks; + + return new NetworkTimeSyncResponse() + { + ReceiveTick = received_tick, + EchoSendTick = DateTimeOffset.Now.Ticks, + ServerTimeTicks = received_tick, + }; + } + + [ProtocolHandler(Protocol.ContentSave_Get)] + public ResponsePacket ContentSave_Get(ContentSaveGetRequest req) + { + return new ContentSaveGetResponse() + { + ServerNotification = ServerNotificationFlag.HasUnreadMail, + }; + } + + [ProtocolHandler(Protocol.Shop_BeforehandGachaGet)] + public ResponsePacket Shop_BeforehandGachaGet(ShopBeforehandGachaGetRequest req) + { + return new ShopBeforehandGachaGetResponse() + { + SessionKey = new () + { + MxToken = req.SessionKey.MxToken, + AccountServerId = req.SessionKey.AccountServerId, + }, + }; + } + + [ProtocolHandler(Protocol.Toast_List)] + public ResponsePacket ToastListHandler(ToastListRequest req) + { + + return new ToastListResponse() + { + }; } } + } diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Mission.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Mission.cs new file mode 100644 index 0000000..b748079 --- /dev/null +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Mission.cs @@ -0,0 +1,27 @@ +using SCHALE.Common.NetworkProtocol; + +namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers +{ + public class Mission : ProtocolHandlerBase + { + public Mission(IServiceScopeFactory scopeFactory, IProtocolHandlerFactory protocolHandlerFactory) : base(scopeFactory, protocolHandlerFactory) { } + + [ProtocolHandler(Protocol.Mission_List)] + public ResponsePacket ListHandler(MissionListRequest req) + { + return new MissionListResponse() + { + + }; + } + + [ProtocolHandler(Protocol.Mission_GuideMissionSeasonList)] + public ResponsePacket GuideMissionSeasonListHandler(GuideMissionSeasonListRequest req) + { + return new GuideMissionSeasonListResponse() + { + + }; + } + } +} diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/ProofToken.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/ProofToken.cs new file mode 100644 index 0000000..3e12b06 --- /dev/null +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/ProofToken.cs @@ -0,0 +1,37 @@ +using SCHALE.Common.NetworkProtocol; + +namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers +{ + public class ProofToken : ProtocolHandlerBase + { + public ProofToken(IServiceScopeFactory scopeFactory, IProtocolHandlerFactory protocolHandlerFactory) : base(scopeFactory, protocolHandlerFactory) { } + + [ProtocolHandler(Protocol.ProofToken_RequestQuestion)] + public ResponsePacket RequestQuestionHandler(ProofTokenRequestQuestionRequest req) + { + return new ProofTokenRequestQuestionResponse() + { + Hint = 69, + Question = "seggs", + SessionKey = new() + { + MxToken = req.SessionKey.MxToken, + AccountServerId = req.SessionKey.AccountServerId, + }, + }; + } + + [ProtocolHandler(Protocol.ProofToken_Submit)] + public ResponsePacket SubmitHandler(ProofTokenSubmitRequest req) + { + return new ProofTokenSubmitResponse() + { + SessionKey = new() + { + MxToken = req.SessionKey.MxToken, + AccountServerId = req.SessionKey.AccountServerId, + }, + }; + } + } +} diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/ProtocolHandlerFactory.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/ProtocolHandlerFactory.cs index 073c58c..d9a179e 100644 --- a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/ProtocolHandlerFactory.cs +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/ProtocolHandlerFactory.cs @@ -18,7 +18,7 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers public interface IProtocolHandlerFactory { - public ResponsePacket? Invoke(Protocol protocol, RequestPacket? req); + public object? Invoke(Protocol protocol, RequestPacket? req); public MethodInfo? GetProtocolHandler(Protocol protocol); public Type? GetRequestPacketTypeByProtocol(Protocol protocol); public void RegisterInstance(Type t, object? inst); @@ -62,7 +62,7 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers } } - public ResponsePacket? Invoke(Protocol protocol, RequestPacket? req) + public object? Invoke(Protocol protocol, RequestPacket? req) { var handler = GetProtocolHandler(protocol); if (handler is null) @@ -90,6 +90,8 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers public abstract class ProtocolHandlerBase : IHostedService { private readonly IServiceScopeFactory scopeFactory; + + private IServiceScope scope; public ProtocolHandlerBase(IServiceScopeFactory _scopeFactory, IProtocolHandlerFactory protocolHandlerFactory) { @@ -101,22 +103,22 @@ namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers { get { - using (var scope = scopeFactory.CreateScope()) - { - var db = scope.ServiceProvider.GetRequiredService(); + var db = scope.ServiceProvider.GetRequiredService(); - return db; - } + return db; } } public Task StartAsync(CancellationToken cancellationToken) { + scope = scopeFactory.CreateScope(); return Task.CompletedTask; } public Task StopAsync(CancellationToken cancellationToken) { + scope.Dispose(); + Context.Dispose(); return Task.CompletedTask; } } diff --git a/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Scenario.cs b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Scenario.cs new file mode 100644 index 0000000..2fc7921 --- /dev/null +++ b/SCHALE.GameServer/Controllers/Api/ProtocolHandlers/Scenario.cs @@ -0,0 +1,31 @@ +using SCHALE.Common.NetworkProtocol; + +namespace SCHALE.GameServer.Controllers.Api.ProtocolHandlers +{ + public class Scenario : ProtocolHandlerBase + { + public Scenario(IServiceScopeFactory scopeFactory, IProtocolHandlerFactory protocolHandlerFactory) : base(scopeFactory, protocolHandlerFactory) { } + + [ProtocolHandler(Protocol.Scenario_Skip)] + public ResponsePacket SkipHandler(ScenarioSkipRequest req) + { + // skip story doesn't work yet, probably need to implement missiondb + return new ScenarioSkipResponse() + { + + }; + } + + [ProtocolHandler(Protocol.Scenario_Select)] + public ResponsePacket SelectHandler(ScenarioSelectRequest req) + { + + return new ScenarioSelectResponse() + { + + }; + } + + + } +} diff --git a/SCHALE.GameServer/GameServer.cs b/SCHALE.GameServer/GameServer.cs index 3a874c9..de6a09f 100644 --- a/SCHALE.GameServer/GameServer.cs +++ b/SCHALE.GameServer/GameServer.cs @@ -48,6 +48,10 @@ namespace SCHALE.GameServer builder.Services.AddProtocolHandlerFactory(); builder.Services.AddProtocolHandlerGroup(); builder.Services.AddProtocolHandlerGroup(); + builder.Services.AddProtocolHandlerGroup(); + builder.Services.AddProtocolHandlerGroup(); + builder.Services.AddProtocolHandlerGroup(); + builder.Services.AddProtocolHandlerGroup(); var app = builder.Build(); diff --git a/SCHALE.GameServer/SCHALE.GameServer.sln b/SCHALE.GameServer/SCHALE.GameServer.sln new file mode 100644 index 0000000..eaea970 --- /dev/null +++ b/SCHALE.GameServer/SCHALE.GameServer.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCHALE.GameServer", "SCHALE.GameServer.csproj", "{73DF585D-E422-4642-8026-C55F031B3D07}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {73DF585D-E422-4642-8026-C55F031B3D07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73DF585D-E422-4642-8026-C55F031B3D07}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73DF585D-E422-4642-8026-C55F031B3D07}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73DF585D-E422-4642-8026-C55F031B3D07}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CC05112F-B591-4DB5-8D12-F56FBF1FA838} + EndGlobalSection +EndGlobal