From a276b7317f0bcbfa206ba975b9345c83928c7cfe Mon Sep 17 00:00:00 2001 From: area363 Date: Tue, 17 Oct 2023 15:43:29 +0900 Subject: [PATCH 01/20] add user data migration command --- .../Commands/UserDataMigration.cs | 1438 +++++++++++++++++ .../Program.cs | 1 + 2 files changed, 1439 insertions(+) create mode 100644 NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs diff --git a/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs b/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs new file mode 100644 index 00000000..7a437e33 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs @@ -0,0 +1,1438 @@ +namespace NineChronicles.DataProvider.Executable.Commands +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using Bencodex.Types; + using Cocona; + using Lib9c.Model.Order; + using Libplanet.Action; + using Libplanet.Blockchain; + using Libplanet.Blockchain.Policies; + using Libplanet.Crypto; + using Libplanet.RocksDBStore; + using Libplanet.Store; + using Libplanet.Types.Assets; + using Libplanet.Types.Blocks; + using MySqlConnector; + using Nekoyume; + using Nekoyume.Action; + using Nekoyume.Action.Loader; + using Nekoyume.Battle; + using Nekoyume.Blockchain.Policy; + using Nekoyume.Extensions; + using Nekoyume.Helper; + using Nekoyume.Model.Arena; + using Nekoyume.Model.Item; + using Nekoyume.Model.Stake; + using Nekoyume.Model.State; + using Nekoyume.TableData; + + public class UserDataMigration + { + private const string UeDbName = "UserEquipments"; + private const string UctDbName = "UserCostumes"; + private const string UmDbName = "UserMaterials"; + private const string UcDbName = "UserConsumables"; + private const string UsDbName = "UserStakings"; + private const string UmcDbName = "UserMonsterCollections"; + private const string UncgDbName = "UserNCGs"; + private const string UcyDbName = "UserCrystals"; + private const string EDbName = "Equipments"; + private const string ScDbName = "ShopConsumables"; + private const string SeDbName = "ShopEquipments"; + private const string SctDbName = "ShopCostumes"; + private const string SmDbName = "ShopMaterials"; + private const string UrDbName = "UserRunes"; + private string _barDbName = "BattleArenaRanking"; + private string _fbBarDbName = "BattleArenaRanking"; + private string _fbUsDbName = "UserStakings"; + private string _connectionString; + private IStore _baseStore; + private BlockChain _baseChain; + private StreamWriter _ueBulkFile; + private StreamWriter _uctBulkFile; + private StreamWriter _umBulkFile; + private StreamWriter _ucBulkFile; + private StreamWriter _usBulkFile; + private StreamWriter _fbUsBulkFile; + private StreamWriter _umcBulkFile; + private StreamWriter _uncgBulkFile; + private StreamWriter _ucyBulkFile; + private StreamWriter _eBulkFile; + private StreamWriter _scBulkFile; + private StreamWriter _seBulkFile; + private StreamWriter _sctBulkFile; + private StreamWriter _smBulkFile; + private StreamWriter _barBulkFile; + private StreamWriter _fbBarBulkFile; + private StreamWriter _urBulkFile; + private List _hourGlassAgentList; + private List _apStoneAgentList; + private List _ueFiles; + private List _uctFiles; + private List _umFiles; + private List _ucFiles; + private List _usFiles; + private List _fbUsFiles; + private List _umcFiles; + private List _uncgFiles; + private List _ucyFiles; + private List _eFiles; + private List _scFiles; + private List _seFiles; + private List _sctFiles; + private List _smFiles; + private List _barFiles; + private List _fbBarFiles; + private List _urFiles; + + [Command(Description = "Migrate action data in rocksdb store to mysql db.")] + public void Migration( + [Option('o', Description = "Rocksdb path to migrate.")] + string storePath, + [Option( + "rocksdb-storetype", + Description = "Store type of RocksDb (new or mono).")] + string rocksdbStoreType, + [Option( + "mysql-server", + Description = "A hostname of MySQL server.")] + string mysqlServer, + [Option( + "mysql-port", + Description = "A port of MySQL server.")] + uint mysqlPort, + [Option( + "mysql-username", + Description = "The name of MySQL user.")] + string mysqlUsername, + [Option( + "mysql-password", + Description = "The password of MySQL user.")] + string mysqlPassword, + [Option( + "mysql-database", + Description = "The name of MySQL database to use.")] + string mysqlDatabase + ) + { + DateTimeOffset start = DateTimeOffset.UtcNow; + var builder = new MySqlConnectionStringBuilder + { + Database = mysqlDatabase, + UserID = mysqlUsername, + Password = mysqlPassword, + Server = mysqlServer, + Port = mysqlPort, + AllowLoadLocalInfile = true, + }; + + _connectionString = builder.ConnectionString; + + Console.WriteLine("Setting up RocksDBStore..."); + if (rocksdbStoreType == "new") + { + _baseStore = new RocksDBStore( + storePath, + dbConnectionCacheSize: 10000); + } + else + { + throw new CommandExitedException("Invalid rocksdb-storetype. Please enter 'new' or 'mono'", -1); + } + + long totalLength = _baseStore.CountBlocks(); + + if (totalLength == 0) + { + throw new CommandExitedException("Invalid rocksdb-store. Please enter a valid store path", -1); + } + + if (!(_baseStore.GetCanonicalChainId() is Guid chainId)) + { + Console.Error.WriteLine("There is no canonical chain: {0}", storePath); + Environment.Exit(1); + return; + } + + if (!(_baseStore.IndexBlockHash(chainId, 0) is { } gHash)) + { + Console.Error.WriteLine("There is no genesis block: {0}", storePath); + Environment.Exit(1); + return; + } + + // Setup base store + RocksDBKeyValueStore baseStateKeyValueStore = new RocksDBKeyValueStore(Path.Combine(storePath, "states")); + TrieStateStore baseStateStore = + new TrieStateStore(baseStateKeyValueStore); + + // Setup block policy + IStagePolicy stagePolicy = new VolatileStagePolicy(); + var blockPolicySource = new BlockPolicySource(); + IBlockPolicy blockPolicy = blockPolicySource.GetPolicy(); + + // Setup base chain & new chain + Block genesis = _baseStore.GetBlock(gHash); + var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); + var actionEvaluator = new ActionEvaluator( + _ => blockPolicy.BlockAction, + blockChainStates, + new NCActionLoader()); + _baseChain = new BlockChain(blockPolicy, stagePolicy, _baseStore, baseStateStore, genesis, blockChainStates, actionEvaluator); + + // Prepare block hashes to append to new chain + Console.WriteLine("Start migration."); + + // files to store bulk file paths (new file created every 10000 blocks for bulk load performance) + _ueFiles = new List(); + _uctFiles = new List(); + _umFiles = new List(); + _ucFiles = new List(); + _usFiles = new List(); + _fbUsFiles = new List(); + _umcFiles = new List(); + _uncgFiles = new List(); + _ucyFiles = new List(); + _eFiles = new List(); + _scFiles = new List(); + _seFiles = new List(); + _sctFiles = new List(); + _smFiles = new List(); + _barFiles = new List(); + _fbBarFiles = new List(); + _urFiles = new List(); + + // lists to keep track of inserted addresses to minimize duplicates + _hourGlassAgentList = new List(); + _apStoneAgentList = new List(); + + CreateBulkFiles(); + + using MySqlConnection connection = new MySqlConnection(_connectionString); + connection.Open(); + + var stm = "SELECT `Address` from Avatars"; + var cmd = new MySqlCommand(stm, connection); + + var rdr = cmd.ExecuteReader(); + List avatars = new List(); + List agents = new List(); + + while (rdr.Read()) + { + Console.WriteLine("{0}", rdr.GetString(0)); + avatars.Add(rdr.GetString(0).Replace("0x", string.Empty)); + } + + connection.Close(); + int shopOrderCount = 0; + bool finalizeBaranking = false; + + try + { + var tipHash = _baseStore.IndexBlockHash(_baseChain.Id, _baseChain.Tip.Index); + var tip = _baseStore.GetBlock((BlockHash)tipHash); + var exec = _baseChain.EvaluateBlock(tip); + var ev = exec.Last(); + var avatarCount = 0; + AvatarState avatarState; + int interval = 10000000; + int intervalCount = 0; + var sheets = ev.OutputState.GetSheets( + sheetTypes: new[] + { + typeof(RuneSheet), + }); + var arenaSheet = ev.OutputState.GetSheet(); + var arenaData = arenaSheet.GetRoundByBlockIndex(tip.Index); + + _barDbName = $"{_barDbName}_{arenaData.ChampionshipId}_{arenaData.Round}"; + Console.WriteLine("1"); + connection.Open(); + var stm33 = + $@"CREATE TABLE IF NOT EXISTS `data_provider`.`{_barDbName}` ( + `BlockIndex` bigint NOT NULL, + `AgentAddress` varchar(100) NOT NULL, + `AvatarAddress` varchar(100) NOT NULL, + `AvatarLevel` int NOT NULL, + `ChampionshipId` int NOT NULL, + `Round` int NOT NULL, + `ArenaType` varchar(100) NOT NULL, + `Score` int NOT NULL, + `WinCount` int NOT NULL, + `MedalCount` int NOT NULL, + `LossCount` int NOT NULL, + `Ticket` int NOT NULL, + `PurchasedTicketCount` int NOT NULL, + `TicketResetCount` int NOT NULL, + `EntranceFee` bigint NOT NULL, + `TicketPrice` bigint NOT NULL, + `AdditionalTicketPrice` bigint NOT NULL, + `RequiredMedalCount` int NOT NULL, + `StartBlockIndex` bigint NOT NULL, + `EndBlockIndex` bigint NOT NULL, + `Ranking` int NOT NULL, + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + KEY `fk_BattleArenaRanking_Agent1_idx` (`AgentAddress`), + KEY `fk_BattleArenaRanking_AvatarAddress1_idx` (`AvatarAddress`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;"; + + var cmd33 = new MySqlCommand(stm33, connection); + cmd33.CommandTimeout = 300; + cmd33.ExecuteScalar(); + connection.Close(); + + Console.WriteLine("2"); + var prevArenaEndIndex = arenaData.StartBlockIndex - 1; + var prevArenaData = arenaSheet.GetRoundByBlockIndex(prevArenaEndIndex); + var finalizeBarankingTip = prevArenaEndIndex; + _fbBarDbName = $"{_fbBarDbName}_{prevArenaData.ChampionshipId}_{prevArenaData.Round}"; + + connection.Open(); + var preBarQuery = $"SELECT `BlockIndex` FROM data_provider.{_fbBarDbName} limit 1"; + var preBarCmd = new MySqlCommand(preBarQuery, connection); + + var dataReader = preBarCmd.ExecuteReader(); + long prevBarDbTip = 0; + Console.WriteLine("3"); + while (dataReader.Read()) + { + Console.WriteLine("{0}", dataReader.GetInt64(0)); + prevBarDbTip = dataReader.GetInt64(0); + } + + connection.Close(); + Console.WriteLine("4"); + if (prevBarDbTip != 0 && prevBarDbTip < finalizeBarankingTip) + { + finalizeBaranking = true; + } + + if (finalizeBaranking) + { + try + { + Console.WriteLine($"Finalize {_fbBarDbName} Table!"); + var fbTipHash = _baseStore.IndexBlockHash(_baseChain.Id, finalizeBarankingTip); + var fbTip = _baseStore.GetBlock((BlockHash)fbTipHash!); + var fbExec = _baseChain.EvaluateBlock(fbTip); + var fbEv = fbExec.Last(); + var fbArenaSheet = fbEv.OutputState.GetSheet(); + var fbArenaData = fbArenaSheet.GetRoundByBlockIndex(fbTip.Index); + List fbAgents = new List(); + var fbavatarCount = 0; + + _fbUsDbName = $"{_fbUsDbName}_{fbTip.Index}"; + Console.WriteLine("5"); + + foreach (var fbAvatar in avatars) + { + try + { + fbavatarCount++; + Console.WriteLine("Migrating {0}/{1}", fbavatarCount, avatars.Count); + AvatarState fbAvatarState; + var fbAvatarAddress = new Address(fbAvatar); + try + { + fbAvatarState = fbEv.OutputState.GetAvatarStateV2(fbAvatarAddress); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + fbAvatarState = fbEv.OutputState.GetAvatarState(fbAvatarAddress); + } + + var fbAvatarLevel = fbAvatarState.level; + + var fbArenaScoreAdr = + ArenaScore.DeriveAddress(fbAvatarAddress, fbArenaData.ChampionshipId, fbArenaData.Round); + var fbArenaInformationAdr = + ArenaInformation.DeriveAddress(fbAvatarAddress, fbArenaData.ChampionshipId, fbArenaData.Round); + fbEv.OutputState.TryGetArenaInformation(fbArenaInformationAdr, out var fbCurrentArenaInformation); + fbEv.OutputState.TryGetArenaScore(fbArenaScoreAdr, out var fbOutputArenaScore); + if (fbCurrentArenaInformation != null && fbOutputArenaScore != null) + { + _fbBarBulkFile.WriteLine( + $"{fbTip.Index};" + + $"{fbAvatarState.agentAddress.ToString()};" + + $"{fbAvatarAddress.ToString()};" + + $"{fbAvatarLevel};" + + $"{fbArenaData.ChampionshipId};" + + $"{fbArenaData.Round};" + + $"{fbArenaData.ArenaType.ToString()};" + + $"{fbOutputArenaScore.Score};" + + $"{fbCurrentArenaInformation.Win};" + + $"{fbCurrentArenaInformation.Win};" + + $"{fbCurrentArenaInformation.Lose};" + + $"{fbCurrentArenaInformation.Ticket};" + + $"{fbCurrentArenaInformation.PurchasedTicketCount};" + + $"{fbCurrentArenaInformation.TicketResetCount};" + + $"{fbArenaData.EntranceFee};" + + $"{fbArenaData.TicketPrice};" + + $"{fbArenaData.AdditionalTicketPrice};" + + $"{fbArenaData.RequiredMedalCount};" + + $"{fbArenaData.StartBlockIndex};" + + $"{fbArenaData.EndBlockIndex};" + + $"{0};" + + $"{fbTip.Timestamp.UtcDateTime:yyyy-MM-dd}" + ); + } + + if (!fbAgents.Contains(fbAvatarState.agentAddress.ToString())) + { + fbAgents.Add(fbAvatarState.agentAddress.ToString()); + + if (fbEv.OutputState.TryGetStakeStateV2(fbAvatarState.agentAddress, out StakeStateV2 fbStakeState2)) + { + var fbStakeStateAddress = StakeStateV2.DeriveAddress(fbAvatarState.agentAddress); + var fbCurrency = fbEv.OutputState.GetGoldCurrency(); + var fbStakedBalance = fbEv.OutputState.GetBalance(fbStakeStateAddress, fbCurrency); + _fbUsBulkFile.WriteLine( + $"{fbTip.Index};" + + "V3;" + + $"{fbAvatarState.agentAddress.ToString()};" + + $"{Convert.ToDecimal(fbStakedBalance.GetQuantityString())};" + + $"{fbStakeState2.StartedBlockIndex};" + + $"{fbStakeState2.ReceivedBlockIndex};" + + $"{fbStakeState2.CancellableBlockIndex}" + ); + } + + if (fbEv.OutputState.TryGetStakeState(fbAvatarState.agentAddress, out StakeState fbStakeState)) + { + var fbStakeStateAddress = StakeState.DeriveAddress(fbAvatarState.agentAddress); + var fbCurrency = fbEv.OutputState.GetGoldCurrency(); + var fbStakedBalance = fbEv.OutputState.GetBalance(fbStakeStateAddress, fbCurrency); + _fbUsBulkFile.WriteLine( + $"{fbTip.Index};" + + "V2;" + + $"{fbAvatarState.agentAddress.ToString()};" + + $"{Convert.ToDecimal(fbStakedBalance.GetQuantityString())};" + + $"{fbStakeState.StartedBlockIndex};" + + $"{fbStakeState.ReceivedBlockIndex};" + + $"{fbStakeState.CancellableBlockIndex}" + ); + } + + var fbAgentState = fbEv.OutputState.GetAgentState(fbAvatarState.agentAddress); + Address fbMonsterCollectionAddress = MonsterCollectionState.DeriveAddress( + fbAvatarState.agentAddress, + fbAgentState.MonsterCollectionRound + ); + if (fbEv.OutputState.TryGetState(fbMonsterCollectionAddress, out Dictionary fbStateDict)) + { + var fbMonsterCollectionStates = new MonsterCollectionState(fbStateDict); + var fbCurrency = fbEv.OutputState.GetGoldCurrency(); + FungibleAssetValue fbMonsterCollectionBalance = + fbEv.OutputState.GetBalance(fbMonsterCollectionAddress, fbCurrency); + _fbUsBulkFile.WriteLine( + $"{fbTip.Index};" + + "V1;" + + $"{fbAvatarState.agentAddress.ToString()};" + + $"{Convert.ToDecimal(fbMonsterCollectionBalance.GetQuantityString())};" + + $"{fbMonsterCollectionStates.StartedBlockIndex};" + + $"{fbMonsterCollectionStates.ReceivedBlockIndex};" + + $"{fbMonsterCollectionStates.ExpiredBlockIndex}" + ); + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + + _fbUsBulkFile.Flush(); + _fbUsBulkFile.Close(); + + _fbBarBulkFile.Flush(); + _fbBarBulkFile.Close(); + + connection.Open(); + var s = + $@"CREATE TABLE IF NOT EXISTS `data_provider`.`{_fbUsDbName}` ( + `BlockIndex` bigint NOT NULL, + `StakeVersion` varchar(100) NOT NULL, + `AgentAddress` varchar(100) NOT NULL, + `StakingAmount` decimal(13,2) NOT NULL, + `StartedBlockIndex` bigint NOT NULL, + `ReceivedBlockIndex` bigint NOT NULL, + `CancellableBlockIndex` bigint NOT NULL, + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;"; + var c = new MySqlCommand(s, connection); + c.CommandTimeout = 300; + c.ExecuteScalar(); + connection.Close(); + + Console.WriteLine("6"); + + var fbstm23 = $"RENAME TABLE {_fbBarDbName} TO {_fbBarDbName}_Dump; CREATE TABLE {_fbBarDbName} LIKE {_fbBarDbName}_Dump;"; + var fbcmd23 = new MySqlCommand(fbstm23, connection); + connection.Open(); + fbcmd23.CommandTimeout = 300; + fbcmd23.ExecuteScalar(); + connection.Close(); + Console.WriteLine($"Move {_fbBarDbName} Complete!"); + + foreach (var path in _fbUsFiles) + { + BulkInsert(_fbUsDbName, path); + } + + foreach (var path in _fbBarFiles) + { + BulkInsert(_fbBarDbName, path); + } + + var fbstm34 = $"DROP TABLE {_fbBarDbName}_Dump;"; + var fbcmd34 = new MySqlCommand(fbstm34, connection); + connection.Open(); + fbcmd34.CommandTimeout = 300; + fbcmd34.ExecuteScalar(); + connection.Close(); + Console.WriteLine($"Delete {_fbBarDbName}_Dump Complete!"); + Console.WriteLine($"Finalize {_fbBarDbName} & {_fbUsDbName} Tables Complete!"); + } + + foreach (var avatar in avatars) + { + try + { + intervalCount++; + avatarCount++; + Console.WriteLine("Interval Count {0}", intervalCount); + Console.WriteLine("Migrating {0}/{1}", avatarCount, avatars.Count); + var avatarAddress = new Address(avatar); + try + { + avatarState = ev.OutputState.GetAvatarStateV2(avatarAddress); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + avatarState = ev.OutputState.GetAvatarState(avatarAddress); + } + + var avatarLevel = avatarState.level; + + var runeSheet = sheets.GetSheet(); + foreach (var runeType in runeSheet.Values) + { +#pragma warning disable CS0618 + var runeCurrency = Currency.Legacy(runeType.Ticker, 0, minters: null); +#pragma warning restore CS0618 + var outputRuneBalance = ev.OutputState.GetBalance( + avatarAddress, + runeCurrency); + if (Convert.ToDecimal(outputRuneBalance.GetQuantityString()) > 0) + { + _urBulkFile.WriteLine( + $"{tip.Index};" + + $"{avatarAddress.ToString()};" + + $"{avatarState.agentAddress.ToString()};" + + $"{runeType.Ticker};" + + $"{Convert.ToDecimal(outputRuneBalance.GetQuantityString())};" + + $"{tip.Timestamp.UtcDateTime:yyyy-MM-dd}" + ); + } + } + + var arenaScoreAdr = + ArenaScore.DeriveAddress(avatarAddress, arenaData.ChampionshipId, arenaData.Round); + var arenaInformationAdr = + ArenaInformation.DeriveAddress(avatarAddress, arenaData.ChampionshipId, arenaData.Round); + ev.OutputState.TryGetArenaInformation(arenaInformationAdr, out var currentArenaInformation); + ev.OutputState.TryGetArenaScore(arenaScoreAdr, out var outputArenaScore); + if (currentArenaInformation != null && outputArenaScore != null) + { + _barBulkFile.WriteLine( + $"{tip.Index};" + + $"{avatarState.agentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{avatarLevel};" + + $"{arenaData.ChampionshipId};" + + $"{arenaData.Round};" + + $"{arenaData.ArenaType.ToString()};" + + $"{outputArenaScore.Score};" + + $"{currentArenaInformation.Win};" + + $"{currentArenaInformation.Win};" + + $"{currentArenaInformation.Lose};" + + $"{currentArenaInformation.Ticket};" + + $"{currentArenaInformation.PurchasedTicketCount};" + + $"{currentArenaInformation.TicketResetCount};" + + $"{arenaData.EntranceFee};" + + $"{arenaData.TicketPrice};" + + $"{arenaData.AdditionalTicketPrice};" + + $"{arenaData.RequiredMedalCount};" + + $"{arenaData.StartBlockIndex};" + + $"{arenaData.EndBlockIndex};" + + $"{0};" + + $"{tip.Timestamp.UtcDateTime:yyyy-MM-dd}" + ); + } + + Address orderReceiptAddress = OrderDigestListState.DeriveAddress(avatarAddress); + var orderReceiptList = ev.OutputState.TryGetState(orderReceiptAddress, out Dictionary receiptDict) + ? new OrderDigestListState(receiptDict) + : new OrderDigestListState(orderReceiptAddress); + foreach (var orderReceipt in orderReceiptList.OrderDigestList) + { + if (orderReceipt.ExpiredBlockIndex >= tip.Index) + { + var state = ev.OutputState.GetState( + Addresses.GetItemAddress(orderReceipt.TradableId)); + ITradableItem orderItem = + (ITradableItem)ItemFactory.Deserialize((Dictionary)state); + if (orderItem.ItemType == ItemType.Equipment) + { + var equipment = (Equipment)orderItem; + Console.WriteLine(equipment.ItemId); + _seBulkFile.WriteLine( + $"{tip.Index};" + + $"{equipment.ItemId.ToString()};" + + $"{orderReceipt.SellerAgentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{equipment.ItemType.ToString()};" + + $"{equipment.ItemSubType.ToString()};" + + $"{equipment.Id};" + + $"{equipment.BuffSkills.Count};" + + $"{equipment.ElementalType.ToString()};" + + $"{equipment.Grade};" + + $"{equipment.level};" + + $"{equipment.SetId};" + + $"{equipment.Skills.Count};" + + $"{equipment.SpineResourcePath};" + + $"{equipment.RequiredBlockIndex};" + + $"{equipment.NonFungibleId.ToString()};" + + $"{equipment.NonFungibleId.ToString()};" + + $"{equipment.UniqueStatType.ToString()};" + + $"{Convert.ToDecimal(orderReceipt.Price.GetQuantityString())};" + + $"{orderReceipt.OrderId};" + + $"{orderReceipt.CombatPoint};" + + $"{orderReceipt.ItemCount};" + + $"{orderReceipt.StartedBlockIndex};" + + $"{orderReceipt.ExpiredBlockIndex}" + ); + shopOrderCount += 1; + } + + if (orderItem.ItemType == ItemType.Costume) + { + var costume = (Costume)orderItem; + Console.WriteLine(costume.ItemId); + _sctBulkFile.WriteLine( + $"{tip.Index};" + + $"{costume.ItemId.ToString()};" + + $"{orderReceipt.SellerAgentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{costume.ItemType.ToString()};" + + $"{costume.ItemSubType.ToString()};" + + $"{costume.Id};" + + $"{costume.ElementalType.ToString()};" + + $"{costume.Grade};" + + $"{costume.Equipped};" + + $"{costume.SpineResourcePath};" + + $"{costume.RequiredBlockIndex};" + + $"{costume.NonFungibleId.ToString()};" + + $"{costume.TradableId.ToString()};" + + $"{Convert.ToDecimal(orderReceipt.Price.GetQuantityString())};" + + $"{orderReceipt.OrderId};" + + $"{orderReceipt.CombatPoint};" + + $"{orderReceipt.ItemCount};" + + $"{orderReceipt.StartedBlockIndex};" + + $"{orderReceipt.ExpiredBlockIndex}" + ); + shopOrderCount += 1; + } + + if (orderItem.ItemType == ItemType.Material) + { + var material = (Material)orderItem; + Console.WriteLine(material.ItemId); + _smBulkFile.WriteLine( + $"{tip.Index};" + + $"{material.ItemId.ToString()};" + + $"{orderReceipt.SellerAgentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{material.ItemType.ToString()};" + + $"{material.ItemSubType.ToString()};" + + $"{material.Id};" + + $"{material.ElementalType.ToString()};" + + $"{material.Grade};" + + $"{orderReceipt.TradableId};" + + $"{Convert.ToDecimal(orderReceipt.Price.GetQuantityString())};" + + $"{orderReceipt.OrderId};" + + $"{orderReceipt.CombatPoint};" + + $"{orderReceipt.ItemCount};" + + $"{orderReceipt.StartedBlockIndex};" + + $"{orderReceipt.ExpiredBlockIndex}" + ); + shopOrderCount += 1; + } + + if (orderItem.ItemType == ItemType.Consumable) + { + var consumable = (Consumable)orderItem; + Console.WriteLine(consumable.ItemId); + _scBulkFile.WriteLine( + $"{tip.Index};" + + $"{consumable.ItemId.ToString()};" + + $"{orderReceipt.SellerAgentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{consumable.ItemType.ToString()};" + + $"{consumable.ItemSubType.ToString()};" + + $"{consumable.Id};" + + $"{consumable.BuffSkills.Count};" + + $"{consumable.ElementalType.ToString()};" + + $"{consumable.Grade};" + + $"{consumable.Skills.Count};" + + $"{consumable.RequiredBlockIndex};" + + $"{consumable.NonFungibleId.ToString()};" + + $"{consumable.TradableId.ToString()};" + + $"{consumable.MainStat.ToString()};" + + $"{Convert.ToDecimal(orderReceipt.Price.GetQuantityString())};" + + $"{orderReceipt.OrderId};" + + $"{orderReceipt.CombatPoint};" + + $"{orderReceipt.ItemCount};" + + $"{orderReceipt.StartedBlockIndex};" + + $"{orderReceipt.ExpiredBlockIndex}" + ); + shopOrderCount += 1; + } + + Console.WriteLine(orderReceipt.OrderId); + Console.WriteLine(orderItem.ItemType); + } + } + + var userEquipments = avatarState.inventory.Equipments; + var userCostumes = avatarState.inventory.Costumes; + var userMaterials = avatarState.inventory.Materials; + var materialItemSheet = ev.OutputState.GetSheet(); + var hourglassRow = materialItemSheet + .First(pair => pair.Value.ItemSubType == ItemSubType.Hourglass) + .Value; + var apStoneRow = materialItemSheet + .First(pair => pair.Value.ItemSubType == ItemSubType.ApStone) + .Value; + var userConsumables = avatarState.inventory.Consumables; + + foreach (var equipment in userEquipments) + { + var equipmentCp = CPHelper.GetCP(equipment); + WriteEquipment(tip.Index, equipment, avatarState.agentAddress, avatarAddress); + WriteRankingEquipment(equipment, avatarState.agentAddress, avatarAddress, equipmentCp); + } + + foreach (var costume in userCostumes) + { + WriteCostume(tip.Index, costume, avatarState.agentAddress, avatarAddress); + } + + foreach (var material in userMaterials) + { + if (material.ItemId.ToString() == hourglassRow.ItemId.ToString()) + { + if (!_hourGlassAgentList.Contains(avatarState.agentAddress.ToString())) + { + var inventoryState = new Inventory((List)avatarState.inventory.Serialize()); + inventoryState.TryGetFungibleItems(hourglassRow.ItemId, out var hourglasses); + var hourglassesCount = hourglasses.Sum(e => e.count); + WriteMaterial(tip.Index, material, hourglassesCount, avatarState.agentAddress, avatarAddress); + _hourGlassAgentList.Add(avatarState.agentAddress.ToString()); + } + } + else if (material.ItemId.ToString() == apStoneRow.ItemId.ToString()) + { + if (!_apStoneAgentList.Contains(avatarState.agentAddress.ToString())) + { + var inventoryState = new Inventory((List)avatarState.inventory.Serialize()); + inventoryState.TryGetFungibleItems(apStoneRow.ItemId, out var apStones); + var apStonesCount = apStones.Sum(e => e.count); + WriteMaterial(tip.Index, material, apStonesCount, avatarState.agentAddress, avatarAddress); + _apStoneAgentList.Add(avatarState.agentAddress.ToString()); + } + } + else + { + var inventoryState = new Inventory((List)avatarState.inventory.Serialize()); + inventoryState.TryGetFungibleItems(material.ItemId, out var materialItem); + var materialCount = materialItem.Sum(e => e.count); + WriteMaterial(tip.Index, material, materialCount, avatarState.agentAddress, avatarAddress); + } + } + + foreach (var consumable in userConsumables) + { + WriteConsumable(tip.Index, consumable, avatarState.agentAddress, avatarAddress); + } + + if (!agents.Contains(avatarState.agentAddress.ToString())) + { + agents.Add(avatarState.agentAddress.ToString()); + Currency ncgCurrency = ev.OutputState.GetGoldCurrency(); + var ncgBalance = ev.OutputState.GetBalance( + avatarState.agentAddress, + ncgCurrency); + _uncgBulkFile.WriteLine( + $"{tip.Index};" + + $"{avatarState.agentAddress.ToString()};" + + $"{Convert.ToDecimal(ncgBalance.GetQuantityString())}" + ); + Currency crystalCurrency = CrystalCalculator.CRYSTAL; + var crystalBalance = ev.OutputState.GetBalance( + avatarState.agentAddress, + crystalCurrency); + _ucyBulkFile.WriteLine( + $"{tip.Index};" + + $"{avatarState.agentAddress.ToString()};" + + $"{Convert.ToDecimal(crystalBalance.GetQuantityString())}" + ); + var agentState = ev.OutputState.GetAgentState(avatarState.agentAddress); + Address monsterCollectionAddress = MonsterCollectionState.DeriveAddress( + avatarState.agentAddress, + agentState.MonsterCollectionRound + ); + if (ev.OutputState.TryGetState(monsterCollectionAddress, out Dictionary stateDict)) + { + var mcStates = new MonsterCollectionState(stateDict); + var currency = ev.OutputState.GetGoldCurrency(); + FungibleAssetValue mcBalance = ev.OutputState.GetBalance(monsterCollectionAddress, currency); + _umcBulkFile.WriteLine( + $"{tip.Index};" + + $"{avatarState.agentAddress.ToString()};" + + $"{Convert.ToDecimal(mcBalance.GetQuantityString())};" + + $"{mcStates.Level};" + + $"{mcStates.RewardLevel};" + + $"{mcStates.StartedBlockIndex};" + + $"{mcStates.ReceivedBlockIndex};" + + $"{mcStates.ExpiredBlockIndex}" + ); + } + + if (ev.OutputState.TryGetStakeState(avatarState.agentAddress, out StakeState stakeState)) + { + var stakeStateAddress = StakeState.DeriveAddress(avatarState.agentAddress); + var currency = ev.OutputState.GetGoldCurrency(); + var stakedBalance = ev.OutputState.GetBalance(stakeStateAddress, currency); + _usBulkFile.WriteLine( + $"{tip.Index};" + + $"{avatarState.agentAddress.ToString()};" + + $"{Convert.ToDecimal(stakedBalance.GetQuantityString())};" + + $"{stakeState.StartedBlockIndex};" + + $"{stakeState.ReceivedBlockIndex};" + + $"{stakeState.CancellableBlockIndex}" + ); + } + else + { + if (ev.OutputState.TryGetStakeStateV2(avatarState.agentAddress, out StakeStateV2 stakeState2)) + { + var stakeStateAddress = StakeStateV2.DeriveAddress(avatarState.agentAddress); + var currency = ev.OutputState.GetGoldCurrency(); + var stakedBalance = ev.OutputState.GetBalance(stakeStateAddress, currency); + _usBulkFile.WriteLine( + $"{tip.Index};" + + $"{avatarState.agentAddress.ToString()};" + + $"{Convert.ToDecimal(stakedBalance.GetQuantityString())};" + + $"{stakeState2.StartedBlockIndex};" + + $"{stakeState2.ReceivedBlockIndex};" + + $"{stakeState2.CancellableBlockIndex}" + ); + } + } + } + + Console.WriteLine("Migrating Complete {0}/{1}", avatarCount, avatars.Count); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + + if (intervalCount == interval) + { + FlushBulkFiles(); + + foreach (var path in _ueFiles) + { + BulkInsert(UeDbName, path); + } + + foreach (var path in _uctFiles) + { + BulkInsert(UctDbName, path); + } + + foreach (var path in _umFiles) + { + BulkInsert(UmDbName, path); + } + + foreach (var path in _ucFiles) + { + BulkInsert(UcDbName, path); + } + + foreach (var path in _eFiles) + { + BulkInsert(EDbName, path); + } + + foreach (var path in _usFiles) + { + BulkInsert(UsDbName, path); + } + + foreach (var path in _umcFiles) + { + BulkInsert(UmcDbName, path); + } + + foreach (var path in _uncgFiles) + { + BulkInsert(UncgDbName, path); + } + + foreach (var path in _ucyFiles) + { + BulkInsert(UcyDbName, path); + } + + foreach (var path in _scFiles) + { + BulkInsert(ScDbName, path); + } + + foreach (var path in _seFiles) + { + BulkInsert(SeDbName, path); + } + + foreach (var path in _sctFiles) + { + BulkInsert(SctDbName, path); + } + + foreach (var path in _smFiles) + { + BulkInsert(SmDbName, path); + } + + foreach (var path in _barFiles) + { + BulkInsert(_barDbName, path); + } + + foreach (var path in _urFiles) + { + BulkInsert(UrDbName, path); + } + + _ueFiles.RemoveAt(0); + _uctFiles.RemoveAt(0); + _umFiles.RemoveAt(0); + _ucFiles.RemoveAt(0); + _eFiles.RemoveAt(0); + _usFiles.RemoveAt(0); + _umcFiles.RemoveAt(0); + _uncgFiles.RemoveAt(0); + _ucyFiles.RemoveAt(0); + _scFiles.RemoveAt(0); + _seFiles.RemoveAt(0); + _sctFiles.RemoveAt(0); + _smFiles.RemoveAt(0); + _barFiles.RemoveAt(0); + _urFiles.RemoveAt(0); + CreateBulkFiles(); + intervalCount = 0; + } + } + + FlushBulkFiles(); + DateTimeOffset postDataPrep = DateTimeOffset.Now; + Console.WriteLine("Data Preparation Complete! Time Elapsed: {0}", postDataPrep - start); + var stm6 = $"RENAME TABLE {EDbName} TO {EDbName}_Dump; CREATE TABLE {EDbName} LIKE {EDbName}_Dump;"; + var stm23 = $"RENAME TABLE {_barDbName} TO {_barDbName}_Dump; CREATE TABLE {_barDbName} LIKE {_barDbName}_Dump;"; + var cmd6 = new MySqlCommand(stm6, connection); + var cmd23 = new MySqlCommand(stm23, connection); + + var startMove = DateTimeOffset.Now; + var endMove = DateTimeOffset.Now; + foreach (var path in _ueFiles) + { + BulkInsert(UeDbName, path); + } + + foreach (var path in _uctFiles) + { + BulkInsert(UctDbName, path); + } + + foreach (var path in _umFiles) + { + BulkInsert(UmDbName, path); + } + + foreach (var path in _ucFiles) + { + BulkInsert(UcDbName, path); + } + + startMove = DateTimeOffset.Now; + connection.Open(); + cmd6.CommandTimeout = 300; + cmd6.ExecuteScalar(); + connection.Close(); + endMove = DateTimeOffset.Now; + Console.WriteLine("Move Equipments Complete! Time Elapsed: {0}", endMove - startMove); + foreach (var path in _eFiles) + { + BulkInsert(EDbName, path); + } + + foreach (var path in _usFiles) + { + BulkInsert(UsDbName, path); + } + + foreach (var path in _uncgFiles) + { + BulkInsert(UncgDbName, path); + } + + foreach (var path in _ucyFiles) + { + BulkInsert(UcyDbName, path); + } + + foreach (var path in _umcFiles) + { + BulkInsert(UmcDbName, path); + } + + foreach (var path in _scFiles) + { + BulkInsert(ScDbName, path); + } + + foreach (var path in _seFiles) + { + BulkInsert(SeDbName, path); + } + + foreach (var path in _sctFiles) + { + BulkInsert(SctDbName, path); + } + + foreach (var path in _smFiles) + { + BulkInsert(SmDbName, path); + } + + startMove = DateTimeOffset.Now; + connection.Open(); + cmd23.CommandTimeout = 300; + cmd23.ExecuteScalar(); + connection.Close(); + endMove = DateTimeOffset.Now; + Console.WriteLine("Move BattleArenaRanking Complete! Time Elapsed: {0}", endMove - startMove); + foreach (var path in _barFiles) + { + BulkInsert(_barDbName, path); + } + + foreach (var path in _urFiles) + { + BulkInsert(UrDbName, path); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + var stm16 = $"DROP TABLE {EDbName}; RENAME TABLE {EDbName}_Dump TO {EDbName};"; + var stm33 = $"DROP TABLE {_barDbName}; RENAME TABLE {_barDbName}_Dump TO {_barDbName};"; + var cmd16 = new MySqlCommand(stm16, connection); + var cmd33 = new MySqlCommand(stm33, connection); + DateTimeOffset startRestore = DateTimeOffset.Now; + connection.Open(); + cmd16.CommandTimeout = 300; + cmd16.ExecuteScalar(); + connection.Close(); + DateTimeOffset endRestore = DateTimeOffset.Now; + Console.WriteLine("Restore Equipments Complete! Time Elapsed: {0}", endRestore - startRestore); + startRestore = DateTimeOffset.Now; + connection.Open(); + cmd33.CommandTimeout = 300; + cmd33.ExecuteScalar(); + connection.Close(); + endRestore = DateTimeOffset.Now; + Console.WriteLine("Restore BattleArenaRanking Complete! Time Elapsed: {0}", endRestore - startRestore); + } + + var stm11 = $"DROP TABLE {EDbName}_Dump;"; + var stm34 = $"DROP TABLE {_barDbName}_Dump;"; + var cmd11 = new MySqlCommand(stm11, connection); + var cmd34 = new MySqlCommand(stm34, connection); + DateTimeOffset startDelete = DateTimeOffset.Now; + connection.Open(); + cmd11.CommandTimeout = 300; + cmd11.ExecuteScalar(); + connection.Close(); + DateTimeOffset endDelete = DateTimeOffset.Now; + Console.WriteLine("Delete Equipments_Dump Complete! Time Elapsed: {0}", endDelete - startDelete); + startDelete = DateTimeOffset.Now; + connection.Open(); + cmd34.CommandTimeout = 300; + cmd34.ExecuteScalar(); + connection.Close(); + endDelete = DateTimeOffset.Now; + Console.WriteLine("Delete BattleArenaRanking_Dump Complete! Time Elapsed: {0}", endDelete - startDelete); + DateTimeOffset end = DateTimeOffset.UtcNow; + Console.WriteLine("Migration Complete! Time Elapsed: {0}", end - start); + Console.WriteLine("Shop Count for {0} avatars: {1}", avatars.Count, shopOrderCount); + } + + private void FlushBulkFiles() + { + _ueBulkFile.Flush(); + _ueBulkFile.Close(); + + _uctBulkFile.Flush(); + _uctBulkFile.Close(); + + _umBulkFile.Flush(); + _umBulkFile.Close(); + + _ucBulkFile.Flush(); + _ucBulkFile.Close(); + + _eBulkFile.Flush(); + _eBulkFile.Close(); + + _usBulkFile.Flush(); + _usBulkFile.Close(); + + _umcBulkFile.Flush(); + _umcBulkFile.Close(); + + _uncgBulkFile.Flush(); + _uncgBulkFile.Close(); + + _ucyBulkFile.Flush(); + _ucyBulkFile.Close(); + + _scBulkFile.Flush(); + _scBulkFile.Close(); + + _seBulkFile.Flush(); + _seBulkFile.Close(); + + _sctBulkFile.Flush(); + _sctBulkFile.Close(); + + _smBulkFile.Flush(); + _smBulkFile.Close(); + + _barBulkFile.Flush(); + _barBulkFile.Close(); + + _urBulkFile.Flush(); + _urBulkFile.Close(); + } + + private void CreateBulkFiles() + { + string ueFilePath = Path.GetTempFileName(); + _ueBulkFile = new StreamWriter(ueFilePath); + + string uctFilePath = Path.GetTempFileName(); + _uctBulkFile = new StreamWriter(uctFilePath); + + string umFilePath = Path.GetTempFileName(); + _umBulkFile = new StreamWriter(umFilePath); + + string ucFilePath = Path.GetTempFileName(); + _ucBulkFile = new StreamWriter(ucFilePath); + + string eFilePath = Path.GetTempFileName(); + _eBulkFile = new StreamWriter(eFilePath); + + string usFilePath = Path.GetTempFileName(); + _usBulkFile = new StreamWriter(usFilePath); + + string umcFilePath = Path.GetTempFileName(); + _umcBulkFile = new StreamWriter(umcFilePath); + + string uncgFilePath = Path.GetTempFileName(); + _uncgBulkFile = new StreamWriter(uncgFilePath); + + string ucyFilePath = Path.GetTempFileName(); + _ucyBulkFile = new StreamWriter(ucyFilePath); + + string scFilePath = Path.GetTempFileName(); + _scBulkFile = new StreamWriter(scFilePath); + + string seFilePath = Path.GetTempFileName(); + _seBulkFile = new StreamWriter(seFilePath); + + string sctFilePath = Path.GetTempFileName(); + _sctBulkFile = new StreamWriter(sctFilePath); + + string smFilePath = Path.GetTempFileName(); + _smBulkFile = new StreamWriter(smFilePath); + + string barFilePath = Path.GetTempFileName(); + _barBulkFile = new StreamWriter(barFilePath); + + string urFilePath = Path.GetTempFileName(); + _urBulkFile = new StreamWriter(urFilePath); + + string fbBarFilePath = Path.GetTempFileName(); + _fbBarBulkFile = new StreamWriter(fbBarFilePath); + + string fbUsFilePath = Path.GetTempFileName(); + _fbUsBulkFile = new StreamWriter(fbUsFilePath); + + _ueFiles.Add(ueFilePath); + _uctFiles.Add(uctFilePath); + _umFiles.Add(umFilePath); + _ucFiles.Add(ucFilePath); + _eFiles.Add(eFilePath); + _usFiles.Add(usFilePath); + _umcFiles.Add(umcFilePath); + _uncgFiles.Add(uncgFilePath); + _ucyFiles.Add(ucyFilePath); + _scFiles.Add(scFilePath); + _seFiles.Add(seFilePath); + _sctFiles.Add(sctFilePath); + _smFiles.Add(smFilePath); + _barFiles.Add(barFilePath); + _urFiles.Add(urFilePath); + _fbBarFiles.Add(fbBarFilePath); + _fbUsFiles.Add(fbUsFilePath); + } + + private void BulkInsert( + string tableName, + string filePath) + { + using MySqlConnection connection = new MySqlConnection(_connectionString); + try + { + DateTimeOffset start = DateTimeOffset.Now; + Console.WriteLine($"Start bulk insert to {tableName}."); + MySqlBulkLoader loader = new MySqlBulkLoader(connection) + { + TableName = tableName, + FileName = filePath, + Timeout = 0, + LineTerminator = "\n", + FieldTerminator = ";", + Local = true, + ConflictOption = MySqlBulkLoaderConflictOption.Ignore, + }; + + loader.Load(); + Console.WriteLine($"Bulk load to {tableName} complete."); + DateTimeOffset end = DateTimeOffset.Now; + Console.WriteLine("Time elapsed: {0}", end - start); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine($"Bulk load to {tableName} failed. Retry bulk insert"); + DateTimeOffset start = DateTimeOffset.Now; + Console.WriteLine($"Start bulk insert to {tableName}."); + MySqlBulkLoader loader = new MySqlBulkLoader(connection) + { + TableName = tableName, + FileName = filePath, + Timeout = 0, + LineTerminator = "\n", + FieldTerminator = ";", + Local = true, + ConflictOption = MySqlBulkLoaderConflictOption.Ignore, + }; + + loader.Load(); + Console.WriteLine($"Bulk load to {tableName} complete."); + DateTimeOffset end = DateTimeOffset.Now; + Console.WriteLine("Time elapsed: {0}", end - start); + } + } + + private void WriteEquipment( + long tipIndex, + Equipment equipment, + Address agentAddress, + Address avatarAddress) + { + try + { + _ueBulkFile.WriteLine( + $"{tipIndex};" + + $"{equipment.ItemId.ToString()};" + + $"{agentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{equipment.ItemType.ToString()};" + + $"{equipment.ItemSubType.ToString()};" + + $"{equipment.Id};" + + $"{equipment.BuffSkills.Count};" + + $"{equipment.ElementalType.ToString()};" + + $"{equipment.Grade};" + + $"{equipment.level};" + + $"{equipment.SetId};" + + $"{equipment.Skills.Count};" + + $"{equipment.SpineResourcePath};" + + $"{equipment.RequiredBlockIndex};" + + $"{equipment.NonFungibleId.ToString()};" + + $"{equipment.NonFungibleId.ToString()};" + + $"{equipment.UniqueStatType.ToString()}" + ); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + } + + private void WriteRankingEquipment( + Equipment equipment, + Address agentAddress, + Address avatarAddress, + int equipmentCp) + { + try + { + _eBulkFile.WriteLine( + $"{equipment.ItemId.ToString()};" + + $"{agentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{equipment.Id};" + + $"{equipmentCp};" + + $"{equipment.level};" + + $"{equipment.ItemSubType.ToString()}" + ); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + } + + private void WriteCostume( + long tipIndex, + Costume costume, + Address agentAddress, + Address avatarAddress) + { + try + { + _uctBulkFile.WriteLine( + $"{tipIndex};" + + $"{costume.ItemId.ToString()};" + + $"{agentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{costume.ItemType.ToString()};" + + $"{costume.ItemSubType.ToString()};" + + $"{costume.Id};" + + $"{costume.ElementalType.ToString()};" + + $"{costume.Grade};" + + $"{costume.Equipped};" + + $"{costume.SpineResourcePath};" + + $"{costume.RequiredBlockIndex};" + + $"{costume.NonFungibleId.ToString()};" + + $"{costume.TradableId.ToString()}" + ); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + } + + private void WriteMaterial( + long tipIndex, + Material material, + int materialCount, + Address agentAddress, + Address avatarAddress) + { + try + { + _umBulkFile.WriteLine( + $"{tipIndex};" + + $"{material.ItemId.ToString()};" + + $"{agentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{material.ItemType.ToString()};" + + $"{material.ItemSubType.ToString()};" + + $"{materialCount};" + + $"{material.Id};" + + $"{material.ElementalType.ToString()};" + + $"{material.Grade}" + ); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + } + + private void WriteConsumable( + long tipIndex, + Consumable consumable, + Address agentAddress, + Address avatarAddress) + { + try + { + _ucBulkFile.WriteLine( + $"{tipIndex};" + + $"{consumable.ItemId.ToString()};" + + $"{agentAddress.ToString()};" + + $"{avatarAddress.ToString()};" + + $"{consumable.ItemType.ToString()};" + + $"{consumable.ItemSubType.ToString()};" + + $"{consumable.Id};" + + $"{consumable.BuffSkills.Count};" + + $"{consumable.ElementalType.ToString()};" + + $"{consumable.Grade};" + + $"{consumable.Skills.Count};" + + $"{consumable.RequiredBlockIndex};" + + $"{consumable.NonFungibleId.ToString()};" + + $"{consumable.TradableId.ToString()};" + + $"{consumable.MainStat.ToString()}" + ); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Program.cs b/NineChronicles.DataProvider.Executable/Program.cs index f36e2772..e5cff14f 100644 --- a/NineChronicles.DataProvider.Executable/Program.cs +++ b/NineChronicles.DataProvider.Executable/Program.cs @@ -26,6 +26,7 @@ namespace NineChronicles.DataProvider.Executable [HasSubCommands(typeof(MySqlMigration), "mysql-migration")] [HasSubCommands(typeof(BattleArenaRankingMigration), "battle-arena-ranking-migration")] [HasSubCommands(typeof(UserStakingMigration), "user-staking-migration")] + [HasSubCommands(typeof(UserDataMigration), "user-data-migration")] public class Program : CoconaLiteConsoleAppBase { public static async Task Main(string[] args) From f73c3926f4026312bb35a67e11028de69f6181da Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Tue, 17 Oct 2023 15:26:13 +0900 Subject: [PATCH 02/20] Bump 9c-headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index e6b6891d..41a28956 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit e6b6891d6c6bbe50d892b5813e6440e742c94219 +Subproject commit 41a289568e991046b0644505ffa2d3b66f343922 From 51ef48088a0ce4ea91b592dc9d5c5b56ed28d826 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Tue, 17 Oct 2023 17:13:13 +0900 Subject: [PATCH 03/20] Accommodate API changes --- .../Commands/BattleArenaRankingMigration.cs | 15 +- .../Commands/MySqlMigration.cs | 749 +++++++++--------- .../Commands/UserStakingMigration.cs | 23 +- .../RenderSubscriber.cs | 207 +++-- 4 files changed, 532 insertions(+), 462 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Commands/BattleArenaRankingMigration.cs b/NineChronicles.DataProvider.Executable/Commands/BattleArenaRankingMigration.cs index a50f1a27..ceda70e2 100644 --- a/NineChronicles.DataProvider.Executable/Commands/BattleArenaRankingMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/BattleArenaRankingMigration.cs @@ -7,6 +7,7 @@ namespace NineChronicles.DataProvider.Executable.Commands using Cocona; using Libplanet; using Libplanet.Action; + using Libplanet.Action.State; using Libplanet.Blockchain; using Libplanet.Blockchain.Policies; using Libplanet.Crypto; @@ -116,7 +117,7 @@ public void Migration( var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); var actionEvaluator = new ActionEvaluator( _ => blockPolicy.BlockAction, - blockChainStates, + baseStateStore, new NCActionLoader()); _baseChain = new BlockChain(blockPolicy, stagePolicy, _baseStore, baseStateStore, genesis, blockChainStates, actionEvaluator); @@ -161,6 +162,8 @@ public void Migration( var tip = _baseStore.GetBlock((BlockHash)tipHash!); var blockEvaluation = _baseChain.EvaluateBlock(tip); var evaluation = blockEvaluation.Last(); + var outputState = new Account(_baseChain.GetAccountState(evaluation.OutputState)); + var avatarCount = 0; AvatarState avatarState; bool checkBattleArenaRankingTable = false; @@ -174,17 +177,17 @@ public void Migration( var avatarAddress = new Address(avatar); try { - avatarState = evaluation.OutputState.GetAvatarStateV2(avatarAddress); + avatarState = outputState.GetAvatarStateV2(avatarAddress); } catch (Exception) { - avatarState = evaluation.OutputState.GetAvatarState(avatarAddress); + avatarState = outputState.GetAvatarState(avatarAddress); } if (avatarState != null) { var avatarLevel = avatarState.level; - var arenaSheet = evaluation.OutputState.GetSheet(); + var arenaSheet = outputState.GetSheet(); var arenaData = arenaSheet.GetRoundByBlockIndex(tip.Index); if (!checkBattleArenaRankingTable) @@ -229,8 +232,8 @@ public void Migration( ArenaScore.DeriveAddress(avatarAddress, arenaData.ChampionshipId, arenaData.Round); var arenaInformationAdr = ArenaInformation.DeriveAddress(avatarAddress, arenaData.ChampionshipId, arenaData.Round); - evaluation.OutputState.TryGetArenaInformation(arenaInformationAdr, out var currentArenaInformation); - evaluation.OutputState.TryGetArenaScore(arenaScoreAdr, out var outputArenaScore); + outputState.TryGetArenaInformation(arenaInformationAdr, out var currentArenaInformation); + outputState.TryGetArenaScore(arenaScoreAdr, out var outputArenaScore); if (currentArenaInformation != null && outputArenaScore != null) { _barBulkFile.WriteLine( diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index 674a78a8..da53b0f3 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -11,6 +11,7 @@ namespace NineChronicles.DataProvider.Executable.Commands using Lib9c.Model.Order; using Libplanet.Action; using Libplanet.Action.Loader; + using Libplanet.Action.State; using Libplanet.Blockchain; using Libplanet.Blockchain.Policies; using Libplanet.Crypto; @@ -187,7 +188,7 @@ public void Migration( var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); var actionEvaluator = new ActionEvaluator( _ => blockPolicy.BlockAction, - blockChainStates, + baseStateStore, new NCActionLoader()); _baseChain = new BlockChain(blockPolicy, stagePolicy, _baseStore, baseStateStore, genesis, blockChainStates, actionEvaluator); @@ -258,15 +259,15 @@ public void Migration( { int interval = 100; int limitInterval; - Task>[] taskArray; + Task>[] taskArray; if (interval < remainingCount) { - taskArray = new Task>[interval]; + taskArray = new Task>[interval]; limitInterval = interval; } else { - taskArray = new Task>[remainingCount]; + taskArray = new Task>[remainingCount]; limitInterval = remainingCount; } @@ -292,7 +293,7 @@ public void Migration( taskArray[item.i] = Task.Factory.StartNew(() => { - List actionEvaluations = EvaluateBlock(block); + List actionEvaluations = EvaluateBlock(block); Console.WriteLine($"Block progress: #{block.Index}/{remainingCount}"); return actionEvaluations; }); @@ -310,7 +311,7 @@ public void Migration( } Task.WaitAll(taskArray); - ProcessTasks(taskArray); + ProcessTasks(taskArray, blockChainStates); } DateTimeOffset postDataPrep = _blockTimeOffset; @@ -370,15 +371,19 @@ public void Migration( Console.WriteLine("Migration Complete! Time Elapsed: {0}", end - start); } - private void ProcessTasks(Task>[] taskArray) + private void ProcessTasks(Task>[] taskArray, IBlockChainStates blockChainStates) { foreach (var task in taskArray) { if (task.Result is { } data) { + var actionLoader = new NCActionLoader(); + foreach (var ae in data) { - var actionLoader = new NCActionLoader(); + var inputState = new Account(blockChainStates.GetAccountState(ae.InputContext.PreviousState)); + var outputState = new Account(blockChainStates.GetAccountState(ae.OutputState)); + if (actionLoader.LoadAction(_blockIndex, ae.Action) is ActionBase action) { // avatarNames will be stored as "N/A" for optimization @@ -389,15 +394,15 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, hasAction.AvatarAddress, hasAction.RuneInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, hasAction.AvatarAddress, hasAction.RuneInfos, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction.AvatarAddress, hasAction.StageId, hasAction.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction.AvatarAddress, hasAction.StageId, hasAction.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); if (hasAction.StageBuffId.HasValue) { - _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction.AvatarAddress, hasAction.StageId, hasAction.StageBuffId, hasAction.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(inputState, outputState, ae.InputContext.Signer, hasAction.AvatarAddress, hasAction.StageId, hasAction.StageBuffId, hasAction.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } } @@ -408,15 +413,15 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, hasAction19.AvatarAddress, hasAction19.RuneInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, hasAction19.AvatarAddress, hasAction19.RuneInfos, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash19), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction19.AvatarAddress, hasAction19.StageId, hasAction19.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction19.AvatarAddress, hasAction19.StageId, hasAction19.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); if (hasAction19.StageBuffId.HasValue) { - _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction19.AvatarAddress, hasAction19.StageId, hasAction19.StageBuffId, hasAction19.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(inputState, outputState, ae.InputContext.Signer, hasAction19.AvatarAddress, hasAction19.StageId, hasAction19.StageBuffId, hasAction19.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } } @@ -427,15 +432,15 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction18.AvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction18.AvatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash18), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction18.AvatarAddress, hasAction18.StageId, hasAction18.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction18.AvatarAddress, hasAction18.StageId, hasAction18.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); if (hasAction18.StageBuffId.HasValue) { - _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction18.AvatarAddress, hasAction18.StageId, hasAction18.StageBuffId, hasAction18.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(inputState, outputState, ae.InputContext.Signer, hasAction18.AvatarAddress, hasAction18.StageId, hasAction18.StageBuffId, hasAction18.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } } @@ -446,15 +451,15 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction17.AvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction17.AvatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash17), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction17.AvatarAddress, hasAction17.StageId, hasAction17.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction17.AvatarAddress, hasAction17.StageId, hasAction17.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); if (hasAction17.StageBuffId.HasValue) { - _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction17.AvatarAddress, hasAction17.StageId, hasAction17.StageBuffId, hasAction17.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(inputState, outputState, ae.InputContext.Signer, hasAction17.AvatarAddress, hasAction17.StageId, hasAction17.StageBuffId, hasAction17.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } } @@ -465,15 +470,15 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction16.AvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction16.AvatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash16), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction16.AvatarAddress, hasAction16.StageId, hasAction16.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction16.AvatarAddress, hasAction16.StageId, hasAction16.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); if (hasAction16.StageBuffId.HasValue) { - _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction16.AvatarAddress, hasAction16.StageId, hasAction16.StageBuffId, hasAction16.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(inputState, outputState, ae.InputContext.Signer, hasAction16.AvatarAddress, hasAction16.StageId, hasAction16.StageBuffId, hasAction16.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } } @@ -484,12 +489,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction15.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction15.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash15), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction15.avatarAddress, hasAction15.stageId, hasAction15.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction15.avatarAddress, hasAction15.stageId, hasAction15.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash14 hasAction14) @@ -499,12 +504,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction14.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction14.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash14), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction14.avatarAddress, hasAction14.stageId, hasAction14.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction14.avatarAddress, hasAction14.stageId, hasAction14.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash13 hasAction13) @@ -514,12 +519,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction13.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction13.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash13), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction13.avatarAddress, hasAction13.stageId, hasAction13.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction13.avatarAddress, hasAction13.stageId, hasAction13.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash12 hasAction12) @@ -529,12 +534,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction12.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction12.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash12), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction12.avatarAddress, hasAction12.stageId, hasAction12.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction12.avatarAddress, hasAction12.stageId, hasAction12.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash11 hasAction11) @@ -544,12 +549,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction11.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction11.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash11), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction11.avatarAddress, hasAction11.stageId, hasAction11.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction11.avatarAddress, hasAction11.stageId, hasAction11.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash10 hasAction10) @@ -559,12 +564,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction10.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction10.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash10), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction10.avatarAddress, hasAction10.stageId, hasAction10.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction10.avatarAddress, hasAction10.stageId, hasAction10.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash9 hasAction9) @@ -574,12 +579,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction9.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction9.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash9), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction9.avatarAddress, hasAction9.stageId, hasAction9.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction9.avatarAddress, hasAction9.stageId, hasAction9.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash8 hasAction8) @@ -589,12 +594,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction8.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction8.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash8), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction8.avatarAddress, hasAction8.stageId, hasAction8.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction8.avatarAddress, hasAction8.stageId, hasAction8.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash7 hasAction7) @@ -604,12 +609,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction7.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction7.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash7), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction7.avatarAddress, hasAction7.stageId, hasAction7.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction7.avatarAddress, hasAction7.stageId, hasAction7.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash6 hasAction6) @@ -619,12 +624,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction6.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction6.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash6), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction6.avatarAddress, hasAction6.stageId, hasAction6.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction6.avatarAddress, hasAction6.stageId, hasAction6.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash5 hasAction5) @@ -634,12 +639,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction5.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction5.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash5), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction5.avatarAddress, hasAction5.stageId, hasAction5.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction5.avatarAddress, hasAction5.stageId, hasAction5.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash4 hasAction4) @@ -649,12 +654,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction4.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction4.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash4), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction4.avatarAddress, hasAction4.stageId, hasAction4.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction4.avatarAddress, hasAction4.stageId, hasAction4.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash3 hasAction3) @@ -664,12 +669,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction3.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction3.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash3), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction3.avatarAddress, hasAction3.stageId, hasAction3.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction3.avatarAddress, hasAction3.stageId, hasAction3.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash2 hasAction2) @@ -679,12 +684,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction2.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction2.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash2), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction2.avatarAddress, hasAction2.stageId, hasAction2.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction2.avatarAddress, hasAction2.stageId, hasAction2.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is HackAndSlash0 hasAction0) @@ -694,12 +699,12 @@ private void ProcessTasks(Task>[] taskArray) // check if address is already in _avatarCheck if (!_avatarCheck.Contains(avatarAddress.ToString())) { - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasAction0.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasAction0.avatarAddress, _blockTimeOffset)); _avatarCheck.Add(avatarAddress.ToString()); } Console.WriteLine("Writing {0} action {1} in block #{2}", nameof(HackAndSlash0), ae.InputContext.TxId, ae.InputContext.BlockIndex); - _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasAction0.avatarAddress, hasAction0.stageId, hasAction0.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hackAndSlashList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ae.InputContext.Signer, hasAction0.avatarAddress, hasAction0.stageId, hasAction0.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); } if (action is IClaimStakeReward claimStakeReward) @@ -711,10 +716,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(RuneHelper.StakeRune.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( avatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -728,7 +733,7 @@ private void ProcessTasks(Task>[] taskArray) runeCurrency.Ticker, acquiredRune, _blockTimeOffset)); - _claimStakeRewardList.Add(ClaimStakeRewardData.GetClaimStakeRewardInfo(claimStakeReward, ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); + _claimStakeRewardList.Add(ClaimStakeRewardData.GetClaimStakeRewardInfo(claimStakeReward, inputState, outputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ClaimStakeReward action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -739,8 +744,8 @@ private void ProcessTasks(Task>[] taskArray) var actionType = eventDungeonBattle.ToString()!.Split('.').LastOrDefault() ?.Replace(">", string.Empty); _eventDungeonBattleList.Add(EventDungeonBattleData.GetEventDungeonBattleInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, eventDungeonBattle.AvatarAddress, eventDungeonBattle.EventScheduleId, @@ -763,8 +768,8 @@ private void ProcessTasks(Task>[] taskArray) var actionType = eventDungeonBattle3.ToString()!.Split('.').LastOrDefault() ?.Replace(">", string.Empty); _eventDungeonBattleList.Add(EventDungeonBattleData.GetEventDungeonBattleInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, eventDungeonBattle3.AvatarAddress, eventDungeonBattle3.EventScheduleId, @@ -787,8 +792,8 @@ private void ProcessTasks(Task>[] taskArray) var actionType = eventDungeonBattle2.ToString()!.Split('.').LastOrDefault() ?.Replace(">", string.Empty); _eventDungeonBattleList.Add(EventDungeonBattleData.GetEventDungeonBattleInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, eventDungeonBattle2.AvatarAddress, eventDungeonBattle2.EventScheduleId, @@ -811,8 +816,8 @@ private void ProcessTasks(Task>[] taskArray) var actionType = eventDungeonBattle1.ToString()!.Split('.').LastOrDefault() ?.Replace(">", string.Empty); _eventDungeonBattleList.Add(EventDungeonBattleData.GetEventDungeonBattleInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, eventDungeonBattle1.AvatarAddress, eventDungeonBattle1.EventScheduleId, @@ -832,7 +837,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is EventConsumableItemCrafts eventConsumableItemCrafts) { var start = DateTimeOffset.UtcNow; - _eventConsumableItemCraftsList.Add(EventConsumableItemCraftsData.GetEventConsumableItemCraftsInfo(eventConsumableItemCrafts, ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); + _eventConsumableItemCraftsList.Add(EventConsumableItemCraftsData.GetEventConsumableItemCraftsInfo(eventConsumableItemCrafts, inputState, outputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing EventConsumableItemCrafts action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -840,10 +845,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep hasSweep) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, hasSweep.avatarAddress, hasSweep.runeInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, hasSweep.avatarAddress, hasSweep.runeInfos, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep.avatarAddress, hasSweep.stageId, @@ -862,10 +867,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep8 hasSweep8) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, hasSweep8.avatarAddress, hasSweep8.runeInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, hasSweep8.avatarAddress, hasSweep8.runeInfos, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep8.avatarAddress, hasSweep8.stageId, @@ -884,10 +889,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep7 hasSweep7) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasSweep7.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasSweep7.avatarAddress, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep7.avatarAddress, hasSweep7.stageId, @@ -906,10 +911,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep6 hasSweep6) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasSweep6.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasSweep6.avatarAddress, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep6.avatarAddress, hasSweep6.stageId, @@ -928,10 +933,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep5 hasSweep5) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasSweep5.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasSweep5.avatarAddress, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep5.avatarAddress, hasSweep5.stageId, @@ -950,10 +955,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep4 hasSweep4) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasSweep4.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasSweep4.avatarAddress, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep4.avatarAddress, hasSweep4.stageId, @@ -972,10 +977,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep3 hasSweep3) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasSweep3.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasSweep3.avatarAddress, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep3.avatarAddress, hasSweep3.stageId, @@ -994,10 +999,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep2 hasSweep2) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasSweep2.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasSweep2.avatarAddress, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfoV1( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep2.avatarAddress, hasSweep2.stageId, @@ -1013,10 +1018,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashSweep1 hasSweep1) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, hasSweep1.avatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, hasSweep1.avatarAddress, _blockTimeOffset)); _hackAndSlashSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfoV1( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, hasSweep1.avatarAddress, hasSweep1.stageId, @@ -1033,8 +1038,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationConsumableList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationConsumable.avatarAddress, combinationConsumable.recipeId, @@ -1049,8 +1054,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationConsumableList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationConsumable7.AvatarAddress, combinationConsumable7.recipeId, @@ -1065,8 +1070,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationConsumableList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationConsumable6.AvatarAddress, combinationConsumable6.recipeId, @@ -1081,8 +1086,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationConsumableList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationConsumable5.AvatarAddress, combinationConsumable5.recipeId, @@ -1097,8 +1102,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationConsumableList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationConsumable4.AvatarAddress, combinationConsumable4.recipeId, @@ -1113,8 +1118,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationConsumableList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationConsumable3.AvatarAddress, combinationConsumable3.recipeId, @@ -1129,8 +1134,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationConsumableList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationConsumable2.AvatarAddress, combinationConsumable2.recipeId, @@ -1145,8 +1150,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationConsumableList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationConsumable0.AvatarAddress, combinationConsumable0.recipeId, @@ -1161,8 +1166,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment.avatarAddress, combinationEquipment.recipeId, @@ -1174,8 +1179,8 @@ private void ProcessTasks(Task>[] taskArray) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData .GetReplaceCombinationEquipmentMaterialInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment.avatarAddress, combinationEquipment.recipeId, @@ -1197,7 +1202,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment.avatarAddress, combinationEquipment.slotIndex); @@ -1221,8 +1226,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment15.avatarAddress, combinationEquipment15.recipeId, @@ -1234,8 +1239,8 @@ private void ProcessTasks(Task>[] taskArray) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData .GetReplaceCombinationEquipmentMaterialInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment15.avatarAddress, combinationEquipment15.recipeId, @@ -1257,7 +1262,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment15.avatarAddress, combinationEquipment15.slotIndex); @@ -1281,8 +1286,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment14.avatarAddress, combinationEquipment14.recipeId, @@ -1294,8 +1299,8 @@ private void ProcessTasks(Task>[] taskArray) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData .GetReplaceCombinationEquipmentMaterialInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment14.avatarAddress, combinationEquipment14.recipeId, @@ -1317,7 +1322,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment14.avatarAddress, combinationEquipment14.slotIndex); @@ -1341,8 +1346,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment13.avatarAddress, combinationEquipment13.recipeId, @@ -1354,8 +1359,8 @@ private void ProcessTasks(Task>[] taskArray) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData .GetReplaceCombinationEquipmentMaterialInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment13.avatarAddress, combinationEquipment13.recipeId, @@ -1377,7 +1382,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment13.avatarAddress, combinationEquipment13.slotIndex); @@ -1401,8 +1406,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment12.avatarAddress, combinationEquipment12.recipeId, @@ -1414,8 +1419,8 @@ private void ProcessTasks(Task>[] taskArray) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData .GetReplaceCombinationEquipmentMaterialInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment12.avatarAddress, combinationEquipment12.recipeId, @@ -1437,7 +1442,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment12.avatarAddress, combinationEquipment12.slotIndex); @@ -1461,8 +1466,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment11.avatarAddress, combinationEquipment11.recipeId, @@ -1478,7 +1483,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment11.avatarAddress, combinationEquipment11.slotIndex); @@ -1502,8 +1507,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment10.avatarAddress, combinationEquipment10.recipeId, @@ -1519,7 +1524,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment10.avatarAddress, combinationEquipment10.slotIndex); @@ -1543,8 +1548,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment9.avatarAddress, combinationEquipment9.recipeId, @@ -1560,7 +1565,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment9.avatarAddress, combinationEquipment9.slotIndex); @@ -1584,8 +1589,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment8.avatarAddress, combinationEquipment8.recipeId, @@ -1601,7 +1606,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment8.avatarAddress, combinationEquipment8.slotIndex); @@ -1625,8 +1630,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment7.AvatarAddress, combinationEquipment7.RecipeId, @@ -1642,7 +1647,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment7.AvatarAddress, combinationEquipment7.SlotIndex); @@ -1666,8 +1671,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment6.AvatarAddress, combinationEquipment6.RecipeId, @@ -1683,7 +1688,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment6.AvatarAddress, combinationEquipment6.SlotIndex); @@ -1707,8 +1712,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment5.AvatarAddress, combinationEquipment5.RecipeId, @@ -1724,7 +1729,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment5.AvatarAddress, combinationEquipment5.SlotIndex); @@ -1748,8 +1753,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment4.AvatarAddress, combinationEquipment4.RecipeId, @@ -1765,7 +1770,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment4.AvatarAddress, combinationEquipment4.SlotIndex); @@ -1789,8 +1794,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment3.AvatarAddress, combinationEquipment3.RecipeId, @@ -1806,7 +1811,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment3.AvatarAddress, combinationEquipment3.SlotIndex); @@ -1830,8 +1835,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment2.AvatarAddress, combinationEquipment2.RecipeId, @@ -1847,7 +1852,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment2.AvatarAddress, combinationEquipment2.SlotIndex); @@ -1871,8 +1876,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _combinationEquipmentList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, combinationEquipment0.AvatarAddress, combinationEquipment0.RecipeId, @@ -1888,7 +1893,7 @@ private void ProcessTasks(Task>[] taskArray) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment0.AvatarAddress, combinationEquipment0.SlotIndex); @@ -1912,8 +1917,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement.avatarAddress, Guid.Empty, @@ -1927,8 +1932,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement.avatarAddress, itemEnhancement.slotIndex, @@ -1941,7 +1946,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement.avatarAddress, itemEnhancement.slotIndex); @@ -1965,8 +1970,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement10.avatarAddress, itemEnhancement10.materialId, @@ -1980,8 +1985,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement10.avatarAddress, itemEnhancement10.slotIndex, @@ -1994,7 +1999,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement10.avatarAddress, itemEnhancement10.slotIndex); @@ -2018,8 +2023,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement9.avatarAddress, itemEnhancement9.materialId, @@ -2033,8 +2038,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement9.avatarAddress, itemEnhancement9.slotIndex, @@ -2047,7 +2052,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement9.avatarAddress, itemEnhancement9.slotIndex); @@ -2071,8 +2076,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement8.avatarAddress, itemEnhancement8.materialId, @@ -2086,8 +2091,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement8.avatarAddress, itemEnhancement8.slotIndex, @@ -2100,7 +2105,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement8.avatarAddress, itemEnhancement8.slotIndex); @@ -2124,8 +2129,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement7.avatarAddress, itemEnhancement7.materialId, @@ -2139,8 +2144,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement7.avatarAddress, itemEnhancement7.slotIndex, @@ -2153,7 +2158,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement7.avatarAddress, itemEnhancement7.slotIndex); @@ -2177,8 +2182,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement6.avatarAddress, itemEnhancement6.materialId, @@ -2192,8 +2197,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement6.avatarAddress, itemEnhancement6.slotIndex, @@ -2206,7 +2211,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement6.avatarAddress, itemEnhancement6.slotIndex); @@ -2230,8 +2235,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement5.avatarAddress, itemEnhancement5.materialId, @@ -2245,8 +2250,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement5.avatarAddress, itemEnhancement5.slotIndex, @@ -2259,7 +2264,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement5.avatarAddress, itemEnhancement5.slotIndex); @@ -2283,8 +2288,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement4.avatarAddress, itemEnhancement4.materialId, @@ -2298,8 +2303,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement4.avatarAddress, itemEnhancement4.slotIndex, @@ -2312,7 +2317,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement4.avatarAddress, itemEnhancement4.slotIndex); @@ -2336,8 +2341,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement3.avatarAddress, itemEnhancement3.materialId, @@ -2351,8 +2356,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement3.avatarAddress, itemEnhancement3.slotIndex, @@ -2365,7 +2370,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement3.avatarAddress, itemEnhancement3.slotIndex); @@ -2389,8 +2394,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement2.avatarAddress, itemEnhancement2.materialId, @@ -2404,8 +2409,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement2.avatarAddress, itemEnhancement2.slotIndex, @@ -2418,7 +2423,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement2.avatarAddress, itemEnhancement2.slotIndex); @@ -2442,8 +2447,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement0.avatarAddress, itemEnhancement0.materialIds.FirstOrDefault(), @@ -2457,8 +2462,8 @@ private void ProcessTasks(Task>[] taskArray) } _itemEnhancementList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, itemEnhancement0.avatarAddress, itemEnhancement0.slotIndex, @@ -2471,7 +2476,7 @@ private void ProcessTasks(Task>[] taskArray) Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ae.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement0.avatarAddress, itemEnhancement0.slotIndex); @@ -2494,17 +2499,17 @@ private void ProcessTasks(Task>[] taskArray) if (action is Buy buy) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ae.OutputState.GetAvatarStateV2(buy.buyerAvatarAddress); + AvatarState avatarState = outputState.GetAvatarStateV2(buy.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy.purchaseInfos) { - var state = ae.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.TradableId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ae.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.OrderId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -2563,7 +2568,7 @@ private void ProcessTasks(Task>[] taskArray) || purchaseInfo.ItemSubType == ItemSubType.Ring || purchaseInfo.ItemSubType == ItemSubType.Weapon) { - var sellerState = ae.OutputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -2596,17 +2601,17 @@ private void ProcessTasks(Task>[] taskArray) if (action is Buy11 buy11) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ae.OutputState.GetAvatarStateV2(buy11.buyerAvatarAddress); + AvatarState avatarState = outputState.GetAvatarStateV2(buy11.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy11.purchaseInfos) { - var state = ae.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.TradableId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ae.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.OrderId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -2665,7 +2670,7 @@ private void ProcessTasks(Task>[] taskArray) || purchaseInfo.ItemSubType == ItemSubType.Ring || purchaseInfo.ItemSubType == ItemSubType.Weapon) { - var sellerState = ae.OutputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -2698,17 +2703,17 @@ private void ProcessTasks(Task>[] taskArray) if (action is Buy10 buy10) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ae.OutputState.GetAvatarStateV2(buy10.buyerAvatarAddress); + AvatarState avatarState = outputState.GetAvatarStateV2(buy10.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy10.purchaseInfos) { - var state = ae.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.TradableId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ae.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.OrderId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -2767,7 +2772,7 @@ private void ProcessTasks(Task>[] taskArray) || purchaseInfo.ItemSubType == ItemSubType.Ring || purchaseInfo.ItemSubType == ItemSubType.Weapon) { - var sellerState = ae.OutputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -2800,17 +2805,17 @@ private void ProcessTasks(Task>[] taskArray) if (action is Buy9 buy9) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ae.OutputState.GetAvatarStateV2(buy9.buyerAvatarAddress); + AvatarState avatarState = outputState.GetAvatarStateV2(buy9.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy9.purchaseInfos) { - var state = ae.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.TradableId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ae.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.OrderId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -2869,7 +2874,7 @@ private void ProcessTasks(Task>[] taskArray) || purchaseInfo.ItemSubType == ItemSubType.Ring || purchaseInfo.ItemSubType == ItemSubType.Weapon) { - var sellerState = ae.OutputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -2902,17 +2907,17 @@ private void ProcessTasks(Task>[] taskArray) if (action is Buy8 buy8) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ae.OutputState.GetAvatarStateV2(buy8.buyerAvatarAddress); + AvatarState avatarState = outputState.GetAvatarStateV2(buy8.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy8.purchaseInfos) { - var state = ae.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.TradableId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ae.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.OrderId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -2971,7 +2976,7 @@ private void ProcessTasks(Task>[] taskArray) || purchaseInfo.ItemSubType == ItemSubType.Ring || purchaseInfo.ItemSubType == ItemSubType.Weapon) { - var sellerState = ae.OutputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -3004,17 +3009,17 @@ private void ProcessTasks(Task>[] taskArray) if (action is Buy7 buy7) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ae.OutputState.GetAvatarStateV2(buy7.buyerAvatarAddress); + AvatarState avatarState = outputState.GetAvatarStateV2(buy7.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy7.purchaseInfos) { - var state = ae.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.productId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ae.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.productId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -3073,7 +3078,7 @@ private void ProcessTasks(Task>[] taskArray) || purchaseInfo.itemSubType == ItemSubType.Ring || purchaseInfo.itemSubType == ItemSubType.Weapon) { - var sellerState = ae.OutputState.GetAvatarStateV2(purchaseInfo.sellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.sellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -3106,17 +3111,17 @@ private void ProcessTasks(Task>[] taskArray) if (action is Buy6 buy6) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ae.OutputState.GetAvatarStateV2(buy6.buyerAvatarAddress); + AvatarState avatarState = outputState.GetAvatarStateV2(buy6.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy6.purchaseInfos) { - var state = ae.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.productId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ae.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.productId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -3175,7 +3180,7 @@ private void ProcessTasks(Task>[] taskArray) || purchaseInfo.itemSubType == ItemSubType.Ring || purchaseInfo.itemSubType == ItemSubType.Weapon) { - var sellerState = ae.OutputState.GetAvatarStateV2(purchaseInfo.sellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.sellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -3208,17 +3213,17 @@ private void ProcessTasks(Task>[] taskArray) if (action is Buy5 buy5) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ae.OutputState.GetAvatarStateV2(buy5.buyerAvatarAddress); + AvatarState avatarState = outputState.GetAvatarStateV2(buy5.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy5.purchaseInfos) { - var state = ae.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.productId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ae.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.productId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -3277,7 +3282,7 @@ private void ProcessTasks(Task>[] taskArray) || purchaseInfo.itemSubType == ItemSubType.Ring || purchaseInfo.itemSubType == ItemSubType.Weapon) { - var sellerState = ae.OutputState.GetAvatarStateV2(purchaseInfo.sellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.sellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -3606,7 +3611,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is Stake stake) { var start = DateTimeOffset.UtcNow; - _stakeList.Add(StakeData.GetStakeInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); + _stakeList.Add(StakeData.GetStakeInfo(inputState, outputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing Stake action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -3614,7 +3619,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is Stake0 stake0) { var start = DateTimeOffset.UtcNow; - _stakeList.Add(StakeData.GetStakeInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); + _stakeList.Add(StakeData.GetStakeInfo(inputState, outputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing Stake action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -3622,7 +3627,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is MigrateMonsterCollection migrateMonsterCollection) { var start = DateTimeOffset.UtcNow; - _migrateMonsterCollectionList.Add(MigrateMonsterCollectionData.GetMigrateMonsterCollectionInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); + _migrateMonsterCollectionList.Add(MigrateMonsterCollectionData.GetMigrateMonsterCollectionInfo(inputState, outputState, ae.InputContext.Signer, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing MigrateMonsterCollection action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -3631,7 +3636,7 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; - var grindList = GrindingData.GetGrindingInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, grinding.AvatarAddress, grinding.EquipmentIds, grinding.Id, ae.InputContext.BlockIndex, _blockTimeOffset); + var grindList = GrindingData.GetGrindingInfo(inputState, outputState, ae.InputContext.Signer, grinding.AvatarAddress, grinding.EquipmentIds, grinding.Id, ae.InputContext.BlockIndex, _blockTimeOffset); foreach (var grind in grindList) { @@ -3645,7 +3650,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is UnlockEquipmentRecipe unlockEquipmentRecipe) { var start = DateTimeOffset.UtcNow; - var unlockEquipmentRecipeList = UnlockEquipmentRecipeData.GetUnlockEquipmentRecipeInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, unlockEquipmentRecipe.AvatarAddress, unlockEquipmentRecipe.RecipeIds, unlockEquipmentRecipe.Id, ae.InputContext.BlockIndex, _blockTimeOffset); + var unlockEquipmentRecipeList = UnlockEquipmentRecipeData.GetUnlockEquipmentRecipeInfo(inputState, outputState, ae.InputContext.Signer, unlockEquipmentRecipe.AvatarAddress, unlockEquipmentRecipe.RecipeIds, unlockEquipmentRecipe.Id, ae.InputContext.BlockIndex, _blockTimeOffset); foreach (var unlockEquipmentRecipeData in unlockEquipmentRecipeList) { _unlockEquipmentRecipeList.Add(unlockEquipmentRecipeData); @@ -3658,7 +3663,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is UnlockEquipmentRecipe1 unlockEquipmentRecipe1) { var start = DateTimeOffset.UtcNow; - var unlockEquipmentRecipeList = UnlockEquipmentRecipeData.GetUnlockEquipmentRecipeInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, unlockEquipmentRecipe1.AvatarAddress, unlockEquipmentRecipe1.RecipeIds, unlockEquipmentRecipe1.Id, ae.InputContext.BlockIndex, _blockTimeOffset); + var unlockEquipmentRecipeList = UnlockEquipmentRecipeData.GetUnlockEquipmentRecipeInfo(inputState, outputState, ae.InputContext.Signer, unlockEquipmentRecipe1.AvatarAddress, unlockEquipmentRecipe1.RecipeIds, unlockEquipmentRecipe1.Id, ae.InputContext.BlockIndex, _blockTimeOffset); foreach (var unlockEquipmentRecipeData in unlockEquipmentRecipeList) { _unlockEquipmentRecipeList.Add(unlockEquipmentRecipeData); @@ -3671,7 +3676,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is UnlockWorld unlockWorld) { var start = DateTimeOffset.UtcNow; - var unlockWorldList = UnlockWorldData.GetUnlockWorldInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, unlockWorld.AvatarAddress, unlockWorld.WorldIds, unlockWorld.Id, ae.InputContext.BlockIndex, _blockTimeOffset); + var unlockWorldList = UnlockWorldData.GetUnlockWorldInfo(inputState, outputState, ae.InputContext.Signer, unlockWorld.AvatarAddress, unlockWorld.WorldIds, unlockWorld.Id, ae.InputContext.BlockIndex, _blockTimeOffset); foreach (var unlockWorldData in unlockWorldList) { _unlockWorldList.Add(unlockWorldData); @@ -3684,7 +3689,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is UnlockWorld1 unlockWorld1) { var start = DateTimeOffset.UtcNow; - var unlockWorldList = UnlockWorldData.GetUnlockWorldInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, unlockWorld1.AvatarAddress, unlockWorld1.WorldIds, unlockWorld1.Id, ae.InputContext.BlockIndex, _blockTimeOffset); + var unlockWorldList = UnlockWorldData.GetUnlockWorldInfo(inputState, outputState, ae.InputContext.Signer, unlockWorld1.AvatarAddress, unlockWorld1.WorldIds, unlockWorld1.Id, ae.InputContext.BlockIndex, _blockTimeOffset); foreach (var unlockWorldData in unlockWorldList) { _unlockWorldList.Add(unlockWorldData); @@ -3697,7 +3702,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is HackAndSlashRandomBuff hasRandomBuff) { var start = DateTimeOffset.UtcNow; - _hasRandomBuffList.Add(HackAndSlashRandomBuffData.GetHasRandomBuffInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, hasRandomBuff.AvatarAddress, hasRandomBuff.AdvancedGacha, hasRandomBuff.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _hasRandomBuffList.Add(HackAndSlashRandomBuffData.GetHasRandomBuffInfo(inputState, outputState, ae.InputContext.Signer, hasRandomBuff.AvatarAddress, hasRandomBuff.AdvancedGacha, hasRandomBuff.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing HasRandomBuff action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -3705,7 +3710,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is JoinArena joinArena) { var start = DateTimeOffset.UtcNow; - _joinArenaList.Add(JoinArenaData.GetJoinArenaInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, joinArena.avatarAddress, joinArena.round, joinArena.championshipId, joinArena.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _joinArenaList.Add(JoinArenaData.GetJoinArenaInfo(inputState, outputState, ae.InputContext.Signer, joinArena.avatarAddress, joinArena.round, joinArena.championshipId, joinArena.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing JoinArena action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -3713,7 +3718,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is JoinArena2 joinArena2) { var start = DateTimeOffset.UtcNow; - _joinArenaList.Add(JoinArenaData.GetJoinArenaInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, joinArena2.avatarAddress, joinArena2.round, joinArena2.championshipId, joinArena2.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _joinArenaList.Add(JoinArenaData.GetJoinArenaInfo(inputState, outputState, ae.InputContext.Signer, joinArena2.avatarAddress, joinArena2.round, joinArena2.championshipId, joinArena2.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing JoinArena action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -3721,7 +3726,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is JoinArena1 joinArena1) { var start = DateTimeOffset.UtcNow; - _joinArenaList.Add(JoinArenaData.GetJoinArenaInfo(ae.InputContext.PreviousState, ae.OutputState, ae.InputContext.Signer, joinArena1.avatarAddress, joinArena1.round, joinArena1.championshipId, joinArena1.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); + _joinArenaList.Add(JoinArenaData.GetJoinArenaInfo(inputState, outputState, ae.InputContext.Signer, joinArena1.avatarAddress, joinArena1.round, joinArena1.championshipId, joinArena1.Id, ae.InputContext.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing JoinArena action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -3729,10 +3734,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena battleArena) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, battleArena.myAvatarAddress, battleArena.runeInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, battleArena.myAvatarAddress, battleArena.runeInfos, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena.myAvatarAddress, battleArena.enemyAvatarAddress, @@ -3749,10 +3754,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena8 battleArena8) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, battleArena8.myAvatarAddress, battleArena8.runeInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, battleArena8.myAvatarAddress, battleArena8.runeInfos, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena8.myAvatarAddress, battleArena8.enemyAvatarAddress, @@ -3769,10 +3774,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena7 battleArena7) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, battleArena7.myAvatarAddress, battleArena7.runeInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, battleArena7.myAvatarAddress, battleArena7.runeInfos, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena7.myAvatarAddress, battleArena7.enemyAvatarAddress, @@ -3789,10 +3794,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena6 battleArena6) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, battleArena6.myAvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, battleArena6.myAvatarAddress, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena6.myAvatarAddress, battleArena6.enemyAvatarAddress, @@ -3809,10 +3814,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena5 battleArena5) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, battleArena5.myAvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, battleArena5.myAvatarAddress, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena5.myAvatarAddress, battleArena5.enemyAvatarAddress, @@ -3829,10 +3834,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena4 battleArena4) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, battleArena4.myAvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, battleArena4.myAvatarAddress, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena4.myAvatarAddress, battleArena4.enemyAvatarAddress, @@ -3849,10 +3854,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena3 battleArena3) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, battleArena3.myAvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, battleArena3.myAvatarAddress, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena3.myAvatarAddress, battleArena3.enemyAvatarAddress, @@ -3869,10 +3874,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena2 battleArena2) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, battleArena2.myAvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, battleArena2.myAvatarAddress, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena2.myAvatarAddress, battleArena2.enemyAvatarAddress, @@ -3889,10 +3894,10 @@ private void ProcessTasks(Task>[] taskArray) if (action is BattleArena1 battleArena1) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, battleArena1.myAvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, battleArena1.myAvatarAddress, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleArena1.myAvatarAddress, battleArena1.enemyAvatarAddress, @@ -3910,8 +3915,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _battleGrandFinaleList.Add(BattleGrandFinaleData.GetBattleGrandFinaleInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleGrandFinale.myAvatarAddress, battleGrandFinale.enemyAvatarAddress, @@ -3927,8 +3932,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _battleGrandFinaleList.Add(BattleGrandFinaleData.GetBattleGrandFinaleInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, battleGrandFinale1.myAvatarAddress, battleGrandFinale1.enemyAvatarAddress, @@ -3944,8 +3949,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _eventMaterialItemCraftsList.Add(EventMaterialItemCraftsData.GetEventMaterialItemCraftsInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, eventMaterialItemCrafts.AvatarAddress, eventMaterialItemCrafts.MaterialsToUse, @@ -3962,8 +3967,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _runeEnhancementList.Add(RuneEnhancementData.GetRuneEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, runeEnhancement.AvatarAddress, runeEnhancement.RuneId, @@ -3979,8 +3984,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _runeEnhancementList.Add(RuneEnhancementData.GetRuneEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, runeEnhancement0.AvatarAddress, runeEnhancement0.RuneId, @@ -4036,10 +4041,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(RuneHelper.DailyRewardRune.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( dailyReward.avatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( dailyReward.avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4064,10 +4069,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(RuneHelper.DailyRewardRune.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( dailyReward6.avatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( dailyReward6.avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4092,10 +4097,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(RuneHelper.DailyRewardRune.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( dailyReward5.avatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( dailyReward5.avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4120,10 +4125,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(RuneHelper.DailyRewardRune.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( dailyReward4.avatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( dailyReward4.avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4148,10 +4153,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(RuneHelper.DailyRewardRune.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( dailyReward3.avatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( dailyReward3.avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4176,10 +4181,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(RuneHelper.DailyRewardRune.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( dailyReward2.avatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( dailyReward2.avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4204,10 +4209,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(RuneHelper.DailyRewardRune.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( dailyReward0.avatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( dailyReward0.avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4229,7 +4234,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is ClaimRaidReward claimRaidReward) { var start = DateTimeOffset.UtcNow; - var sheets = ae.OutputState.GetSheets( + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(RuneSheet), @@ -4240,10 +4245,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(runeType.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( claimRaidReward.AvatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( claimRaidReward.AvatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4271,8 +4276,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _unlockRuneSlotList.Add(UnlockRuneSlotData.GetUnlockRuneSlotInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, unlockRuneSlot.AvatarAddress, unlockRuneSlot.SlotIndex, @@ -4287,8 +4292,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination.avatarAddress, rapidCombination.slotIndex, @@ -4303,8 +4308,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination8.avatarAddress, rapidCombination8.slotIndex, @@ -4319,8 +4324,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination7.avatarAddress, rapidCombination7.slotIndex, @@ -4335,8 +4340,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination6.avatarAddress, rapidCombination6.slotIndex, @@ -4351,8 +4356,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination5.avatarAddress, rapidCombination5.slotIndex, @@ -4367,8 +4372,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination4.avatarAddress, rapidCombination4.slotIndex, @@ -4383,8 +4388,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination3.avatarAddress, rapidCombination3.slotIndex, @@ -4399,8 +4404,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination2.avatarAddress, rapidCombination2.slotIndex, @@ -4415,8 +4420,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, rapidCombination0.avatarAddress, rapidCombination0.slotIndex, @@ -4429,7 +4434,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is Raid raid) { - var sheets = ae.OutputState.GetSheets( + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(CharacterSheet), @@ -4445,10 +4450,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(runeType.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( raid.AvatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( raid.AvatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4468,13 +4473,13 @@ private void ProcessTasks(Task>[] taskArray) } } - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, raid.AvatarAddress, raid.RuneInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, raid.AvatarAddress, raid.RuneInfos, _blockTimeOffset)); int raidId = 0; bool found = false; for (int i = 0; i < 99; i++) { - if (ae.OutputState.Delta.UpdatedAddresses.Contains( + if (outputState.Delta.UpdatedAddresses.Contains( Addresses.GetRaiderAddress(raid.AvatarAddress, i))) { raidId = i; @@ -4486,7 +4491,7 @@ private void ProcessTasks(Task>[] taskArray) if (found) { RaiderState raiderState = - ae.OutputState.GetRaiderState(raid.AvatarAddress, raidId); + outputState.GetRaiderState(raid.AvatarAddress, raidId); _raiderList.Add(RaidData.GetRaidInfo(raidId, raiderState)); } else @@ -4497,7 +4502,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is Raid4 raid4) { - var sheets = ae.OutputState.GetSheets( + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(CharacterSheet), @@ -4513,10 +4518,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(runeType.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( raid4.AvatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( raid4.AvatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4536,13 +4541,13 @@ private void ProcessTasks(Task>[] taskArray) } } - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, raid4.AvatarAddress, raid4.RuneInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, raid4.AvatarAddress, raid4.RuneInfos, _blockTimeOffset)); int raidId = 0; bool found = false; for (int i = 0; i < 99; i++) { - if (ae.OutputState.Delta.UpdatedAddresses.Contains( + if (outputState.Delta.UpdatedAddresses.Contains( Addresses.GetRaiderAddress(raid4.AvatarAddress, i))) { raidId = i; @@ -4554,7 +4559,7 @@ private void ProcessTasks(Task>[] taskArray) if (found) { RaiderState raiderState = - ae.OutputState.GetRaiderState(raid4.AvatarAddress, raidId); + outputState.GetRaiderState(raid4.AvatarAddress, raidId); _raiderList.Add(RaidData.GetRaidInfo(raidId, raiderState)); } else @@ -4565,7 +4570,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is Raid3 raid3) { - var sheets = ae.OutputState.GetSheets( + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(CharacterSheet), @@ -4581,10 +4586,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(runeType.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( raid3.AvatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( raid3.AvatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4604,13 +4609,13 @@ private void ProcessTasks(Task>[] taskArray) } } - _avatarList.Add(AvatarData.GetAvatarInfo(ae.OutputState, ae.InputContext.Signer, raid3.AvatarAddress, raid3.RuneInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ae.InputContext.Signer, raid3.AvatarAddress, raid3.RuneInfos, _blockTimeOffset)); int raidId = 0; bool found = false; for (int i = 0; i < 99; i++) { - if (ae.OutputState.Delta.UpdatedAddresses.Contains( + if (outputState.Delta.UpdatedAddresses.Contains( Addresses.GetRaiderAddress(raid3.AvatarAddress, i))) { raidId = i; @@ -4622,7 +4627,7 @@ private void ProcessTasks(Task>[] taskArray) if (found) { RaiderState raiderState = - ae.OutputState.GetRaiderState(raid3.AvatarAddress, raidId); + outputState.GetRaiderState(raid3.AvatarAddress, raidId); _raiderList.Add(RaidData.GetRaidInfo(raidId, raiderState)); } else @@ -4633,7 +4638,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is Raid2 raid2) { - var sheets = ae.OutputState.GetSheets( + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(CharacterSheet), @@ -4649,10 +4654,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(runeType.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( raid2.AvatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( raid2.AvatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4672,13 +4677,13 @@ private void ProcessTasks(Task>[] taskArray) } } - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, raid2.AvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, raid2.AvatarAddress, _blockTimeOffset)); int raidId = 0; bool found = false; for (int i = 0; i < 99; i++) { - if (ae.OutputState.Delta.UpdatedAddresses.Contains( + if (outputState.Delta.UpdatedAddresses.Contains( Addresses.GetRaiderAddress(raid2.AvatarAddress, i))) { raidId = i; @@ -4690,7 +4695,7 @@ private void ProcessTasks(Task>[] taskArray) if (found) { RaiderState raiderState = - ae.OutputState.GetRaiderState(raid2.AvatarAddress, raidId); + outputState.GetRaiderState(raid2.AvatarAddress, raidId); _raiderList.Add(RaidData.GetRaidInfo(raidId, raiderState)); } else @@ -4701,7 +4706,7 @@ private void ProcessTasks(Task>[] taskArray) if (action is Raid1 raid1) { - var sheets = ae.OutputState.GetSheets( + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(CharacterSheet), @@ -4717,10 +4722,10 @@ private void ProcessTasks(Task>[] taskArray) #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(runeType.Ticker, 0, minters: null); #pragma warning restore CS0618 - var prevRuneBalance = ae.InputContext.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( raid1.AvatarAddress, runeCurrency); - var outputRuneBalance = ae.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( raid1.AvatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -4740,13 +4745,13 @@ private void ProcessTasks(Task>[] taskArray) } } - _avatarList.Add(AvatarData.GetAvatarInfoV1(ae.OutputState, ae.InputContext.Signer, raid1.AvatarAddress, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfoV1(outputState, ae.InputContext.Signer, raid1.AvatarAddress, _blockTimeOffset)); int raidId = 0; bool found = false; for (int i = 0; i < 99; i++) { - if (ae.OutputState.Delta.UpdatedAddresses.Contains( + if (outputState.Delta.UpdatedAddresses.Contains( Addresses.GetRaiderAddress(raid1.AvatarAddress, i))) { raidId = i; @@ -4758,7 +4763,7 @@ private void ProcessTasks(Task>[] taskArray) if (found) { RaiderState raiderState = - ae.OutputState.GetRaiderState(raid1.AvatarAddress, raidId); + outputState.GetRaiderState(raid1.AvatarAddress, raidId); _raiderList.Add(RaidData.GetRaidInfo(raidId, raiderState)); } else @@ -4771,8 +4776,8 @@ private void ProcessTasks(Task>[] taskArray) { var start = DateTimeOffset.UtcNow; _petEnhancementList.Add(PetEnhancementData.GetPetEnhancementInfo( - ae.InputContext.PreviousState, - ae.OutputState, + inputState, + outputState, ae.InputContext.Signer, petEnhancement.AvatarAddress, petEnhancement.PetId, @@ -4870,7 +4875,7 @@ private void ProcessTasks(Task>[] taskArray) } } - private List EvaluateBlock(Block block) + private List EvaluateBlock(Block block) { var evList = _baseChain.EvaluateBlock(block).ToList(); return evList; diff --git a/NineChronicles.DataProvider.Executable/Commands/UserStakingMigration.cs b/NineChronicles.DataProvider.Executable/Commands/UserStakingMigration.cs index 20ecac74..caae2a4a 100644 --- a/NineChronicles.DataProvider.Executable/Commands/UserStakingMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/UserStakingMigration.cs @@ -10,6 +10,7 @@ namespace NineChronicles.DataProvider.Executable.Commands using Cocona; using Libplanet; using Libplanet.Action; + using Libplanet.Action.State; using Libplanet.Blockchain; using Libplanet.Blockchain.Policies; using Libplanet.Crypto; @@ -127,7 +128,7 @@ public void Migration( var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); var actionEvaluator = new ActionEvaluator( _ => blockPolicy.BlockAction, - blockChainStates, + baseStateStore, new NCActionLoader()); _baseChain = new BlockChain(blockPolicy, stagePolicy, _baseStore, baseStateStore, genesis, blockChainStates, actionEvaluator); @@ -182,6 +183,8 @@ public void Migration( var tip = _baseStore.GetBlock((BlockHash)tipHash!); var blockEvaluation = _baseChain.EvaluateBlock(tip); var evaluation = blockEvaluation.Last(); + var outputState = new Account(_baseChain.GetAccountState(evaluation.OutputState)); + var avatarCount = 0; AvatarState avatarState; int intervalCount = 0; @@ -198,11 +201,11 @@ public void Migration( var avatarAddress = new Address(avatar); try { - avatarState = evaluation.OutputState.GetAvatarStateV2(avatarAddress); + avatarState = outputState.GetAvatarStateV2(avatarAddress); } catch (Exception) { - avatarState = evaluation.OutputState.GetAvatarState(avatarAddress); + avatarState = outputState.GetAvatarState(avatarAddress); } if (!checkUserStakingTable) @@ -230,13 +233,13 @@ public void Migration( if (!agents.Contains(avatarState.agentAddress.ToString())) { agents.Add(avatarState.agentAddress.ToString()); - if (evaluation.OutputState.TryGetStakeStateV2( + if (outputState.TryGetStakeStateV2( avatarState.agentAddress, out var stakeStateV2)) { var stakeAddress = StakeStateV2.DeriveAddress(avatarState.agentAddress); - var currency = evaluation.OutputState.GetGoldCurrency(); - var stakedBalance = evaluation.OutputState.GetBalance(stakeAddress, currency); + var currency = outputState.GetGoldCurrency(); + var stakedBalance = outputState.GetBalance(stakeAddress, currency); _usBulkFile.WriteLine( $"{tip.Index};" + "V2;" + @@ -248,17 +251,17 @@ public void Migration( ); } - var agentState = evaluation.OutputState.GetAgentState(avatarState.agentAddress); + var agentState = outputState.GetAgentState(avatarState.agentAddress); Address monsterCollectionAddress = MonsterCollectionState.DeriveAddress( avatarState.agentAddress, agentState.MonsterCollectionRound ); - if (evaluation.OutputState.TryGetState(monsterCollectionAddress, out Dictionary stateDict)) + if (outputState.TryGetState(monsterCollectionAddress, out Dictionary stateDict)) { var monsterCollectionStates = new MonsterCollectionState(stateDict); - var currency = evaluation.OutputState.GetGoldCurrency(); + var currency = outputState.GetGoldCurrency(); FungibleAssetValue monsterCollectionBalance = - evaluation.OutputState.GetBalance(monsterCollectionAddress, currency); + outputState.GetBalance(monsterCollectionAddress, currency); _usBulkFile.WriteLine( $"{tip.Index};" + "V1;" + diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index d7b76d35..86015f88 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -10,6 +10,7 @@ namespace NineChronicles.DataProvider using Bencodex.Types; using Lib9c.Model.Order; using Lib9c.Renderers; + using Libplanet.Action.State; using Libplanet.Crypto; using Libplanet.Types.Blocks; using Libplanet.Types.Tx; @@ -35,6 +36,7 @@ public class RenderSubscriber : BackgroundService private const int DefaultInsertInterval = 1; private readonly int _blockInsertInterval; private readonly string _blockIndexFilePath; + private readonly IBlockChainStates _blockChainStates; private readonly BlockRenderer _blockRenderer; private readonly ActionRenderer _actionRenderer; private readonly ExceptionRenderer _exceptionRenderer; @@ -92,6 +94,7 @@ public RenderSubscriber( MySqlStore mySqlStore ) { + _blockChainStates = nodeService.BlockChain; _blockRenderer = nodeService.BlockRenderer; _actionRenderer = nodeService.ActionRenderer; _exceptionRenderer = nodeService.ExceptionRenderer; @@ -210,10 +213,12 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) #pragma warning disable CS0618 var runeCurrency = RuneHelper.StakeRune; #pragma warning restore CS0618 - var prevRuneBalance = ev.PreviousState.GetBalance( + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + var prevRuneBalance = inputState.GetBalance( avatarAddress, runeCurrency); - var outputRuneBalance = ev.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -227,7 +232,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) runeCurrency.Ticker, acquiredRune, _blockTimeOffset)); - _claimStakeList.Add(ClaimStakeRewardData.GetClaimStakeRewardInfo(claimStakeReward, ev.PreviousState, ev.OutputState, ev.Signer, ev.BlockIndex, _blockTimeOffset)); + _claimStakeList.Add(ClaimStakeRewardData.GetClaimStakeRewardInfo(claimStakeReward, inputState, outputState, ev.Signer, ev.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Log.Debug("Stored ClaimStakeReward action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); } @@ -248,9 +253,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) var start = DateTimeOffset.UtcNow; var actionType = eventDungeonBattle.ToString()!.Split('.').LastOrDefault() ?.Replace(">", string.Empty); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _eventDungeonBattleList.Add(EventDungeonBattleData.GetEventDungeonBattleInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, eventDungeonBattle.AvatarAddress, eventDungeonBattle.EventScheduleId, @@ -281,7 +288,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } eventConsumableItemCrafts) { var start = DateTimeOffset.UtcNow; - _eventConsumableItemCraftsList.Add(EventConsumableItemCraftsData.GetEventConsumableItemCraftsInfo(eventConsumableItemCrafts, ev.PreviousState, ev.OutputState, ev.Signer, ev.BlockIndex, _blockTimeOffset)); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + _eventConsumableItemCraftsList.Add(EventConsumableItemCraftsData.GetEventConsumableItemCraftsInfo(eventConsumableItemCrafts, inputState, outputState, ev.Signer, ev.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Log.Debug("Stored EventConsumableItemCrafts action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); } @@ -320,11 +329,13 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } has) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfo(ev.OutputState, ev.Signer, has.AvatarAddress, has.RuneInfos, _blockTimeOffset)); - _hasList.Add(HackAndSlashData.GetHackAndSlashInfo(ev.PreviousState, ev.OutputState, ev.Signer, has.AvatarAddress, has.StageId, has.Id, ev.BlockIndex, _blockTimeOffset)); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, has.AvatarAddress, has.RuneInfos, _blockTimeOffset)); + _hasList.Add(HackAndSlashData.GetHackAndSlashInfo(inputState, outputState, ev.Signer, has.AvatarAddress, has.StageId, has.Id, ev.BlockIndex, _blockTimeOffset)); if (has.StageBuffId.HasValue) { - _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(ev.PreviousState, ev.OutputState, ev.Signer, has.AvatarAddress, has.StageId, has.StageBuffId, has.Id, ev.BlockIndex, _blockTimeOffset)); + _hasWithRandomBuffList.Add(HasWithRandomBuffData.GetHasWithRandomBuffInfo(inputState, outputState, ev.Signer, has.AvatarAddress, has.StageId, has.StageBuffId, has.Id, ev.BlockIndex, _blockTimeOffset)); } var end = DateTimeOffset.UtcNow; @@ -345,10 +356,12 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } hasSweep) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfo(ev.OutputState, ev.Signer, hasSweep.avatarAddress, hasSweep.runeInfos, _blockTimeOffset)); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, hasSweep.avatarAddress, hasSweep.runeInfos, _blockTimeOffset)); _hasSweepList.Add(HackAndSlashSweepData.GetHackAndSlashSweepInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, hasSweep.avatarAddress, hasSweep.stageId, @@ -378,9 +391,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } combinationConsumable) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _ccList.Add(CombinationConsumableData.GetCombinationConsumableInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, combinationConsumable.avatarAddress, combinationConsumable.recipeId, @@ -405,9 +420,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } combinationEquipment) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _ceList.Add(CombinationEquipmentData.GetCombinationEquipmentInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, combinationEquipment.avatarAddress, combinationEquipment.recipeId, @@ -419,8 +436,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData .GetReplaceCombinationEquipmentMaterialInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, combinationEquipment.avatarAddress, combinationEquipment.recipeId, @@ -442,7 +459,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ev.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( combinationEquipment.avatarAddress, combinationEquipment.slotIndex); @@ -476,9 +493,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } itemEnhancement) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); if (ItemEnhancementFailData.GetItemEnhancementFailInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, itemEnhancement.avatarAddress, Guid.Empty, @@ -492,8 +511,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) } _ieList.Add(ItemEnhancementData.GetItemEnhancementInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, itemEnhancement.avatarAddress, itemEnhancement.slotIndex, @@ -506,7 +525,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) Log.Debug("Stored ItemEnhancement action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; - var slotState = ev.OutputState.GetCombinationSlotState( + var slotState = outputState.GetCombinationSlotState( itemEnhancement.avatarAddress, itemEnhancement.slotIndex); @@ -540,17 +559,18 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } buy) { var start = DateTimeOffset.UtcNow; - AvatarState avatarState = ev.OutputState.GetAvatarStateV2(buy.buyerAvatarAddress); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + AvatarState avatarState = outputState.GetAvatarStateV2(buy.buyerAvatarAddress); var buyerInventory = avatarState.inventory; foreach (var purchaseInfo in buy.purchaseInfos) { - var state = ev.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(purchaseInfo.TradableId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ev.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(purchaseInfo.OrderId))!); int itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -563,7 +583,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) || purchaseInfo.ItemSubType == ItemSubType.Ring || purchaseInfo.ItemSubType == ItemSubType.Weapon) { - var sellerState = ev.OutputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); + var sellerState = outputState.GetAvatarStateV2(purchaseInfo.SellerAvatarAddress); var sellerInventory = sellerState.inventory; if (buyerInventory.Equipments == null || sellerInventory.Equipments == null) @@ -607,13 +627,15 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } buy) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); foreach (var productInfo in buy.ProductInfos) { switch (productInfo) { case FavProductInfo _: // Check previous product state. because Set Bencodex.Types.Null in BuyProduct. - if (ev.PreviousState.TryGetState(Product.DeriveAddress(productInfo.ProductId), out List productState)) + if (inputState.TryGetState(Product.DeriveAddress(productInfo.ProductId), out List productState)) { var favProduct = (FavProduct)ProductFactory.DeserializeProduct(productState); _buyShopFavList.Add(new ShopHistoryFungibleAssetValueModel @@ -640,13 +662,13 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) // backward compatibility for order. if (itemProductInfo.Legacy) { - var state = ev.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(itemProductInfo.TradableId)); orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state!); Order order = OrderFactory.Deserialize( - (Dictionary)ev.OutputState.GetState( + (Dictionary)outputState.GetState( Order.DeriveAddress(itemProductInfo.ProductId))!); itemCount = order is FungibleOrder fungibleOrder ? fungibleOrder.ItemCount @@ -655,7 +677,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) else { // Check previous product state. because Set Bencodex.Types.Null in BuyProduct. - if (ev.PreviousState.TryGetState(Product.DeriveAddress(productInfo.ProductId), out List state)) + if (inputState.TryGetState(Product.DeriveAddress(productInfo.ProductId), out List state)) { var product = (ItemProduct)ProductFactory.DeserializeProduct(state); orderItem = product.TradableItem; @@ -712,7 +734,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } stake) { var start = DateTimeOffset.UtcNow; - _stakeList.Add(StakeData.GetStakeInfo(ev.PreviousState, ev.OutputState, ev.Signer, ev.BlockIndex, _blockTimeOffset)); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + _stakeList.Add(StakeData.GetStakeInfo(inputState, outputState, ev.Signer, ev.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Log.Debug("Stored Stake action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); } @@ -731,7 +755,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } mc) { var start = DateTimeOffset.UtcNow; - _mmcList.Add(MigrateMonsterCollectionData.GetMigrateMonsterCollectionInfo(ev.PreviousState, ev.OutputState, ev.Signer, ev.BlockIndex, _blockTimeOffset)); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + _mmcList.Add(MigrateMonsterCollectionData.GetMigrateMonsterCollectionInfo(inputState, outputState, ev.Signer, ev.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Log.Debug("Stored MigrateMonsterCollection action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); } @@ -750,8 +776,10 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Action is { } grinding) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); - var grindList = GrindingData.GetGrindingInfo(ev.PreviousState, ev.OutputState, ev.Signer, grinding.AvatarAddress, grinding.EquipmentIds, grinding.Id, ev.BlockIndex, _blockTimeOffset); + var grindList = GrindingData.GetGrindingInfo(inputState, outputState, ev.Signer, grinding.AvatarAddress, grinding.EquipmentIds, grinding.Id, ev.BlockIndex, _blockTimeOffset); foreach (var grind in grindList) { @@ -776,7 +804,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } unlockEquipmentRecipe) { var start = DateTimeOffset.UtcNow; - var unlockEquipmentRecipeList = UnlockEquipmentRecipeData.GetUnlockEquipmentRecipeInfo(ev.PreviousState, ev.OutputState, ev.Signer, unlockEquipmentRecipe.AvatarAddress, unlockEquipmentRecipe.RecipeIds, unlockEquipmentRecipe.Id, ev.BlockIndex, _blockTimeOffset); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + var unlockEquipmentRecipeList = UnlockEquipmentRecipeData.GetUnlockEquipmentRecipeInfo(inputState, outputState, ev.Signer, unlockEquipmentRecipe.AvatarAddress, unlockEquipmentRecipe.RecipeIds, unlockEquipmentRecipe.Id, ev.BlockIndex, _blockTimeOffset); foreach (var unlockEquipmentRecipeData in unlockEquipmentRecipeList) { _unlockEquipmentRecipeList.Add(unlockEquipmentRecipeData); @@ -800,7 +830,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } unlockWorld) { var start = DateTimeOffset.UtcNow; - var unlockWorldList = UnlockWorldData.GetUnlockWorldInfo(ev.PreviousState, ev.OutputState, ev.Signer, unlockWorld.AvatarAddress, unlockWorld.WorldIds, unlockWorld.Id, ev.BlockIndex, _blockTimeOffset); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + var unlockWorldList = UnlockWorldData.GetUnlockWorldInfo(inputState, outputState, ev.Signer, unlockWorld.AvatarAddress, unlockWorld.WorldIds, unlockWorld.Id, ev.BlockIndex, _blockTimeOffset); foreach (var unlockWorldData in unlockWorldList) { _unlockWorldList.Add(unlockWorldData); @@ -824,7 +856,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } hasRandomBuff) { var start = DateTimeOffset.UtcNow; - _hasRandomBuffList.Add(HackAndSlashRandomBuffData.GetHasRandomBuffInfo(ev.PreviousState, ev.OutputState, ev.Signer, hasRandomBuff.AvatarAddress, hasRandomBuff.AdvancedGacha, hasRandomBuff.Id, ev.BlockIndex, _blockTimeOffset)); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + _hasRandomBuffList.Add(HackAndSlashRandomBuffData.GetHasRandomBuffInfo(inputState, outputState, ev.Signer, hasRandomBuff.AvatarAddress, hasRandomBuff.AdvancedGacha, hasRandomBuff.Id, ev.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Log.Debug("Stored HasRandomBuff action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); } @@ -843,7 +877,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } joinArena) { var start = DateTimeOffset.UtcNow; - _joinArenaList.Add(JoinArenaData.GetJoinArenaInfo(ev.PreviousState, ev.OutputState, ev.Signer, joinArena.avatarAddress, joinArena.round, joinArena.championshipId, joinArena.Id, ev.BlockIndex, _blockTimeOffset)); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + _joinArenaList.Add(JoinArenaData.GetJoinArenaInfo(inputState, outputState, ev.Signer, joinArena.avatarAddress, joinArena.round, joinArena.championshipId, joinArena.Id, ev.BlockIndex, _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Log.Debug("Stored JoinArena action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); } @@ -862,10 +898,12 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } battleArena) { var start = DateTimeOffset.UtcNow; - _avatarList.Add(AvatarData.GetAvatarInfo(ev.OutputState, ev.Signer, battleArena.myAvatarAddress, battleArena.runeInfos, _blockTimeOffset)); + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, battleArena.myAvatarAddress, battleArena.runeInfos, _blockTimeOffset)); _battleArenaList.Add(BattleArenaData.GetBattleArenaInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, battleArena.myAvatarAddress, battleArena.enemyAvatarAddress, @@ -893,9 +931,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } battleGrandFinale) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _battleGrandFinaleList.Add(BattleGrandFinaleData.GetBattleGrandFinaleInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, battleGrandFinale.myAvatarAddress, battleGrandFinale.enemyAvatarAddress, @@ -921,9 +961,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } eventMaterialItemCrafts) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _eventMaterialItemCraftsList.Add(EventMaterialItemCraftsData.GetEventMaterialItemCraftsInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, eventMaterialItemCrafts.AvatarAddress, eventMaterialItemCrafts.MaterialsToUse, @@ -950,9 +992,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } runeEnhancement) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _runeEnhancementList.Add(RuneEnhancementData.GetRuneEnhancementInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, runeEnhancement.AvatarAddress, runeEnhancement.RuneId, @@ -1030,10 +1074,12 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) #pragma warning disable CS0618 var runeCurrency = RuneHelper.DailyRewardRune; #pragma warning restore CS0618 - var prevRuneBalance = ev.PreviousState.GetBalance( + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + var prevRuneBalance = inputState.GetBalance( dailyReward.avatarAddress, runeCurrency); - var outputRuneBalance = ev.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( dailyReward.avatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -1066,7 +1112,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } claimRaidReward) { var start = DateTimeOffset.UtcNow; - var sheets = ev.OutputState.GetSheets( + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(RuneSheet), @@ -1077,10 +1125,10 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) #pragma warning disable CS0618 var runeCurrency = RuneHelper.ToCurrency(runeType); #pragma warning restore CS0618 - var prevRuneBalance = ev.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( claimRaidReward.AvatarAddress, runeCurrency); - var outputRuneBalance = ev.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( claimRaidReward.AvatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -1118,9 +1166,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } unlockRuneSlot) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _unlockRuneSlotList.Add(UnlockRuneSlotData.GetUnlockRuneSlotInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, unlockRuneSlot.AvatarAddress, unlockRuneSlot.SlotIndex, @@ -1145,9 +1195,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } rapidCombination) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _rapidCombinationList.Add(RapidCombinationData.GetRapidCombinationInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, rapidCombination.avatarAddress, rapidCombination.slotIndex, @@ -1171,7 +1223,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) { if (ev.Exception is null) { - var sheets = ev.OutputState.GetSheets( + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(CharacterSheet), @@ -1187,10 +1241,10 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) #pragma warning disable CS0618 var runeCurrency = RuneHelper.ToCurrency(runeType); #pragma warning restore CS0618 - var prevRuneBalance = ev.PreviousState.GetBalance( + var prevRuneBalance = inputState.GetBalance( ev.Action.AvatarAddress, runeCurrency); - var outputRuneBalance = ev.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( ev.Action.AvatarAddress, runeCurrency); var acquiredRune = outputRuneBalance - prevRuneBalance; @@ -1210,13 +1264,13 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) } } - _avatarList.Add(AvatarData.GetAvatarInfo(ev.OutputState, ev.Signer, ev.Action.AvatarAddress, ev.Action.RuneInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, ev.Action.AvatarAddress, ev.Action.RuneInfos, _blockTimeOffset)); int raidId = 0; bool found = false; for (int i = 0; i < 99; i++) { - if (ev.OutputState.Delta.UpdatedAddresses.Contains( + if (outputState.Delta.UpdatedAddresses.Contains( Addresses.GetRaiderAddress(ev.Action.AvatarAddress, i))) { raidId = i; @@ -1228,7 +1282,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (found) { RaiderState raiderState = - ev.OutputState.GetRaiderState(ev.Action.AvatarAddress, raidId); + outputState.GetRaiderState(ev.Action.AvatarAddress, raidId); var model = new RaiderModel( raidId, raiderState.AvatarName, @@ -1261,9 +1315,11 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) if (ev.Exception == null && ev.Action is { } petEnhancement) { var start = DateTimeOffset.UtcNow; + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); _petEnhancementList.Add(PetEnhancementData.GetPetEnhancementInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, petEnhancement.AvatarAddress, petEnhancement.PetId, @@ -1288,11 +1344,13 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) { if (ev.Action is { } auraSummon) { + var inputState = new Account(_blockChainStates.GetAccountState(ev.PreviousState)); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); if (ev.Exception is null) { _auraSummonList.Add(AuraSummonData.GetAuraSummonInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, auraSummon.AvatarAddress, auraSummon.GroupId, @@ -1304,8 +1362,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) else { _auraSummonFailList.Add(AuraSummonData.GetAuraSummonFailInfo( - ev.PreviousState, - ev.OutputState, + inputState, + outputState, ev.Signer, auraSummon.AvatarAddress, auraSummon.GroupId, @@ -1386,7 +1444,8 @@ private void ProcessAgentAvatarData(ActionEvaluation ev) if (ev.Signer != _miner) { - var agentState = ev.OutputState.GetAgentState(ev.Signer); + var outputState = new Account(_blockChainStates.GetAccountState(ev.OutputState)); + var agentState = outputState.GetAgentState(ev.Signer); if (agentState is { } ag) { var avatarAddresses = ag.avatarAddresses; @@ -1397,11 +1456,11 @@ private void ProcessAgentAvatarData(ActionEvaluation ev) AvatarState avatarState; try { - avatarState = ev.OutputState.GetAvatarStateV2(avatarAddress); + avatarState = outputState.GetAvatarStateV2(avatarAddress); } catch (Exception) { - avatarState = ev.OutputState.GetAvatarState(address: avatarAddress); + avatarState = outputState.GetAvatarState(address: avatarAddress); } if (avatarState == null) @@ -1410,12 +1469,12 @@ private void ProcessAgentAvatarData(ActionEvaluation ev) } var runeSlotStateAddress = RuneSlotState.DeriveAddress(avatarAddress, BattleType.Adventure); - var runeSlotState = ev.OutputState.TryGetState(runeSlotStateAddress, out List rawRuneSlotState) + var runeSlotState = outputState.TryGetState(runeSlotStateAddress, out List rawRuneSlotState) ? new RuneSlotState(rawRuneSlotState) : new RuneSlotState(BattleType.Adventure); var runeSlotInfos = runeSlotState.GetEquippedRuneSlotInfos(); - _avatarList.Add(AvatarData.GetAvatarInfo(ev.OutputState, ev.Signer, avatarAddress, runeSlotInfos, _blockTimeOffset)); + _avatarList.Add(AvatarData.GetAvatarInfo(outputState, ev.Signer, avatarAddress, runeSlotInfos, _blockTimeOffset)); } catch (Exception ex) { From caa9e8f7b387ae792370f4c30c1ebda16b1b1852 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Tue, 17 Oct 2023 17:15:26 +0900 Subject: [PATCH 04/20] Update Program.cs --- NineChronicles.DataProvider.Executable/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NineChronicles.DataProvider.Executable/Program.cs b/NineChronicles.DataProvider.Executable/Program.cs index e5cff14f..8fae96df 100644 --- a/NineChronicles.DataProvider.Executable/Program.cs +++ b/NineChronicles.DataProvider.Executable/Program.cs @@ -137,7 +137,7 @@ public async Task Run() IActionLoader actionLoader = new NCActionLoader(); var nineChroniclesProperties = new NineChroniclesNodeServiceProperties( - actionLoader, headlessConfig.StateServiceManagerService) + actionLoader, headlessConfig.StateServiceManagerService, null) { MinerPrivateKey = string.IsNullOrEmpty(headlessConfig.MinerPrivateKeyString) ? null @@ -159,6 +159,7 @@ public async Task Run() context.NineChroniclesNodeService!.ActionRenderer, context.NineChroniclesNodeService!.ExceptionRenderer, context.NineChroniclesNodeService!.NodeStatusRenderer, + context.NineChroniclesNodeService!.BlockChain, IPAddress.Loopback.ToString(), 0, new RpcContext From 9aa4c9ea78c7df731fb04b0946d11029db58ef36 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Tue, 17 Oct 2023 17:54:08 +0900 Subject: [PATCH 05/20] UpdatedAddresses workaround --- .../Commands/MySqlMigration.cs | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index da53b0f3..47431a1c 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -4477,10 +4477,13 @@ private void ProcessTasks(Task>[] taskArray, IB int raidId = 0; bool found = false; + var accountDiff = AccountDiff.Create(inputState, outputState); + var updatedAddresses = accountDiff.StateDiffs.Keys + .Union(accountDiff.FungibleAssetValueDiffs.Select(kv => kv.Key.Item1)) + .ToHashSet(); for (int i = 0; i < 99; i++) { - if (outputState.Delta.UpdatedAddresses.Contains( - Addresses.GetRaiderAddress(raid.AvatarAddress, i))) + if (updatedAddresses.Contains(Addresses.GetRaiderAddress(raid.AvatarAddress, i))) { raidId = i; found = true; @@ -4545,10 +4548,13 @@ private void ProcessTasks(Task>[] taskArray, IB int raidId = 0; bool found = false; + var accountDiff = AccountDiff.Create(inputState, outputState); + var updatedAddresses = accountDiff.StateDiffs.Keys + .Union(accountDiff.FungibleAssetValueDiffs.Select(kv => kv.Key.Item1)) + .ToHashSet(); for (int i = 0; i < 99; i++) { - if (outputState.Delta.UpdatedAddresses.Contains( - Addresses.GetRaiderAddress(raid4.AvatarAddress, i))) + if (updatedAddresses.Contains(Addresses.GetRaiderAddress(raid4.AvatarAddress, i))) { raidId = i; found = true; @@ -4613,10 +4619,13 @@ private void ProcessTasks(Task>[] taskArray, IB int raidId = 0; bool found = false; + var accountDiff = AccountDiff.Create(inputState, outputState); + var updatedAddresses = accountDiff.StateDiffs.Keys + .Union(accountDiff.FungibleAssetValueDiffs.Select(kv => kv.Key.Item1)) + .ToHashSet(); for (int i = 0; i < 99; i++) { - if (outputState.Delta.UpdatedAddresses.Contains( - Addresses.GetRaiderAddress(raid3.AvatarAddress, i))) + if (updatedAddresses.Contains(Addresses.GetRaiderAddress(raid3.AvatarAddress, i))) { raidId = i; found = true; @@ -4681,10 +4690,13 @@ private void ProcessTasks(Task>[] taskArray, IB int raidId = 0; bool found = false; + var accountDiff = AccountDiff.Create(inputState, outputState); + var updatedAddresses = accountDiff.StateDiffs.Keys + .Union(accountDiff.FungibleAssetValueDiffs.Select(kv => kv.Key.Item1)) + .ToHashSet(); for (int i = 0; i < 99; i++) { - if (outputState.Delta.UpdatedAddresses.Contains( - Addresses.GetRaiderAddress(raid2.AvatarAddress, i))) + if (updatedAddresses.Contains(Addresses.GetRaiderAddress(raid2.AvatarAddress, i))) { raidId = i; found = true; @@ -4749,10 +4761,13 @@ private void ProcessTasks(Task>[] taskArray, IB int raidId = 0; bool found = false; + var accountDiff = AccountDiff.Create(inputState, outputState); + var updatedAddresses = accountDiff.StateDiffs.Keys + .Union(accountDiff.FungibleAssetValueDiffs.Select(kv => kv.Key.Item1)) + .ToHashSet(); for (int i = 0; i < 99; i++) { - if (outputState.Delta.UpdatedAddresses.Contains( - Addresses.GetRaiderAddress(raid1.AvatarAddress, i))) + if (updatedAddresses.Contains(Addresses.GetRaiderAddress(raid1.AvatarAddress, i))) { raidId = i; found = true; From 4e01f3bd55b5541ff155f3cfd5aea797673461a9 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Tue, 17 Oct 2023 17:58:45 +0900 Subject: [PATCH 06/20] Rebase fix --- .../Commands/UserDataMigration.cs | 81 ++++++++++--------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs b/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs index 7a437e33..209ca275 100644 --- a/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/UserDataMigration.cs @@ -8,6 +8,7 @@ using Cocona; using Lib9c.Model.Order; using Libplanet.Action; + using Libplanet.Action.State; using Libplanet.Blockchain; using Libplanet.Blockchain.Policies; using Libplanet.Crypto; @@ -179,7 +180,7 @@ string mysqlDatabase var blockChainStates = new BlockChainStates(_baseStore, baseStateStore); var actionEvaluator = new ActionEvaluator( _ => blockPolicy.BlockAction, - blockChainStates, + baseStateStore, new NCActionLoader()); _baseChain = new BlockChain(blockPolicy, stagePolicy, _baseStore, baseStateStore, genesis, blockChainStates, actionEvaluator); @@ -237,16 +238,17 @@ string mysqlDatabase var tip = _baseStore.GetBlock((BlockHash)tipHash); var exec = _baseChain.EvaluateBlock(tip); var ev = exec.Last(); + var outputState = new Account(blockChainStates.GetAccountState(ev.OutputState)); var avatarCount = 0; AvatarState avatarState; int interval = 10000000; int intervalCount = 0; - var sheets = ev.OutputState.GetSheets( + var sheets = outputState.GetSheets( sheetTypes: new[] { typeof(RuneSheet), }); - var arenaSheet = ev.OutputState.GetSheet(); + var arenaSheet = outputState.GetSheet(); var arenaData = arenaSheet.GetRoundByBlockIndex(tip.Index); _barDbName = $"{_barDbName}_{arenaData.ChampionshipId}_{arenaData.Round}"; @@ -320,7 +322,8 @@ string mysqlDatabase var fbTip = _baseStore.GetBlock((BlockHash)fbTipHash!); var fbExec = _baseChain.EvaluateBlock(fbTip); var fbEv = fbExec.Last(); - var fbArenaSheet = fbEv.OutputState.GetSheet(); + var fbOutputState = new Account(blockChainStates.GetAccountState(fbEv.OutputState)); + var fbArenaSheet = fbOutputState.GetSheet(); var fbArenaData = fbArenaSheet.GetRoundByBlockIndex(fbTip.Index); List fbAgents = new List(); var fbavatarCount = 0; @@ -338,13 +341,13 @@ string mysqlDatabase var fbAvatarAddress = new Address(fbAvatar); try { - fbAvatarState = fbEv.OutputState.GetAvatarStateV2(fbAvatarAddress); + fbAvatarState = fbOutputState.GetAvatarStateV2(fbAvatarAddress); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); - fbAvatarState = fbEv.OutputState.GetAvatarState(fbAvatarAddress); + fbAvatarState = fbOutputState.GetAvatarState(fbAvatarAddress); } var fbAvatarLevel = fbAvatarState.level; @@ -353,8 +356,8 @@ string mysqlDatabase ArenaScore.DeriveAddress(fbAvatarAddress, fbArenaData.ChampionshipId, fbArenaData.Round); var fbArenaInformationAdr = ArenaInformation.DeriveAddress(fbAvatarAddress, fbArenaData.ChampionshipId, fbArenaData.Round); - fbEv.OutputState.TryGetArenaInformation(fbArenaInformationAdr, out var fbCurrentArenaInformation); - fbEv.OutputState.TryGetArenaScore(fbArenaScoreAdr, out var fbOutputArenaScore); + fbOutputState.TryGetArenaInformation(fbArenaInformationAdr, out var fbCurrentArenaInformation); + fbOutputState.TryGetArenaScore(fbArenaScoreAdr, out var fbOutputArenaScore); if (fbCurrentArenaInformation != null && fbOutputArenaScore != null) { _fbBarBulkFile.WriteLine( @@ -387,11 +390,11 @@ string mysqlDatabase { fbAgents.Add(fbAvatarState.agentAddress.ToString()); - if (fbEv.OutputState.TryGetStakeStateV2(fbAvatarState.agentAddress, out StakeStateV2 fbStakeState2)) + if (fbOutputState.TryGetStakeStateV2(fbAvatarState.agentAddress, out StakeStateV2 fbStakeState2)) { var fbStakeStateAddress = StakeStateV2.DeriveAddress(fbAvatarState.agentAddress); - var fbCurrency = fbEv.OutputState.GetGoldCurrency(); - var fbStakedBalance = fbEv.OutputState.GetBalance(fbStakeStateAddress, fbCurrency); + var fbCurrency = fbOutputState.GetGoldCurrency(); + var fbStakedBalance = fbOutputState.GetBalance(fbStakeStateAddress, fbCurrency); _fbUsBulkFile.WriteLine( $"{fbTip.Index};" + "V3;" + @@ -403,11 +406,11 @@ string mysqlDatabase ); } - if (fbEv.OutputState.TryGetStakeState(fbAvatarState.agentAddress, out StakeState fbStakeState)) + if (fbOutputState.TryGetStakeState(fbAvatarState.agentAddress, out StakeState fbStakeState)) { var fbStakeStateAddress = StakeState.DeriveAddress(fbAvatarState.agentAddress); - var fbCurrency = fbEv.OutputState.GetGoldCurrency(); - var fbStakedBalance = fbEv.OutputState.GetBalance(fbStakeStateAddress, fbCurrency); + var fbCurrency = fbOutputState.GetGoldCurrency(); + var fbStakedBalance = fbOutputState.GetBalance(fbStakeStateAddress, fbCurrency); _fbUsBulkFile.WriteLine( $"{fbTip.Index};" + "V2;" + @@ -419,17 +422,17 @@ string mysqlDatabase ); } - var fbAgentState = fbEv.OutputState.GetAgentState(fbAvatarState.agentAddress); + var fbAgentState = fbOutputState.GetAgentState(fbAvatarState.agentAddress); Address fbMonsterCollectionAddress = MonsterCollectionState.DeriveAddress( fbAvatarState.agentAddress, fbAgentState.MonsterCollectionRound ); - if (fbEv.OutputState.TryGetState(fbMonsterCollectionAddress, out Dictionary fbStateDict)) + if (fbOutputState.TryGetState(fbMonsterCollectionAddress, out Dictionary fbStateDict)) { var fbMonsterCollectionStates = new MonsterCollectionState(fbStateDict); - var fbCurrency = fbEv.OutputState.GetGoldCurrency(); + var fbCurrency = fbOutputState.GetGoldCurrency(); FungibleAssetValue fbMonsterCollectionBalance = - fbEv.OutputState.GetBalance(fbMonsterCollectionAddress, fbCurrency); + fbOutputState.GetBalance(fbMonsterCollectionAddress, fbCurrency); _fbUsBulkFile.WriteLine( $"{fbTip.Index};" + "V1;" + @@ -519,13 +522,13 @@ string mysqlDatabase var avatarAddress = new Address(avatar); try { - avatarState = ev.OutputState.GetAvatarStateV2(avatarAddress); + avatarState = outputState.GetAvatarStateV2(avatarAddress); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); - avatarState = ev.OutputState.GetAvatarState(avatarAddress); + avatarState = outputState.GetAvatarState(avatarAddress); } var avatarLevel = avatarState.level; @@ -536,7 +539,7 @@ string mysqlDatabase #pragma warning disable CS0618 var runeCurrency = Currency.Legacy(runeType.Ticker, 0, minters: null); #pragma warning restore CS0618 - var outputRuneBalance = ev.OutputState.GetBalance( + var outputRuneBalance = outputState.GetBalance( avatarAddress, runeCurrency); if (Convert.ToDecimal(outputRuneBalance.GetQuantityString()) > 0) @@ -556,8 +559,8 @@ string mysqlDatabase ArenaScore.DeriveAddress(avatarAddress, arenaData.ChampionshipId, arenaData.Round); var arenaInformationAdr = ArenaInformation.DeriveAddress(avatarAddress, arenaData.ChampionshipId, arenaData.Round); - ev.OutputState.TryGetArenaInformation(arenaInformationAdr, out var currentArenaInformation); - ev.OutputState.TryGetArenaScore(arenaScoreAdr, out var outputArenaScore); + outputState.TryGetArenaInformation(arenaInformationAdr, out var currentArenaInformation); + outputState.TryGetArenaScore(arenaScoreAdr, out var outputArenaScore); if (currentArenaInformation != null && outputArenaScore != null) { _barBulkFile.WriteLine( @@ -587,14 +590,14 @@ string mysqlDatabase } Address orderReceiptAddress = OrderDigestListState.DeriveAddress(avatarAddress); - var orderReceiptList = ev.OutputState.TryGetState(orderReceiptAddress, out Dictionary receiptDict) + var orderReceiptList = outputState.TryGetState(orderReceiptAddress, out Dictionary receiptDict) ? new OrderDigestListState(receiptDict) : new OrderDigestListState(orderReceiptAddress); foreach (var orderReceipt in orderReceiptList.OrderDigestList) { if (orderReceipt.ExpiredBlockIndex >= tip.Index) { - var state = ev.OutputState.GetState( + var state = outputState.GetState( Addresses.GetItemAddress(orderReceipt.TradableId)); ITradableItem orderItem = (ITradableItem)ItemFactory.Deserialize((Dictionary)state); @@ -723,7 +726,7 @@ string mysqlDatabase var userEquipments = avatarState.inventory.Equipments; var userCostumes = avatarState.inventory.Costumes; var userMaterials = avatarState.inventory.Materials; - var materialItemSheet = ev.OutputState.GetSheet(); + var materialItemSheet = outputState.GetSheet(); var hourglassRow = materialItemSheet .First(pair => pair.Value.ItemSubType == ItemSubType.Hourglass) .Value; @@ -785,8 +788,8 @@ string mysqlDatabase if (!agents.Contains(avatarState.agentAddress.ToString())) { agents.Add(avatarState.agentAddress.ToString()); - Currency ncgCurrency = ev.OutputState.GetGoldCurrency(); - var ncgBalance = ev.OutputState.GetBalance( + Currency ncgCurrency = outputState.GetGoldCurrency(); + var ncgBalance = outputState.GetBalance( avatarState.agentAddress, ncgCurrency); _uncgBulkFile.WriteLine( @@ -795,7 +798,7 @@ string mysqlDatabase $"{Convert.ToDecimal(ncgBalance.GetQuantityString())}" ); Currency crystalCurrency = CrystalCalculator.CRYSTAL; - var crystalBalance = ev.OutputState.GetBalance( + var crystalBalance = outputState.GetBalance( avatarState.agentAddress, crystalCurrency); _ucyBulkFile.WriteLine( @@ -803,16 +806,16 @@ string mysqlDatabase $"{avatarState.agentAddress.ToString()};" + $"{Convert.ToDecimal(crystalBalance.GetQuantityString())}" ); - var agentState = ev.OutputState.GetAgentState(avatarState.agentAddress); + var agentState = outputState.GetAgentState(avatarState.agentAddress); Address monsterCollectionAddress = MonsterCollectionState.DeriveAddress( avatarState.agentAddress, agentState.MonsterCollectionRound ); - if (ev.OutputState.TryGetState(monsterCollectionAddress, out Dictionary stateDict)) + if (outputState.TryGetState(monsterCollectionAddress, out Dictionary stateDict)) { var mcStates = new MonsterCollectionState(stateDict); - var currency = ev.OutputState.GetGoldCurrency(); - FungibleAssetValue mcBalance = ev.OutputState.GetBalance(monsterCollectionAddress, currency); + var currency = outputState.GetGoldCurrency(); + FungibleAssetValue mcBalance = outputState.GetBalance(monsterCollectionAddress, currency); _umcBulkFile.WriteLine( $"{tip.Index};" + $"{avatarState.agentAddress.ToString()};" + @@ -825,11 +828,11 @@ string mysqlDatabase ); } - if (ev.OutputState.TryGetStakeState(avatarState.agentAddress, out StakeState stakeState)) + if (outputState.TryGetStakeState(avatarState.agentAddress, out StakeState stakeState)) { var stakeStateAddress = StakeState.DeriveAddress(avatarState.agentAddress); - var currency = ev.OutputState.GetGoldCurrency(); - var stakedBalance = ev.OutputState.GetBalance(stakeStateAddress, currency); + var currency = outputState.GetGoldCurrency(); + var stakedBalance = outputState.GetBalance(stakeStateAddress, currency); _usBulkFile.WriteLine( $"{tip.Index};" + $"{avatarState.agentAddress.ToString()};" + @@ -841,11 +844,11 @@ string mysqlDatabase } else { - if (ev.OutputState.TryGetStakeStateV2(avatarState.agentAddress, out StakeStateV2 stakeState2)) + if (outputState.TryGetStakeStateV2(avatarState.agentAddress, out StakeStateV2 stakeState2)) { var stakeStateAddress = StakeStateV2.DeriveAddress(avatarState.agentAddress); - var currency = ev.OutputState.GetGoldCurrency(); - var stakedBalance = ev.OutputState.GetBalance(stakeStateAddress, currency); + var currency = outputState.GetGoldCurrency(); + var stakedBalance = outputState.GetBalance(stakeStateAddress, currency); _usBulkFile.WriteLine( $"{tip.Index};" + $"{avatarState.agentAddress.ToString()};" + From 07df03c0c105935b5ac0c834c25b9f6526d1366f Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 17 Oct 2023 22:15:54 +0900 Subject: [PATCH 07/20] Add item enhancement result --- ...25653_AddItemEnhancementResult.Designer.cs | 2829 +++++++++++++++++ ...20231017125653_AddItemEnhancementResult.cs | 45 + .../NineChroniclesContextModelSnapshot.cs | 9 + .../DataRendering/itemEnhancementData.cs | 10 +- .../Store/Models/ItemEnhancementModel.cs | 7 +- 5 files changed, 2897 insertions(+), 3 deletions(-) create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20231017125653_AddItemEnhancementResult.Designer.cs create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20231017125653_AddItemEnhancementResult.cs diff --git a/NineChronicles.DataProvider.Executable/Migrations/20231017125653_AddItemEnhancementResult.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20231017125653_AddItemEnhancementResult.Designer.cs new file mode 100644 index 00000000..450e634e --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20231017125653_AddItemEnhancementResult.Designer.cs @@ -0,0 +1,2829 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using NineChronicles.DataProvider.Store; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + [DbContext(typeof(NineChroniclesContext))] + [Migration("20231017125653_AddItemEnhancementResult")] + partial class AddItemEnhancementResult + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AbilityRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("AbilityRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AgentModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.HasKey("Address"); + + b.ToTable("Agents"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AuraSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AuraSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.HasKey("Address"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Avatars"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("EnemyAvatarAddress") + .HasColumnType("longtext"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("TicketCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("BattleArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaRankingModel", b => + { + b.Property("AdditionalTicketPrice") + .HasColumnType("bigint"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArenaType") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("EntranceFee") + .HasColumnType("bigint"); + + b.Property("LossCount") + .HasColumnType("int"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PurchasedTicketCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("RequiredMedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Ticket") + .HasColumnType("int"); + + b.Property("TicketPrice") + .HasColumnType("bigint"); + + b.Property("TicketResetCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.Property("WinCount") + .HasColumnType("int"); + + b.ToTable("BattleArenaRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EnemyAvatarAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("GrandFinaleId") + .HasColumnType("int"); + + b.Property("GrandFinaleScore") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("BattleGrandFinales"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BlockModel", b => + { + b.Property("Hash") + .HasColumnType("varchar(255)"); + + b.Property("Difficulty") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("Miner") + .HasColumnType("longtext"); + + b.Property("Nonce") + .HasColumnType("longtext"); + + b.Property("PreviousHash") + .HasColumnType("longtext"); + + b.Property("ProtocolVersion") + .HasColumnType("int"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("StateRootHash") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalDifficulty") + .HasColumnType("bigint"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.Property("TxHash") + .HasColumnType("longtext"); + + b.HasKey("Hash"); + + b.ToTable("Blocks"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApPotionCount") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimRewardAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ClaimStakeEndBlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("HourGlassCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.ToTable("ClaimStakeRewards"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CombinationConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("SubRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CombinationEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingInputModel", b => + { + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.HasKey("AvatarAddress"); + + b.ToTable("CraftRankings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingOutputModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("CraftRankingsOutput"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.HasKey("ItemId"); + + b.ToTable("Equipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("EventConsumableItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("RequiredItem1Count") + .HasColumnType("int"); + + b.Property("RequiredItem1Id") + .HasColumnType("int"); + + b.Property("RequiredItem2Count") + .HasColumnType("int"); + + b.Property("RequiredItem2Id") + .HasColumnType("int"); + + b.Property("RequiredItem3Count") + .HasColumnType("int"); + + b.Property("RequiredItem3Id") + .HasColumnType("int"); + + b.Property("RequiredItem4Count") + .HasColumnType("int"); + + b.Property("RequiredItem4Id") + .HasColumnType("int"); + + b.Property("RequiredItem5Count") + .HasColumnType("int"); + + b.Property("RequiredItem5Id") + .HasColumnType("int"); + + b.Property("RequiredItem6Count") + .HasColumnType("int"); + + b.Property("RequiredItem6Id") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventConsumableItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("EventDungeonId") + .HasColumnType("int"); + + b.Property("EventDungeonStageId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("FoodsCount") + .HasColumnType("int"); + + b.Property("RemainingTickets") + .HasColumnType("int"); + + b.Property("RewardItem10Count") + .HasColumnType("int"); + + b.Property("RewardItem10Id") + .HasColumnType("int"); + + b.Property("RewardItem1Count") + .HasColumnType("int"); + + b.Property("RewardItem1Id") + .HasColumnType("int"); + + b.Property("RewardItem2Count") + .HasColumnType("int"); + + b.Property("RewardItem2Id") + .HasColumnType("int"); + + b.Property("RewardItem3Count") + .HasColumnType("int"); + + b.Property("RewardItem3Id") + .HasColumnType("int"); + + b.Property("RewardItem4Count") + .HasColumnType("int"); + + b.Property("RewardItem4Id") + .HasColumnType("int"); + + b.Property("RewardItem5Count") + .HasColumnType("int"); + + b.Property("RewardItem5Id") + .HasColumnType("int"); + + b.Property("RewardItem6Count") + .HasColumnType("int"); + + b.Property("RewardItem6Id") + .HasColumnType("int"); + + b.Property("RewardItem7Count") + .HasColumnType("int"); + + b.Property("RewardItem7Id") + .HasColumnType("int"); + + b.Property("RewardItem8Count") + .HasColumnType("int"); + + b.Property("RewardItem8Id") + .HasColumnType("int"); + + b.Property("RewardItem9Count") + .HasColumnType("int"); + + b.Property("RewardItem9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventDungeonBattles"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EventMaterialItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("Material10Count") + .HasColumnType("int"); + + b.Property("Material10Id") + .HasColumnType("int"); + + b.Property("Material11Count") + .HasColumnType("int"); + + b.Property("Material11Id") + .HasColumnType("int"); + + b.Property("Material12Count") + .HasColumnType("int"); + + b.Property("Material12Id") + .HasColumnType("int"); + + b.Property("Material1Count") + .HasColumnType("int"); + + b.Property("Material1Id") + .HasColumnType("int"); + + b.Property("Material2Count") + .HasColumnType("int"); + + b.Property("Material2Id") + .HasColumnType("int"); + + b.Property("Material3Count") + .HasColumnType("int"); + + b.Property("Material3Id") + .HasColumnType("int"); + + b.Property("Material4Count") + .HasColumnType("int"); + + b.Property("Material4Id") + .HasColumnType("int"); + + b.Property("Material5Count") + .HasColumnType("int"); + + b.Property("Material5Id") + .HasColumnType("int"); + + b.Property("Material6Count") + .HasColumnType("int"); + + b.Property("Material6Id") + .HasColumnType("int"); + + b.Property("Material7Count") + .HasColumnType("int"); + + b.Property("Material7Id") + .HasColumnType("int"); + + b.Property("Material8Count") + .HasColumnType("int"); + + b.Property("Material8Id") + .HasColumnType("int"); + + b.Property("Material9Count") + .HasColumnType("int"); + + b.Property("Material9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventMaterialItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Crystal") + .HasColumnType("decimal(65,30)"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("Grindings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HackAndSlashes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionPoint") + .HasColumnType("int"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApStoneCount") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("WorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HackAndSlashSweeps"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("GachaCount") + .HasColumnType("int"); + + b.Property("HasStageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HasRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffId") + .HasColumnType("int"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HasWithRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("GainedCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("MaterialItemId") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancementFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Exp") + .HasColumnType("bigint"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MaterialId") + .HasColumnType("longtext"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("SheetId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArenaRound") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("JoinArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("MigrationAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("MigrationStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("MigrateMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntSoulStone") + .HasColumnType("decimal(65,30)"); + + b.Property("ChangedLevel") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputPetLevel") + .HasColumnType("int"); + + b.Property("PetId") + .HasColumnType("int"); + + b.Property("PreviousPetLevel") + .HasColumnType("int"); + + b.Property("TargetLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("PetEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RaiderModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Address") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("PurchaseCount") + .HasColumnType("int"); + + b.Property("RaidId") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("RaidId", "Address") + .IsUnique(); + + b.ToTable("Raiders"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourglassCount") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("RapidCombinations"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ReplacedMaterialCount") + .HasColumnType("int"); + + b.Property("ReplacedMaterialId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ReplaceCombinationEquipmentMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RequestPledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PledgeAgentAddress") + .HasColumnType("longtext"); + + b.Property("RefillMead") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxSigner") + .HasColumnType("longtext"); + + b.HasKey("TxId"); + + b.ToTable("RequestPledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntRune") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("OutputRuneLevel") + .HasColumnType("int"); + + b.Property("PreviousRuneLevel") + .HasColumnType("int"); + + b.Property("RuneId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("RuneEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("TickerType") + .HasColumnType("varchar(255)"); + + b.Property("AcquiredRune") + .HasColumnType("decimal(65,30)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id", "ActionType", "TickerType"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Id", "ActionType", "TickerType") + .IsUnique(); + + b.ToTable("RunesAcquired"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopConsumableModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopCostumeModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopEquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryConsumableModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryCostumeModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryEquipmentModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryFungibleAssetValueModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("Quantity") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryFungibleAssetValues"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryMaterialModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopMaterialModel", b => + { + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.ToTable("ShopMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StageRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClearedStageId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("StageRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("NewAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("NewStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PrevStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PreviousAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("RemainingNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Stakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransactionModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("longtext"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Nonce") + .HasColumnType("bigint"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedAddressesCount") + .HasColumnType("int"); + + b.HasKey("TxId"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransferAssetModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Recipient") + .HasColumnType("longtext"); + + b.Property("Sender") + .HasColumnType("longtext"); + + b.Property("TickerType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("TransferAssets"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockEquipmentRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockEquipmentRecipes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockRuneSlots"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockWorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockWorlds"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossRankingModel", b => + { + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("AvatarName") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.ToTable("WorldBossRankings", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossSeasonMigrationModel", b => + { + b.Property("RaidId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("MigratedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("RaidId"); + + b.HasIndex("RaidId") + .IsUnique(); + + b.ToTable("WorldBossSeasonMigrationModels"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/20231017125653_AddItemEnhancementResult.cs b/NineChronicles.DataProvider.Executable/Migrations/20231017125653_AddItemEnhancementResult.cs new file mode 100644 index 00000000..44a2d715 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20231017125653_AddItemEnhancementResult.cs @@ -0,0 +1,45 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + public partial class AddItemEnhancementResult : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Exp", + table: "ItemEnhancements", + type: "bigint", + nullable: true); + + migrationBuilder.AddColumn( + name: "Level", + table: "ItemEnhancements", + type: "int", + nullable: true); + + migrationBuilder.AddColumn( + name: "SheetId", + table: "ItemEnhancements", + type: "int", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Exp", + table: "ItemEnhancements"); + + migrationBuilder.DropColumn( + name: "Level", + table: "ItemEnhancements"); + + migrationBuilder.DropColumn( + name: "SheetId", + table: "ItemEnhancements"); + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs index b8aa0cff..36de3aea 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs @@ -1148,15 +1148,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BurntNCG") .HasColumnType("decimal(65,30)"); + b.Property("Exp") + .HasColumnType("bigint"); + b.Property("ItemId") .HasColumnType("longtext"); + b.Property("Level") + .HasColumnType("int"); + b.Property("MaterialId") .HasColumnType("longtext"); b.Property("MaterialIdsCount") .HasColumnType("int"); + b.Property("SheetId") + .HasColumnType("int"); + b.Property("SlotIndex") .HasColumnType("int"); diff --git a/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs b/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs index 0308a564..9088adf1 100644 --- a/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs +++ b/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs @@ -33,7 +33,10 @@ long blockIndex ncgCurrency); var burntNCG = prevNCGBalance - outputNCGBalance; - var itemenhancementModel = new ItemEnhancementModel() + var equipment = outputStates.GetAvatarState(avatarAddress).inventory.Equipments + .First(e => e.ItemId == itemId); + + var itemEnhancementModel = new ItemEnhancementModel() { Id = actionId.ToString(), AgentAddress = signer.ToString(), @@ -44,9 +47,12 @@ long blockIndex SlotIndex = slotIndex, BurntNCG = Convert.ToDecimal(burntNCG.GetQuantityString()), BlockIndex = blockIndex, + SheetId = equipment.Id, + Level = equipment.level, + Exp = equipment.Exp, }; - return itemenhancementModel; + return itemEnhancementModel; } } } diff --git a/NineChronicles.DataProvider/Store/Models/ItemEnhancementModel.cs b/NineChronicles.DataProvider/Store/Models/ItemEnhancementModel.cs index b978f1d1..fcc809ed 100644 --- a/NineChronicles.DataProvider/Store/Models/ItemEnhancementModel.cs +++ b/NineChronicles.DataProvider/Store/Models/ItemEnhancementModel.cs @@ -1,6 +1,5 @@ namespace NineChronicles.DataProvider.Store.Models { - using System.Collections.Generic; using System.ComponentModel.DataAnnotations; public class ItemEnhancementModel @@ -27,5 +26,11 @@ public class ItemEnhancementModel public decimal BurntNCG { get; set; } public long BlockIndex { get; set; } + + public int? SheetId { get; set; } + + public int? Level { get; set; } + + public long? Exp { get; set; } } } From 432e8be11754335af7a7797ee39cea151f3464af Mon Sep 17 00:00:00 2001 From: Submodule Updater Date: Wed, 18 Oct 2023 01:44:07 +0000 Subject: [PATCH 08/20] Update NineChronicles.Headless submodule to planetarium/NineChronicles.Headless@ba9828361d22625a0b47c706c7cdf4a3b57b811a This commit was automatically generated by Submodule Updater. --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 41a28956..ba982836 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 41a289568e991046b0644505ffa2d3b66f343922 +Subproject commit ba9828361d22625a0b47c706c7cdf4a3b57b811a From 730b08db49711b9c7cd35c3b71fcddb952d73c2b Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Wed, 18 Oct 2023 10:59:43 +0900 Subject: [PATCH 09/20] Bump 9c-headless --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index 41a28956..ba982836 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit 41a289568e991046b0644505ffa2d3b66f343922 +Subproject commit ba9828361d22625a0b47c706c7cdf4a3b57b811a From d29ea874d3dfe9e8e32234184b04e431fd367038 Mon Sep 17 00:00:00 2001 From: area363 Date: Fri, 20 Oct 2023 16:21:41 +0900 Subject: [PATCH 10/20] add ranking tables --- .../Store/NineChroniclesContext.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs index 6423bc44..f1036cb9 100644 --- a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs +++ b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs @@ -42,6 +42,21 @@ public NineChroniclesContext(DbContextOptions options) // Table for ranking avatars' equipment combat points public DbSet? EquipmentRanking { get; set; } + // Table for ranking avatars' armor combat points + public DbSet? EquipmentRankingArmor { get; set; } + + // Table for ranking avatars' belt combat points + public DbSet? EquipmentRankingBelt { get; set; } + + // Table for ranking avatars' necklace combat points + public DbSet? EquipmentRankingNecklace { get; set; } + + // Table for ranking avatars' ring combat points + public DbSet? EquipmentRankingRing { get; set; } + + // Table for ranking avatars' weapon combat points + public DbSet? EquipmentRankingWeapon { get; set; } + // Table for ranking avatars' total combat points public DbSet? AbilityRanking { get; set; } From 0324d90200743ec2c4e6383fcb631544939ea45b Mon Sep 17 00:00:00 2001 From: "Kidon (Don) Seo" Date: Tue, 24 Oct 2023 09:59:33 +0900 Subject: [PATCH 11/20] Increase `maxRetryCount` from 10 to 20 To make sure no data is left out. --- NineChronicles.DataProvider.Executable/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.DataProvider.Executable/Program.cs b/NineChronicles.DataProvider.Executable/Program.cs index 8fae96df..ca68931f 100644 --- a/NineChronicles.DataProvider.Executable/Program.cs +++ b/NineChronicles.DataProvider.Executable/Program.cs @@ -198,7 +198,7 @@ public async Task Run() { mySqlOptions .EnableRetryOnFailure( - maxRetryCount: 10, + maxRetryCount: 20, maxRetryDelay: TimeSpan.FromSeconds(10), errorNumbersToAdd: null); } From 157b587405478c8982386043dc0b3996599e445e Mon Sep 17 00:00:00 2001 From: area363 Date: Tue, 31 Oct 2023 15:39:29 +0900 Subject: [PATCH 12/20] update equipment ranking models --- .../Models/EquipmentRankingArmorModel.cs | 32 +++++++++++++++++++ .../Store/Models/EquipmentRankingBeltModel.cs | 32 +++++++++++++++++++ .../Models/EquipmentRankingNecklaceModel.cs | 32 +++++++++++++++++++ .../Store/Models/EquipmentRankingRingModel.cs | 32 +++++++++++++++++++ .../Models/EquipmentRankingWeaponModel.cs | 32 +++++++++++++++++++ .../Store/NineChroniclesContext.cs | 15 ++++++--- 6 files changed, 170 insertions(+), 5 deletions(-) create mode 100644 NineChronicles.DataProvider/Store/Models/EquipmentRankingArmorModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/EquipmentRankingBeltModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/EquipmentRankingNecklaceModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/EquipmentRankingRingModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/EquipmentRankingWeaponModel.cs diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingArmorModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingArmorModel.cs new file mode 100644 index 00000000..b2f647ac --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingArmorModel.cs @@ -0,0 +1,32 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System.ComponentModel.DataAnnotations; + + public class EquipmentRankingArmorModel + { + [Key] + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public string? AvatarAddress { get; set; } + + public int EquipmentId { get; set; } + + public int Cp { get; set; } + + public int Level { get; set; } + + public string? ItemSubType { get; set; } + + public string? Name { get; set; } + + public int? AvatarLevel { get; set; } + + public int? TitleId { get; set; } + + public int? ArmorId { get; set; } + + public int Ranking { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingBeltModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingBeltModel.cs new file mode 100644 index 00000000..3d2afa67 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingBeltModel.cs @@ -0,0 +1,32 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System.ComponentModel.DataAnnotations; + + public class EquipmentRankingBeltModel + { + [Key] + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public string? AvatarAddress { get; set; } + + public int EquipmentId { get; set; } + + public int Cp { get; set; } + + public int Level { get; set; } + + public string? ItemSubType { get; set; } + + public string? Name { get; set; } + + public int? AvatarLevel { get; set; } + + public int? TitleId { get; set; } + + public int? ArmorId { get; set; } + + public int Ranking { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingNecklaceModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingNecklaceModel.cs new file mode 100644 index 00000000..a6527a7c --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingNecklaceModel.cs @@ -0,0 +1,32 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System.ComponentModel.DataAnnotations; + + public class EquipmentRankingNecklaceModel + { + [Key] + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public string? AvatarAddress { get; set; } + + public int EquipmentId { get; set; } + + public int Cp { get; set; } + + public int Level { get; set; } + + public string? ItemSubType { get; set; } + + public string? Name { get; set; } + + public int? AvatarLevel { get; set; } + + public int? TitleId { get; set; } + + public int? ArmorId { get; set; } + + public int Ranking { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingRingModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingRingModel.cs new file mode 100644 index 00000000..ce8f3932 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingRingModel.cs @@ -0,0 +1,32 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System.ComponentModel.DataAnnotations; + + public class EquipmentRankingRingModel + { + [Key] + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public string? AvatarAddress { get; set; } + + public int EquipmentId { get; set; } + + public int Cp { get; set; } + + public int Level { get; set; } + + public string? ItemSubType { get; set; } + + public string? Name { get; set; } + + public int? AvatarLevel { get; set; } + + public int? TitleId { get; set; } + + public int? ArmorId { get; set; } + + public int Ranking { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingWeaponModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingWeaponModel.cs new file mode 100644 index 00000000..f9c2a606 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingWeaponModel.cs @@ -0,0 +1,32 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System.ComponentModel.DataAnnotations; + + public class EquipmentRankingWeaponModel + { + [Key] + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public string? AvatarAddress { get; set; } + + public int EquipmentId { get; set; } + + public int Cp { get; set; } + + public int Level { get; set; } + + public string? ItemSubType { get; set; } + + public string? Name { get; set; } + + public int? AvatarLevel { get; set; } + + public int? TitleId { get; set; } + + public int? ArmorId { get; set; } + + public int Ranking { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs index f1036cb9..1bfb5fa1 100644 --- a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs +++ b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs @@ -43,19 +43,19 @@ public NineChroniclesContext(DbContextOptions options) public DbSet? EquipmentRanking { get; set; } // Table for ranking avatars' armor combat points - public DbSet? EquipmentRankingArmor { get; set; } + public DbSet? EquipmentRankingArmor { get; set; } // Table for ranking avatars' belt combat points - public DbSet? EquipmentRankingBelt { get; set; } + public DbSet? EquipmentRankingBelt { get; set; } // Table for ranking avatars' necklace combat points - public DbSet? EquipmentRankingNecklace { get; set; } + public DbSet? EquipmentRankingNecklace { get; set; } // Table for ranking avatars' ring combat points - public DbSet? EquipmentRankingRing { get; set; } + public DbSet? EquipmentRankingRing { get; set; } // Table for ranking avatars' weapon combat points - public DbSet? EquipmentRankingWeapon { get; set; } + public DbSet? EquipmentRankingWeapon { get; set; } // Table for ranking avatars' total combat points public DbSet? AbilityRanking { get; set; } @@ -190,6 +190,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); From f0a2b6c8cfac6ca8830dc049910cff61e7b5ea81 Mon Sep 17 00:00:00 2001 From: area363 Date: Tue, 31 Oct 2023 15:39:52 +0900 Subject: [PATCH 13/20] add migrations --- ...0231031063724_AddRankingTables.Designer.cs | 3034 +++++++++++++++++ .../20231031063724_AddRankingTables.cs | 165 + .../NineChroniclesContextModelSnapshot.cs | 205 ++ 3 files changed, 3404 insertions(+) create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20231031063724_AddRankingTables.Designer.cs create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20231031063724_AddRankingTables.cs diff --git a/NineChronicles.DataProvider.Executable/Migrations/20231031063724_AddRankingTables.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20231031063724_AddRankingTables.Designer.cs new file mode 100644 index 00000000..73716cac --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20231031063724_AddRankingTables.Designer.cs @@ -0,0 +1,3034 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using NineChronicles.DataProvider.Store; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + [DbContext(typeof(NineChroniclesContext))] + [Migration("20231031063724_AddRankingTables")] + partial class AddRankingTables + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AbilityRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("AbilityRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AgentModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.HasKey("Address"); + + b.ToTable("Agents"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AuraSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AuraSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.HasKey("Address"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Avatars"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("EnemyAvatarAddress") + .HasColumnType("longtext"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("TicketCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("BattleArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaRankingModel", b => + { + b.Property("AdditionalTicketPrice") + .HasColumnType("bigint"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArenaType") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("EntranceFee") + .HasColumnType("bigint"); + + b.Property("LossCount") + .HasColumnType("int"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PurchasedTicketCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("RequiredMedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Ticket") + .HasColumnType("int"); + + b.Property("TicketPrice") + .HasColumnType("bigint"); + + b.Property("TicketResetCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.Property("WinCount") + .HasColumnType("int"); + + b.ToTable("BattleArenaRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EnemyAvatarAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("GrandFinaleId") + .HasColumnType("int"); + + b.Property("GrandFinaleScore") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("BattleGrandFinales"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BlockModel", b => + { + b.Property("Hash") + .HasColumnType("varchar(255)"); + + b.Property("Difficulty") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("Miner") + .HasColumnType("longtext"); + + b.Property("Nonce") + .HasColumnType("longtext"); + + b.Property("PreviousHash") + .HasColumnType("longtext"); + + b.Property("ProtocolVersion") + .HasColumnType("int"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("StateRootHash") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalDifficulty") + .HasColumnType("bigint"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.Property("TxHash") + .HasColumnType("longtext"); + + b.HasKey("Hash"); + + b.ToTable("Blocks"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApPotionCount") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimRewardAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ClaimStakeEndBlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("HourGlassCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.ToTable("ClaimStakeRewards"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CombinationConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("SubRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CombinationEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingInputModel", b => + { + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.HasKey("AvatarAddress"); + + b.ToTable("CraftRankings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingOutputModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("CraftRankingsOutput"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.HasKey("ItemId"); + + b.ToTable("Equipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingArmorModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingArmor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingBeltModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingBelt"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingNecklaceModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingNecklace"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingRingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingRing"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingWeaponModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingWeapon"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("EventConsumableItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("RequiredItem1Count") + .HasColumnType("int"); + + b.Property("RequiredItem1Id") + .HasColumnType("int"); + + b.Property("RequiredItem2Count") + .HasColumnType("int"); + + b.Property("RequiredItem2Id") + .HasColumnType("int"); + + b.Property("RequiredItem3Count") + .HasColumnType("int"); + + b.Property("RequiredItem3Id") + .HasColumnType("int"); + + b.Property("RequiredItem4Count") + .HasColumnType("int"); + + b.Property("RequiredItem4Id") + .HasColumnType("int"); + + b.Property("RequiredItem5Count") + .HasColumnType("int"); + + b.Property("RequiredItem5Id") + .HasColumnType("int"); + + b.Property("RequiredItem6Count") + .HasColumnType("int"); + + b.Property("RequiredItem6Id") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventConsumableItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("EventDungeonId") + .HasColumnType("int"); + + b.Property("EventDungeonStageId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("FoodsCount") + .HasColumnType("int"); + + b.Property("RemainingTickets") + .HasColumnType("int"); + + b.Property("RewardItem10Count") + .HasColumnType("int"); + + b.Property("RewardItem10Id") + .HasColumnType("int"); + + b.Property("RewardItem1Count") + .HasColumnType("int"); + + b.Property("RewardItem1Id") + .HasColumnType("int"); + + b.Property("RewardItem2Count") + .HasColumnType("int"); + + b.Property("RewardItem2Id") + .HasColumnType("int"); + + b.Property("RewardItem3Count") + .HasColumnType("int"); + + b.Property("RewardItem3Id") + .HasColumnType("int"); + + b.Property("RewardItem4Count") + .HasColumnType("int"); + + b.Property("RewardItem4Id") + .HasColumnType("int"); + + b.Property("RewardItem5Count") + .HasColumnType("int"); + + b.Property("RewardItem5Id") + .HasColumnType("int"); + + b.Property("RewardItem6Count") + .HasColumnType("int"); + + b.Property("RewardItem6Id") + .HasColumnType("int"); + + b.Property("RewardItem7Count") + .HasColumnType("int"); + + b.Property("RewardItem7Id") + .HasColumnType("int"); + + b.Property("RewardItem8Count") + .HasColumnType("int"); + + b.Property("RewardItem8Id") + .HasColumnType("int"); + + b.Property("RewardItem9Count") + .HasColumnType("int"); + + b.Property("RewardItem9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventDungeonBattles"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EventMaterialItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("Material10Count") + .HasColumnType("int"); + + b.Property("Material10Id") + .HasColumnType("int"); + + b.Property("Material11Count") + .HasColumnType("int"); + + b.Property("Material11Id") + .HasColumnType("int"); + + b.Property("Material12Count") + .HasColumnType("int"); + + b.Property("Material12Id") + .HasColumnType("int"); + + b.Property("Material1Count") + .HasColumnType("int"); + + b.Property("Material1Id") + .HasColumnType("int"); + + b.Property("Material2Count") + .HasColumnType("int"); + + b.Property("Material2Id") + .HasColumnType("int"); + + b.Property("Material3Count") + .HasColumnType("int"); + + b.Property("Material3Id") + .HasColumnType("int"); + + b.Property("Material4Count") + .HasColumnType("int"); + + b.Property("Material4Id") + .HasColumnType("int"); + + b.Property("Material5Count") + .HasColumnType("int"); + + b.Property("Material5Id") + .HasColumnType("int"); + + b.Property("Material6Count") + .HasColumnType("int"); + + b.Property("Material6Id") + .HasColumnType("int"); + + b.Property("Material7Count") + .HasColumnType("int"); + + b.Property("Material7Id") + .HasColumnType("int"); + + b.Property("Material8Count") + .HasColumnType("int"); + + b.Property("Material8Id") + .HasColumnType("int"); + + b.Property("Material9Count") + .HasColumnType("int"); + + b.Property("Material9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventMaterialItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Crystal") + .HasColumnType("decimal(65,30)"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("Grindings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HackAndSlashes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionPoint") + .HasColumnType("int"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApStoneCount") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("WorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HackAndSlashSweeps"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("GachaCount") + .HasColumnType("int"); + + b.Property("HasStageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HasRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffId") + .HasColumnType("int"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HasWithRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("GainedCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("MaterialItemId") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancementFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Exp") + .HasColumnType("bigint"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MaterialId") + .HasColumnType("longtext"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("SheetId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArenaRound") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("JoinArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("MigrationAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("MigrationStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("MigrateMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntSoulStone") + .HasColumnType("decimal(65,30)"); + + b.Property("ChangedLevel") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputPetLevel") + .HasColumnType("int"); + + b.Property("PetId") + .HasColumnType("int"); + + b.Property("PreviousPetLevel") + .HasColumnType("int"); + + b.Property("TargetLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("PetEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RaiderModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Address") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("PurchaseCount") + .HasColumnType("int"); + + b.Property("RaidId") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("RaidId", "Address") + .IsUnique(); + + b.ToTable("Raiders"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourglassCount") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("RapidCombinations"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ReplacedMaterialCount") + .HasColumnType("int"); + + b.Property("ReplacedMaterialId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ReplaceCombinationEquipmentMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RequestPledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PledgeAgentAddress") + .HasColumnType("longtext"); + + b.Property("RefillMead") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxSigner") + .HasColumnType("longtext"); + + b.HasKey("TxId"); + + b.ToTable("RequestPledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntRune") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("OutputRuneLevel") + .HasColumnType("int"); + + b.Property("PreviousRuneLevel") + .HasColumnType("int"); + + b.Property("RuneId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("RuneEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("TickerType") + .HasColumnType("varchar(255)"); + + b.Property("AcquiredRune") + .HasColumnType("decimal(65,30)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id", "ActionType", "TickerType"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Id", "ActionType", "TickerType") + .IsUnique(); + + b.ToTable("RunesAcquired"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopConsumableModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopCostumeModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopEquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryConsumableModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryCostumeModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryEquipmentModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryFungibleAssetValueModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("Quantity") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryFungibleAssetValues"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryMaterialModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopMaterialModel", b => + { + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.ToTable("ShopMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StageRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClearedStageId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("StageRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("NewAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("NewStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PrevStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PreviousAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("RemainingNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Stakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransactionModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("longtext"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Nonce") + .HasColumnType("bigint"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedAddressesCount") + .HasColumnType("int"); + + b.HasKey("TxId"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransferAssetModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Recipient") + .HasColumnType("longtext"); + + b.Property("Sender") + .HasColumnType("longtext"); + + b.Property("TickerType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("TransferAssets"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockEquipmentRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockEquipmentRecipes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockRuneSlots"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockWorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockWorlds"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossRankingModel", b => + { + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("AvatarName") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.ToTable("WorldBossRankings", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossSeasonMigrationModel", b => + { + b.Property("RaidId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("MigratedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("RaidId"); + + b.HasIndex("RaidId") + .IsUnique(); + + b.ToTable("WorldBossSeasonMigrationModels"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/20231031063724_AddRankingTables.cs b/NineChronicles.DataProvider.Executable/Migrations/20231031063724_AddRankingTables.cs new file mode 100644 index 00000000..a3a47d0a --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20231031063724_AddRankingTables.cs @@ -0,0 +1,165 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + public partial class AddRankingTables : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "EquipmentRankingArmor", + columns: table => new + { + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EquipmentId = table.Column(type: "int", nullable: false), + Cp = table.Column(type: "int", nullable: false), + Level = table.Column(type: "int", nullable: false), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarLevel = table.Column(type: "int", nullable: true), + TitleId = table.Column(type: "int", nullable: true), + ArmorId = table.Column(type: "int", nullable: true), + Ranking = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "EquipmentRankingBelt", + columns: table => new + { + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EquipmentId = table.Column(type: "int", nullable: false), + Cp = table.Column(type: "int", nullable: false), + Level = table.Column(type: "int", nullable: false), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarLevel = table.Column(type: "int", nullable: true), + TitleId = table.Column(type: "int", nullable: true), + ArmorId = table.Column(type: "int", nullable: true), + Ranking = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "EquipmentRankingNecklace", + columns: table => new + { + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EquipmentId = table.Column(type: "int", nullable: false), + Cp = table.Column(type: "int", nullable: false), + Level = table.Column(type: "int", nullable: false), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarLevel = table.Column(type: "int", nullable: true), + TitleId = table.Column(type: "int", nullable: true), + ArmorId = table.Column(type: "int", nullable: true), + Ranking = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "EquipmentRankingRing", + columns: table => new + { + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EquipmentId = table.Column(type: "int", nullable: false), + Cp = table.Column(type: "int", nullable: false), + Level = table.Column(type: "int", nullable: false), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarLevel = table.Column(type: "int", nullable: true), + TitleId = table.Column(type: "int", nullable: true), + ArmorId = table.Column(type: "int", nullable: true), + Ranking = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "EquipmentRankingWeapon", + columns: table => new + { + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EquipmentId = table.Column(type: "int", nullable: false), + Cp = table.Column(type: "int", nullable: false), + Level = table.Column(type: "int", nullable: false), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarLevel = table.Column(type: "int", nullable: true), + TitleId = table.Column(type: "int", nullable: true), + ArmorId = table.Column(type: "int", nullable: true), + Ranking = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + }) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EquipmentRankingArmor"); + + migrationBuilder.DropTable( + name: "EquipmentRankingBelt"); + + migrationBuilder.DropTable( + name: "EquipmentRankingNecklace"); + + migrationBuilder.DropTable( + name: "EquipmentRankingRing"); + + migrationBuilder.DropTable( + name: "EquipmentRankingWeapon"); + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs index 36de3aea..3a8bdba0 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs @@ -563,6 +563,88 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Equipments"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingArmorModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingArmor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingBeltModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingBelt"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingModel", b => { b.Property("AgentAddress") @@ -604,6 +686,129 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("EquipmentRanking"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingNecklaceModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingNecklace"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingRingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingRing"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingWeaponModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingWeapon"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => { b.Property("Id") From 45b52d7cf22593c8377f4513d39bbeceeb2c7006 Mon Sep 17 00:00:00 2001 From: area363 Date: Tue, 31 Oct 2023 16:44:36 +0900 Subject: [PATCH 14/20] use GetAvatarStateV2 --- .../DataRendering/itemEnhancementData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs b/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs index 9088adf1..4ce8e21c 100644 --- a/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs +++ b/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs @@ -33,7 +33,7 @@ long blockIndex ncgCurrency); var burntNCG = prevNCGBalance - outputNCGBalance; - var equipment = outputStates.GetAvatarState(avatarAddress).inventory.Equipments + var equipment = outputStates.GetAvatarStateV2(avatarAddress).inventory.Equipments .First(e => e.ItemId == itemId); var itemEnhancementModel = new ItemEnhancementModel() From 55f4e2b99a735040cc8c32a0e088e7e984fc4a1a Mon Sep 17 00:00:00 2001 From: Suho Lee Date: Fri, 3 Nov 2023 14:12:01 +0900 Subject: [PATCH 15/20] fix: read `appsettings.json` with path --- .../Program.cs | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/NineChronicles.DataProvider.Executable/Program.cs b/NineChronicles.DataProvider.Executable/Program.cs index ca68931f..4c5da0d9 100644 --- a/NineChronicles.DataProvider.Executable/Program.cs +++ b/NineChronicles.DataProvider.Executable/Program.cs @@ -1,4 +1,11 @@ +#nullable enable using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.IO; +using System.Linq; +using System.Net.Http; +using Libplanet.Headless.Hosting; using Nekoyume.Action.Loader; using IPAddress = System.Net.IPAddress; @@ -73,12 +80,35 @@ public static IHostBuilder CreateHostBuilder(string[] args) }); [PrimaryCommand] - public async Task Run() + public async Task Run( + [Option(Description = "The path of the appsettings JSON file.")] string? configPath = null) { // Get configuration - var configurationBuilder = new ConfigurationBuilder() - .AddJsonFile("appsettings.json") - .AddEnvironmentVariables("NC_"); + var configurationBuilder = new ConfigurationBuilder(); + if (configPath != null) + { + if (Uri.IsWellFormedUriString(configPath, UriKind.Absolute)) + { + HttpClient client = new HttpClient(); + HttpResponseMessage resp = await client.GetAsync(configPath); + resp.EnsureSuccessStatusCode(); + Stream body = await resp.Content.ReadAsStreamAsync(); + configurationBuilder.AddJsonStream(body) + .AddEnvironmentVariables("NC_"); + } + else + { + configurationBuilder.AddJsonFile(configPath!) + .AddEnvironmentVariables("NC_"); + } + } + else + { + configurationBuilder + .AddJsonFile("appsettings.json") + .AddEnvironmentVariables("NC_"); + } + IConfiguration config = configurationBuilder.Build(); var headlessConfig = new Configuration(); config.Bind(headlessConfig); From 83f1608dc6015bbfff9a3e48a044c156008020d3 Mon Sep 17 00:00:00 2001 From: Suho Lee Date: Fri, 3 Nov 2023 14:12:19 +0900 Subject: [PATCH 16/20] introduce: Pluggable AEV --- .../Program.cs | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/NineChronicles.DataProvider.Executable/Program.cs b/NineChronicles.DataProvider.Executable/Program.cs index 4c5da0d9..ec28d08d 100644 --- a/NineChronicles.DataProvider.Executable/Program.cs +++ b/NineChronicles.DataProvider.Executable/Program.cs @@ -140,6 +140,40 @@ public async Task Run( builder.UseUrls($"http://{headlessConfig.GraphQLHost}:{headlessConfig.GraphQLPort}/"); }); + IActionEvaluatorConfiguration GetActionEvaluatorConfiguration(IConfiguration configuration) + { + if (!(configuration.GetValue("Type") is { } actionEvaluatorType)) + { + return null; + } + + return actionEvaluatorType switch + { + ActionEvaluatorType.Default => new DefaultActionEvaluatorConfiguration(), + ActionEvaluatorType.RemoteActionEvaluator => new RemoteActionEvaluatorConfiguration + { + StateServiceEndpoint = configuration.GetValue("StateServiceEndpoint"), + }, + ActionEvaluatorType.ForkableActionEvaluator => new ForkableActionEvaluatorConfiguration + { + Pairs = (configuration.GetSection("Pairs") ?? + throw new KeyNotFoundException()).GetChildren().Select(pair => + { + var range = new ForkableActionEvaluatorRange(); + pair.Bind("Range", range); + var actionEvaluatorConfiguration = + GetActionEvaluatorConfiguration(pair.GetSection("ActionEvaluator")) ?? + throw new KeyNotFoundException(); + return (range, actionEvaluatorConfiguration); + }).ToImmutableArray() + }, + _ => throw new InvalidOperationException("Unexpected type."), + }; + } + + var actionEvaluatorConfiguration = + GetActionEvaluatorConfiguration(config.GetSection("Headless").GetSection("ActionEvaluator")); + var properties = NineChroniclesNodeServiceProperties .GenerateLibplanetNodeServiceProperties( headlessConfig.AppProtocolVersionToken, @@ -162,7 +196,8 @@ public async Task Run( minimumBroadcastTarget: headlessConfig.MinimumBroadcastTarget, bucketSize: headlessConfig.BucketSize, render: headlessConfig.Render, - preload: headlessConfig.Preload); + preload: headlessConfig.Preload, + actionEvaluatorConfiguration: actionEvaluatorConfiguration); IActionLoader actionLoader = new NCActionLoader(); From 2b6f99c11e474c2872f8d2b075e1c9df5e17d69a Mon Sep 17 00:00:00 2001 From: area363 Date: Mon, 6 Nov 2023 20:52:13 +0900 Subject: [PATCH 17/20] add and update models --- .../DataRendering/BattleArenaData.cs | 1 + .../DataRendering/BlockData.cs | 2 + .../DataRendering/ClaimStakeRewardData.cs | 1 + .../CombinationConsumableData.cs | 5 ++- .../DataRendering/CombinationEquipmentData.cs | 5 ++- .../DataRendering/EquipmentData.cs | 5 ++- .../EventConsumableItemCraftsData.cs | 1 + .../DataRendering/EventDungeonBattleData.cs | 1 + .../DataRendering/GrindingData.cs | 1 + .../DataRendering/HackAndSlashData.cs | 2 + .../HackAndSlashRandomBuffData.cs | 1 + .../DataRendering/HackAndSlashSweepData.cs | 1 + .../DataRendering/HasWithRandomBuffData.cs | 1 + .../DataRendering/JoinArenaData.cs | 1 + .../MigrateMonsterCollectionData.cs | 1 + ...ReplaceCombinationEquipmentMaterialData.cs | 1 + .../DataRendering/StakeData.cs | 1 + .../UnlockEquipmentRecipeData.cs | 1 + .../DataRendering/UnlockWorldData.cs | 1 + .../DataRendering/itemEnhancementData.cs | 5 ++- .../DataRendering/itemEnhancementFailData.cs | 1 + .../GraphTypes/CraftRankingType.cs | 2 +- .../RenderSubscriber.cs | 21 ++++++--- .../Store/Models/AuraSummonModel.cs | 4 +- .../Store/Models/BattleArenaModel.cs | 2 + .../Store/Models/BlockModel.cs | 2 + .../Store/Models/ClaimStakeRewardModel.cs | 2 + .../Models/CombinationConsumableModel.cs | 5 +++ .../Store/Models/CombinationEquipmentModel.cs | 5 +++ .../Store/Models/CraftRankingInputModel.cs | 18 -------- ...ingOutputModel.cs => CraftRankingModel.cs} | 6 +-- .../Store/Models/EquipmentModel.cs | 3 ++ .../Models/EquipmentRankingArmorModel.cs | 4 +- .../Store/Models/EquipmentRankingBeltModel.cs | 4 +- .../Store/Models/EquipmentRankingModel.cs | 4 +- .../Models/EquipmentRankingNecklaceModel.cs | 4 +- .../Store/Models/EquipmentRankingRingModel.cs | 4 +- .../Models/EquipmentRankingWeaponModel.cs | 4 +- .../Models/EventConsumableItemCraftsModel.cs | 2 + .../Store/Models/EventDungeonBattleModel.cs | 2 + .../Store/Models/GrindingModel.cs | 2 + .../Store/Models/HackAndSlashModel.cs | 13 ++++-- .../Store/Models/HackAndSlashSweepModel.cs | 2 + .../Store/Models/HasRandomBuffModel.cs | 2 + .../Store/Models/HasWithRandomBuffModel.cs | 2 + .../Store/Models/ItemEnhancementFailModel.cs | 2 + .../Store/Models/ItemEnhancementModel.cs | 13 ++++-- .../Store/Models/JoinArenaModel.cs | 2 + .../Models/MigrateMonsterCollectionModel.cs | 2 + ...eplaceCombinationEquipmentMaterialModel.cs | 2 + .../Store/Models/StageRankingModel.cs | 8 ++-- .../Store/Models/StakeModel.cs | 2 + .../Models/UnlockEquipmentRecipeModel.cs | 2 + .../Store/Models/UnlockWorldModel.cs | 2 + .../Store/Models/UserConsumablesModel.cs | 43 ++++++++++++++++++ .../Store/Models/UserCostumesModel.cs | 41 +++++++++++++++++ .../Store/Models/UserCrystalsModel.cs | 17 +++++++ .../Store/Models/UserEquipmentsModel.cs | 45 +++++++++++++++++++ .../Store/Models/UserMaterialsModel.cs | 33 ++++++++++++++ .../Models/UserMonsterCollectionsModel.cs | 27 +++++++++++ .../Store/Models/UserNCGsModel.cs | 17 +++++++ .../Store/Models/UserRunesModel.cs | 23 ++++++++++ .../Store/Models/UserStakingsModel.cs | 23 ++++++++++ .../Store/MySqlStore.cs | 10 ++--- .../Store/NineChroniclesContext.cs | 33 ++++++++++++-- 65 files changed, 437 insertions(+), 68 deletions(-) delete mode 100644 NineChronicles.DataProvider/Store/Models/CraftRankingInputModel.cs rename NineChronicles.DataProvider/Store/Models/{CraftRankingOutputModel.cs => CraftRankingModel.cs} (93%) create mode 100644 NineChronicles.DataProvider/Store/Models/UserConsumablesModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/UserCostumesModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/UserCrystalsModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/UserEquipmentsModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/UserMaterialsModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/UserMonsterCollectionsModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/UserNCGsModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/UserRunesModel.cs create mode 100644 NineChronicles.DataProvider/Store/Models/UserStakingsModel.cs diff --git a/NineChronicles.DataProvider/DataRendering/BattleArenaData.cs b/NineChronicles.DataProvider/DataRendering/BattleArenaData.cs index 105a2525..d72acc35 100644 --- a/NineChronicles.DataProvider/DataRendering/BattleArenaData.cs +++ b/NineChronicles.DataProvider/DataRendering/BattleArenaData.cs @@ -92,6 +92,7 @@ DateTimeOffset blockTime BurntNCG = Convert.ToDecimal(burntNCG.GetQuantityString()), Victory = currentArenaScore.Score > previousArenaScore.Score, MedalCount = medalCount, + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/BlockData.cs b/NineChronicles.DataProvider/DataRendering/BlockData.cs index 5f681637..e5aea7e9 100644 --- a/NineChronicles.DataProvider/DataRendering/BlockData.cs +++ b/NineChronicles.DataProvider/DataRendering/BlockData.cs @@ -1,5 +1,6 @@ namespace NineChronicles.DataProvider.DataRendering { + using System; using System.Linq; using Libplanet.Action; using Libplanet.Types.Blocks; @@ -25,6 +26,7 @@ public static BlockModel GetBlockInfo( TotalDifficulty = 0, TxCount = block.Transactions.Count(), TxHash = block.TxHash.ToString(), + Date = DateOnly.FromDateTime(block.Timestamp.DateTime), TimeStamp = block.Timestamp.UtcDateTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/ClaimStakeRewardData.cs b/NineChronicles.DataProvider/DataRendering/ClaimStakeRewardData.cs index 9b7f5e21..7f16c420 100644 --- a/NineChronicles.DataProvider/DataRendering/ClaimStakeRewardData.cs +++ b/NineChronicles.DataProvider/DataRendering/ClaimStakeRewardData.cs @@ -64,6 +64,7 @@ DateTimeOffset blockTime ApPotionCount = outputApPotionCount - previousApPotionCount, ClaimStakeStartBlockIndex = claimStakeStartBlockIndex, ClaimStakeEndBlockIndex = claimStakeEndBlockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/CombinationConsumableData.cs b/NineChronicles.DataProvider/DataRendering/CombinationConsumableData.cs index f66d1e3b..a115c664 100644 --- a/NineChronicles.DataProvider/DataRendering/CombinationConsumableData.cs +++ b/NineChronicles.DataProvider/DataRendering/CombinationConsumableData.cs @@ -17,7 +17,8 @@ public static CombinationConsumableModel GetCombinationConsumableInfo( int recipeId, int slotIndex, Guid actionId, - long blockIndex + long blockIndex, + DateTimeOffset blockTime ) { var combinationConsumableModel = new CombinationConsumableModel() @@ -28,6 +29,8 @@ long blockIndex RecipeId = recipeId, SlotIndex = slotIndex, BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), + TimeStamp = blockTime.UtcDateTime, }; return combinationConsumableModel; diff --git a/NineChronicles.DataProvider/DataRendering/CombinationEquipmentData.cs b/NineChronicles.DataProvider/DataRendering/CombinationEquipmentData.cs index 6a85f08d..c110be53 100644 --- a/NineChronicles.DataProvider/DataRendering/CombinationEquipmentData.cs +++ b/NineChronicles.DataProvider/DataRendering/CombinationEquipmentData.cs @@ -18,7 +18,8 @@ public static CombinationEquipmentModel GetCombinationEquipmentInfo( int slotIndex, int? subRecipeId, Guid actionId, - long blockIndex + long blockIndex, + DateTimeOffset blockTime ) { var combinationEquipmentModel = new CombinationEquipmentModel() @@ -30,6 +31,8 @@ long blockIndex SlotIndex = slotIndex, SubRecipeId = subRecipeId ?? 0, BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), + TimeStamp = blockTime.UtcDateTime, }; return combinationEquipmentModel; diff --git a/NineChronicles.DataProvider/DataRendering/EquipmentData.cs b/NineChronicles.DataProvider/DataRendering/EquipmentData.cs index 061aa3c4..3f2ba027 100644 --- a/NineChronicles.DataProvider/DataRendering/EquipmentData.cs +++ b/NineChronicles.DataProvider/DataRendering/EquipmentData.cs @@ -1,5 +1,6 @@ namespace NineChronicles.DataProvider.DataRendering { + using System; using Libplanet; using Libplanet.Crypto; using Nekoyume.Battle; @@ -11,7 +12,8 @@ public static class EquipmentData public static EquipmentModel GetEquipmentInfo( Address agentAddress, Address avatarAddress, - Equipment equipment + Equipment equipment, + DateTimeOffset blockTime ) { var cp = CPHelper.GetCP(equipment); @@ -24,6 +26,7 @@ Equipment equipment Cp = cp, Level = equipment.level, ItemSubType = equipment.ItemSubType.ToString(), + TimeStamp = blockTime.UtcDateTime, }; return equipmentModel; diff --git a/NineChronicles.DataProvider/DataRendering/EventConsumableItemCraftsData.cs b/NineChronicles.DataProvider/DataRendering/EventConsumableItemCraftsData.cs index 6062343d..00b0a6e6 100644 --- a/NineChronicles.DataProvider/DataRendering/EventConsumableItemCraftsData.cs +++ b/NineChronicles.DataProvider/DataRendering/EventConsumableItemCraftsData.cs @@ -89,6 +89,7 @@ DateTimeOffset blockTime RequiredItem6Id = requiredItemData["requiredItem6Id"], RequiredItem6Count = requiredItemData["requiredItem6Count"], BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), Timestamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/EventDungeonBattleData.cs b/NineChronicles.DataProvider/DataRendering/EventDungeonBattleData.cs index badbdf61..fc78e5bb 100644 --- a/NineChronicles.DataProvider/DataRendering/EventDungeonBattleData.cs +++ b/NineChronicles.DataProvider/DataRendering/EventDungeonBattleData.cs @@ -124,6 +124,7 @@ is Bencodex.Types.List serializedEventDungeonInfoList RewardItem10Id = rewardItemData["rewardItem10Id"], RewardItem10Count = rewardItemData["rewardItem10Count"], BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), Timestamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/GrindingData.cs b/NineChronicles.DataProvider/DataRendering/GrindingData.cs index 6196dd67..21a856dd 100644 --- a/NineChronicles.DataProvider/DataRendering/GrindingData.cs +++ b/NineChronicles.DataProvider/DataRendering/GrindingData.cs @@ -92,6 +92,7 @@ DateTimeOffset blockTime EquipmentLevel = equipment.level, Crystal = Convert.ToDecimal(crystal.GetQuantityString()), BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }); } diff --git a/NineChronicles.DataProvider/DataRendering/HackAndSlashData.cs b/NineChronicles.DataProvider/DataRendering/HackAndSlashData.cs index d0b7d6e6..f49603e3 100644 --- a/NineChronicles.DataProvider/DataRendering/HackAndSlashData.cs +++ b/NineChronicles.DataProvider/DataRendering/HackAndSlashData.cs @@ -34,6 +34,8 @@ DateTimeOffset blockTime Cleared = isClear, Mimisbrunnr = stageId > 10000000, BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), + Timestamp = blockTime, }; return hasModel; diff --git a/NineChronicles.DataProvider/DataRendering/HackAndSlashRandomBuffData.cs b/NineChronicles.DataProvider/DataRendering/HackAndSlashRandomBuffData.cs index 7aa98d8d..bb3b870d 100644 --- a/NineChronicles.DataProvider/DataRendering/HackAndSlashRandomBuffData.cs +++ b/NineChronicles.DataProvider/DataRendering/HackAndSlashRandomBuffData.cs @@ -41,6 +41,7 @@ DateTimeOffset blockTime HasStageId = currentStageId, GachaCount = !advancedGacha ? 5 : 10, BurntCrystal = Convert.ToDecimal(burntCrystal.GetQuantityString()), + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/HackAndSlashSweepData.cs b/NineChronicles.DataProvider/DataRendering/HackAndSlashSweepData.cs index 26112a33..4547b49d 100644 --- a/NineChronicles.DataProvider/DataRendering/HackAndSlashSweepData.cs +++ b/NineChronicles.DataProvider/DataRendering/HackAndSlashSweepData.cs @@ -44,6 +44,7 @@ DateTimeOffset blockTime Cleared = isClear, Mimisbrunnr = stageId > 10000000, BlockIndex = blockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), Timestamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/HasWithRandomBuffData.cs b/NineChronicles.DataProvider/DataRendering/HasWithRandomBuffData.cs index be410edb..4f7eef16 100644 --- a/NineChronicles.DataProvider/DataRendering/HasWithRandomBuffData.cs +++ b/NineChronicles.DataProvider/DataRendering/HasWithRandomBuffData.cs @@ -35,6 +35,7 @@ DateTimeOffset blockTime StageId = stageId, BuffId = (int)stageBuffId!, Cleared = isClear, + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/JoinArenaData.cs b/NineChronicles.DataProvider/DataRendering/JoinArenaData.cs index 9eb057c8..0f44bce6 100644 --- a/NineChronicles.DataProvider/DataRendering/JoinArenaData.cs +++ b/NineChronicles.DataProvider/DataRendering/JoinArenaData.cs @@ -44,6 +44,7 @@ DateTimeOffset blockTime ArenaRound = round, ChampionshipId = championshipId, BurntCrystal = Convert.ToDecimal(burntCrystal.GetQuantityString()), + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/MigrateMonsterCollectionData.cs b/NineChronicles.DataProvider/DataRendering/MigrateMonsterCollectionData.cs index e36c41c8..b1b0b2f3 100644 --- a/NineChronicles.DataProvider/DataRendering/MigrateMonsterCollectionData.cs +++ b/NineChronicles.DataProvider/DataRendering/MigrateMonsterCollectionData.cs @@ -37,6 +37,7 @@ DateTimeOffset blockTime MigrationAmount = Convert.ToDecimal(migrationAmount.GetQuantityString()), MigrationStartBlockIndex = migrationStartBlockIndex, StakeStartBlockIndex = stakeStartBlockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/ReplaceCombinationEquipmentMaterialData.cs b/NineChronicles.DataProvider/DataRendering/ReplaceCombinationEquipmentMaterialData.cs index ba0f52e0..920e723c 100644 --- a/NineChronicles.DataProvider/DataRendering/ReplaceCombinationEquipmentMaterialData.cs +++ b/NineChronicles.DataProvider/DataRendering/ReplaceCombinationEquipmentMaterialData.cs @@ -114,6 +114,7 @@ public static List GetReplaceCombinati ReplacedMaterialCount = requiredCount - itemCount, BurntCrystal = Convert.ToDecimal(burntCrystal.GetQuantityString()), + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }); } diff --git a/NineChronicles.DataProvider/DataRendering/StakeData.cs b/NineChronicles.DataProvider/DataRendering/StakeData.cs index 5737a8d6..72e6ca79 100644 --- a/NineChronicles.DataProvider/DataRendering/StakeData.cs +++ b/NineChronicles.DataProvider/DataRendering/StakeData.cs @@ -56,6 +56,7 @@ DateTimeOffset blockTime RemainingNCG = Convert.ToDecimal(balance.GetQuantityString()), PrevStakeStartBlockIndex = prevStakeStartBlockIndex, NewStakeStartBlockIndex = newStakeStartBlockIndex, + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }; diff --git a/NineChronicles.DataProvider/DataRendering/UnlockEquipmentRecipeData.cs b/NineChronicles.DataProvider/DataRendering/UnlockEquipmentRecipeData.cs index b5074d9e..ef94bfdd 100644 --- a/NineChronicles.DataProvider/DataRendering/UnlockEquipmentRecipeData.cs +++ b/NineChronicles.DataProvider/DataRendering/UnlockEquipmentRecipeData.cs @@ -42,6 +42,7 @@ DateTimeOffset blockTime AvatarAddress = avatarAddress.ToString(), UnlockEquipmentRecipeId = recipeId, BurntCrystal = Convert.ToDecimal(burntCrystal.GetQuantityString()), + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }); } diff --git a/NineChronicles.DataProvider/DataRendering/UnlockWorldData.cs b/NineChronicles.DataProvider/DataRendering/UnlockWorldData.cs index 6f3e902d..fb230141 100644 --- a/NineChronicles.DataProvider/DataRendering/UnlockWorldData.cs +++ b/NineChronicles.DataProvider/DataRendering/UnlockWorldData.cs @@ -42,6 +42,7 @@ DateTimeOffset blockTime AvatarAddress = avatarAddress.ToString(), UnlockWorldId = worldId, BurntCrystal = Convert.ToDecimal(burntCrystal.GetQuantityString()), + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }); } diff --git a/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs b/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs index 4ce8e21c..bb8c1ea6 100644 --- a/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs +++ b/NineChronicles.DataProvider/DataRendering/itemEnhancementData.cs @@ -21,7 +21,8 @@ public static ItemEnhancementModel GetItemEnhancementInfo( List materialIds, Guid itemId, Guid actionId, - long blockIndex + long blockIndex, + DateTimeOffset blockTime ) { Currency ncgCurrency = outputStates.GetGoldCurrency(); @@ -50,6 +51,8 @@ long blockIndex SheetId = equipment.Id, Level = equipment.level, Exp = equipment.Exp, + Date = DateOnly.FromDateTime(blockTime.DateTime), + TimeStamp = blockTime, }; return itemEnhancementModel; diff --git a/NineChronicles.DataProvider/DataRendering/itemEnhancementFailData.cs b/NineChronicles.DataProvider/DataRendering/itemEnhancementFailData.cs index f17f8b51..22b7ea8f 100644 --- a/NineChronicles.DataProvider/DataRendering/itemEnhancementFailData.cs +++ b/NineChronicles.DataProvider/DataRendering/itemEnhancementFailData.cs @@ -76,6 +76,7 @@ DateTimeOffset blockTime EquipmentLevel = outputEquipmentLevel, GainedCrystal = Convert.ToDecimal(gainedCrystal.GetQuantityString()), BurntNCG = Convert.ToDecimal(burntNCG.GetQuantityString()), + Date = DateOnly.FromDateTime(blockTime.DateTime), TimeStamp = blockTime, }; } diff --git a/NineChronicles.DataProvider/GraphTypes/CraftRankingType.cs b/NineChronicles.DataProvider/GraphTypes/CraftRankingType.cs index 6c72abe3..3350dc12 100644 --- a/NineChronicles.DataProvider/GraphTypes/CraftRankingType.cs +++ b/NineChronicles.DataProvider/GraphTypes/CraftRankingType.cs @@ -3,7 +3,7 @@ using GraphQL.Types; using NineChronicles.DataProvider.Store.Models; - public class CraftRankingType : ObjectGraphType + public class CraftRankingType : ObjectGraphType { public CraftRankingType() { diff --git a/NineChronicles.DataProvider/RenderSubscriber.cs b/NineChronicles.DataProvider/RenderSubscriber.cs index 86015f88..177ae7fd 100644 --- a/NineChronicles.DataProvider/RenderSubscriber.cs +++ b/NineChronicles.DataProvider/RenderSubscriber.cs @@ -401,7 +401,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) combinationConsumable.recipeId, combinationConsumable.slotIndex, combinationConsumable.Id, - ev.BlockIndex)); + ev.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Log.Debug("Stored CombinationConsumable action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); } @@ -431,7 +432,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) combinationEquipment.slotIndex, combinationEquipment.subRecipeId, combinationEquipment.Id, - ev.BlockIndex)); + ev.BlockIndex, + _blockTimeOffset)); if (combinationEquipment.payByCrystal) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData @@ -468,7 +470,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) _eqList.Add(EquipmentData.GetEquipmentInfo( ev.Signer, combinationEquipment.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -520,7 +523,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) itemEnhancement.materialIds, itemEnhancement.itemId, itemEnhancement.Id, - ev.BlockIndex)); + ev.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Log.Debug("Stored ItemEnhancement action in block #{index}. Time Taken: {time} ms.", ev.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -534,7 +538,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) _eqList.Add(EquipmentData.GetEquipmentInfo( ev.Signer, itemEnhancement.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -600,7 +605,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) _eqList.Add(EquipmentData.GetEquipmentInfo( ev.Signer, buy.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -704,7 +710,8 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) _eqList.Add(EquipmentData.GetEquipmentInfo( ev.Signer, buy.AvatarAddress, - equipment)); + equipment, + _blockTimeOffset)); } break; diff --git a/NineChronicles.DataProvider/Store/Models/AuraSummonModel.cs b/NineChronicles.DataProvider/Store/Models/AuraSummonModel.cs index 84f147d6..cc0cab53 100644 --- a/NineChronicles.DataProvider/Store/Models/AuraSummonModel.cs +++ b/NineChronicles.DataProvider/Store/Models/AuraSummonModel.cs @@ -19,8 +19,8 @@ public class AuraSummonModel public int SummonCount { get; set; } - public string? SummonResult { get; set; } - public long BlockIndex { get; set; } + + public string? SummonResult { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/BattleArenaModel.cs b/NineChronicles.DataProvider/Store/Models/BattleArenaModel.cs index 65078674..e72051e1 100644 --- a/NineChronicles.DataProvider/Store/Models/BattleArenaModel.cs +++ b/NineChronicles.DataProvider/Store/Models/BattleArenaModel.cs @@ -34,6 +34,8 @@ public class BattleArenaModel public int MedalCount { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/BlockModel.cs b/NineChronicles.DataProvider/Store/Models/BlockModel.cs index a4e2a958..3974c521 100644 --- a/NineChronicles.DataProvider/Store/Models/BlockModel.cs +++ b/NineChronicles.DataProvider/Store/Models/BlockModel.cs @@ -30,6 +30,8 @@ public class BlockModel public string? TxHash { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/ClaimStakeRewardModel.cs b/NineChronicles.DataProvider/Store/Models/ClaimStakeRewardModel.cs index f161f174..3b0f0e17 100644 --- a/NineChronicles.DataProvider/Store/Models/ClaimStakeRewardModel.cs +++ b/NineChronicles.DataProvider/Store/Models/ClaimStakeRewardModel.cs @@ -24,6 +24,8 @@ public class ClaimStakeRewardModel public long ClaimStakeEndBlockIndex { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/CombinationConsumableModel.cs b/NineChronicles.DataProvider/Store/Models/CombinationConsumableModel.cs index f42fc4a2..dcaa6bf3 100644 --- a/NineChronicles.DataProvider/Store/Models/CombinationConsumableModel.cs +++ b/NineChronicles.DataProvider/Store/Models/CombinationConsumableModel.cs @@ -1,5 +1,6 @@ namespace NineChronicles.DataProvider.Store.Models { + using System; using System.ComponentModel.DataAnnotations; public class CombinationConsumableModel @@ -20,5 +21,9 @@ public class CombinationConsumableModel public int SlotIndex { get; set; } public long BlockIndex { get; set; } + + public DateOnly Date { get; set; } + + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/CombinationEquipmentModel.cs b/NineChronicles.DataProvider/Store/Models/CombinationEquipmentModel.cs index eaa7b251..905d2165 100644 --- a/NineChronicles.DataProvider/Store/Models/CombinationEquipmentModel.cs +++ b/NineChronicles.DataProvider/Store/Models/CombinationEquipmentModel.cs @@ -1,5 +1,6 @@ namespace NineChronicles.DataProvider.Store.Models { + using System; using System.ComponentModel.DataAnnotations; public class CombinationEquipmentModel @@ -22,5 +23,9 @@ public class CombinationEquipmentModel public int? SubRecipeId { get; set; } public long BlockIndex { get; set; } + + public DateOnly Date { get; set; } + + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/CraftRankingInputModel.cs b/NineChronicles.DataProvider/Store/Models/CraftRankingInputModel.cs deleted file mode 100644 index 1aef4ba9..00000000 --- a/NineChronicles.DataProvider/Store/Models/CraftRankingInputModel.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace NineChronicles.DataProvider.Store.Models -{ - using System.ComponentModel.DataAnnotations; - - public class CraftRankingInputModel - { - [Key] - public string? AvatarAddress { get; set; } - - public string? AgentAddress { get; set; } - - public long BlockIndex { get; set; } - - public int CraftCount { get; set; } - - public int Ranking { get; set; } - } -} diff --git a/NineChronicles.DataProvider/Store/Models/CraftRankingOutputModel.cs b/NineChronicles.DataProvider/Store/Models/CraftRankingModel.cs similarity index 93% rename from NineChronicles.DataProvider/Store/Models/CraftRankingOutputModel.cs rename to NineChronicles.DataProvider/Store/Models/CraftRankingModel.cs index 4b934678..d86663ea 100644 --- a/NineChronicles.DataProvider/Store/Models/CraftRankingOutputModel.cs +++ b/NineChronicles.DataProvider/Store/Models/CraftRankingModel.cs @@ -2,17 +2,17 @@ { using System.ComponentModel.DataAnnotations; - public class CraftRankingOutputModel + public class CraftRankingModel { [Key] public string? AvatarAddress { get; set; } public string? AgentAddress { get; set; } - public long BlockIndex { get; set; } - public int CraftCount { get; set; } + public long BlockIndex { get; set; } + public string? Name { get; set; } public int? AvatarLevel { get; set; } diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentModel.cs index 14296bfd..a887fba0 100644 --- a/NineChronicles.DataProvider/Store/Models/EquipmentModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EquipmentModel.cs @@ -1,5 +1,6 @@ namespace NineChronicles.DataProvider.Store.Models { + using System; using System.ComponentModel.DataAnnotations; public class EquipmentModel @@ -18,5 +19,7 @@ public class EquipmentModel public int Level { get; set; } public string? ItemSubType { get; set; } + + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingArmorModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingArmorModel.cs index b2f647ac..e5a4ad59 100644 --- a/NineChronicles.DataProvider/Store/Models/EquipmentRankingArmorModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingArmorModel.cs @@ -7,10 +7,10 @@ public class EquipmentRankingArmorModel [Key] public string? ItemId { get; set; } - public string? AgentAddress { get; set; } - public string? AvatarAddress { get; set; } + public string? AgentAddress { get; set; } + public int EquipmentId { get; set; } public int Cp { get; set; } diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingBeltModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingBeltModel.cs index 3d2afa67..f28a9896 100644 --- a/NineChronicles.DataProvider/Store/Models/EquipmentRankingBeltModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingBeltModel.cs @@ -7,10 +7,10 @@ public class EquipmentRankingBeltModel [Key] public string? ItemId { get; set; } - public string? AgentAddress { get; set; } - public string? AvatarAddress { get; set; } + public string? AgentAddress { get; set; } + public int EquipmentId { get; set; } public int Cp { get; set; } diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingModel.cs index 9ba806a5..fee6b56d 100644 --- a/NineChronicles.DataProvider/Store/Models/EquipmentRankingModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingModel.cs @@ -7,10 +7,10 @@ public class EquipmentRankingModel [Key] public string? ItemId { get; set; } - public string? AgentAddress { get; set; } - public string? AvatarAddress { get; set; } + public string? AgentAddress { get; set; } + public int EquipmentId { get; set; } public int Cp { get; set; } diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingNecklaceModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingNecklaceModel.cs index a6527a7c..d4eaa7cf 100644 --- a/NineChronicles.DataProvider/Store/Models/EquipmentRankingNecklaceModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingNecklaceModel.cs @@ -7,10 +7,10 @@ public class EquipmentRankingNecklaceModel [Key] public string? ItemId { get; set; } - public string? AgentAddress { get; set; } - public string? AvatarAddress { get; set; } + public string? AgentAddress { get; set; } + public int EquipmentId { get; set; } public int Cp { get; set; } diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingRingModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingRingModel.cs index ce8f3932..9538380d 100644 --- a/NineChronicles.DataProvider/Store/Models/EquipmentRankingRingModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingRingModel.cs @@ -7,10 +7,10 @@ public class EquipmentRankingRingModel [Key] public string? ItemId { get; set; } - public string? AgentAddress { get; set; } - public string? AvatarAddress { get; set; } + public string? AgentAddress { get; set; } + public int EquipmentId { get; set; } public int Cp { get; set; } diff --git a/NineChronicles.DataProvider/Store/Models/EquipmentRankingWeaponModel.cs b/NineChronicles.DataProvider/Store/Models/EquipmentRankingWeaponModel.cs index f9c2a606..d8c56ed4 100644 --- a/NineChronicles.DataProvider/Store/Models/EquipmentRankingWeaponModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EquipmentRankingWeaponModel.cs @@ -7,10 +7,10 @@ public class EquipmentRankingWeaponModel [Key] public string? ItemId { get; set; } - public string? AgentAddress { get; set; } - public string? AvatarAddress { get; set; } + public string? AgentAddress { get; set; } + public int EquipmentId { get; set; } public int Cp { get; set; } diff --git a/NineChronicles.DataProvider/Store/Models/EventConsumableItemCraftsModel.cs b/NineChronicles.DataProvider/Store/Models/EventConsumableItemCraftsModel.cs index 868c8f11..6efdcf7e 100644 --- a/NineChronicles.DataProvider/Store/Models/EventConsumableItemCraftsModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EventConsumableItemCraftsModel.cs @@ -48,6 +48,8 @@ public class EventConsumableItemCraftsModel public long BlockIndex { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset Timestamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/EventDungeonBattleModel.cs b/NineChronicles.DataProvider/Store/Models/EventDungeonBattleModel.cs index ae4506b2..4ec92c02 100644 --- a/NineChronicles.DataProvider/Store/Models/EventDungeonBattleModel.cs +++ b/NineChronicles.DataProvider/Store/Models/EventDungeonBattleModel.cs @@ -76,6 +76,8 @@ public class EventDungeonBattleModel public long BlockIndex { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset Timestamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/GrindingModel.cs b/NineChronicles.DataProvider/Store/Models/GrindingModel.cs index 6f49ca95..322d7473 100644 --- a/NineChronicles.DataProvider/Store/Models/GrindingModel.cs +++ b/NineChronicles.DataProvider/Store/Models/GrindingModel.cs @@ -26,6 +26,8 @@ public class GrindingModel public decimal Crystal { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/HackAndSlashModel.cs b/NineChronicles.DataProvider/Store/Models/HackAndSlashModel.cs index 8a3469a2..2fb8b836 100644 --- a/NineChronicles.DataProvider/Store/Models/HackAndSlashModel.cs +++ b/NineChronicles.DataProvider/Store/Models/HackAndSlashModel.cs @@ -1,5 +1,6 @@ namespace NineChronicles.DataProvider.Store.Models { + using System; using System.ComponentModel.DataAnnotations; public class HackAndSlashModel @@ -7,14 +8,14 @@ public class HackAndSlashModel [Key] public string? Id { get; set; } - public string? AgentAddress { get; set; } - - public AgentModel? Agent { get; set; } - public string? AvatarAddress { get; set; } public AvatarModel? Avatar { get; set; } + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + public int StageId { get; set; } public bool Cleared { get; set; } @@ -22,5 +23,9 @@ public class HackAndSlashModel public bool Mimisbrunnr { get; set; } public long BlockIndex { get; set; } + + public DateOnly Date { get; set; } + + public DateTimeOffset Timestamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/HackAndSlashSweepModel.cs b/NineChronicles.DataProvider/Store/Models/HackAndSlashSweepModel.cs index fb2bf9b6..dc1b8db9 100644 --- a/NineChronicles.DataProvider/Store/Models/HackAndSlashSweepModel.cs +++ b/NineChronicles.DataProvider/Store/Models/HackAndSlashSweepModel.cs @@ -34,6 +34,8 @@ public class HackAndSlashSweepModel public long BlockIndex { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset Timestamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/HasRandomBuffModel.cs b/NineChronicles.DataProvider/Store/Models/HasRandomBuffModel.cs index c8c67a32..d9e566d8 100644 --- a/NineChronicles.DataProvider/Store/Models/HasRandomBuffModel.cs +++ b/NineChronicles.DataProvider/Store/Models/HasRandomBuffModel.cs @@ -24,6 +24,8 @@ public class HasRandomBuffModel public decimal BurntCrystal { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/HasWithRandomBuffModel.cs b/NineChronicles.DataProvider/Store/Models/HasWithRandomBuffModel.cs index 29159f85..0974cc14 100644 --- a/NineChronicles.DataProvider/Store/Models/HasWithRandomBuffModel.cs +++ b/NineChronicles.DataProvider/Store/Models/HasWithRandomBuffModel.cs @@ -24,6 +24,8 @@ public class HasWithRandomBuffModel public bool Cleared { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/ItemEnhancementFailModel.cs b/NineChronicles.DataProvider/Store/Models/ItemEnhancementFailModel.cs index 257db984..9153e4b8 100644 --- a/NineChronicles.DataProvider/Store/Models/ItemEnhancementFailModel.cs +++ b/NineChronicles.DataProvider/Store/Models/ItemEnhancementFailModel.cs @@ -31,6 +31,8 @@ public class ItemEnhancementFailModel public decimal BurntNCG { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/ItemEnhancementModel.cs b/NineChronicles.DataProvider/Store/Models/ItemEnhancementModel.cs index fcc809ed..f11be61d 100644 --- a/NineChronicles.DataProvider/Store/Models/ItemEnhancementModel.cs +++ b/NineChronicles.DataProvider/Store/Models/ItemEnhancementModel.cs @@ -1,5 +1,6 @@ namespace NineChronicles.DataProvider.Store.Models { + using System; using System.ComponentModel.DataAnnotations; public class ItemEnhancementModel @@ -7,14 +8,14 @@ public class ItemEnhancementModel [Key] public string? Id { get; set; } - public string? AgentAddress { get; set; } - - public AgentModel? Agent { get; set; } - public string? AvatarAddress { get; set; } public AvatarModel? Avatar { get; set; } + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + public string? ItemId { get; set; } public string? MaterialId { get; set; } @@ -32,5 +33,9 @@ public class ItemEnhancementModel public int? Level { get; set; } public long? Exp { get; set; } + + public DateOnly Date { get; set; } + + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/JoinArenaModel.cs b/NineChronicles.DataProvider/Store/Models/JoinArenaModel.cs index 23986582..0b4add4b 100644 --- a/NineChronicles.DataProvider/Store/Models/JoinArenaModel.cs +++ b/NineChronicles.DataProvider/Store/Models/JoinArenaModel.cs @@ -26,6 +26,8 @@ public class JoinArenaModel public decimal BurntCrystal { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/MigrateMonsterCollectionModel.cs b/NineChronicles.DataProvider/Store/Models/MigrateMonsterCollectionModel.cs index fd2cf327..82586802 100644 --- a/NineChronicles.DataProvider/Store/Models/MigrateMonsterCollectionModel.cs +++ b/NineChronicles.DataProvider/Store/Models/MigrateMonsterCollectionModel.cs @@ -18,6 +18,8 @@ public class MigrateMonsterCollectionModel public long StakeStartBlockIndex { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/ReplaceCombinationEquipmentMaterialModel.cs b/NineChronicles.DataProvider/Store/Models/ReplaceCombinationEquipmentMaterialModel.cs index 4f78b8e8..63791e70 100644 --- a/NineChronicles.DataProvider/Store/Models/ReplaceCombinationEquipmentMaterialModel.cs +++ b/NineChronicles.DataProvider/Store/Models/ReplaceCombinationEquipmentMaterialModel.cs @@ -24,6 +24,8 @@ public class ReplaceCombinationEquipmentMaterialModel public decimal BurntCrystal { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/StageRankingModel.cs b/NineChronicles.DataProvider/Store/Models/StageRankingModel.cs index 548e699d..7248a6c5 100644 --- a/NineChronicles.DataProvider/Store/Models/StageRankingModel.cs +++ b/NineChronicles.DataProvider/Store/Models/StageRankingModel.cs @@ -4,15 +4,13 @@ public class StageRankingModel { - public int Ranking { get; set; } - - public int ClearedStageId { get; set; } - [Key] public string? AvatarAddress { get; set; } public string? AgentAddress { get; set; } + public int ClearedStageId { get; set; } + public string? Name { get; set; } public int? AvatarLevel { get; set; } @@ -24,5 +22,7 @@ public class StageRankingModel public int? Cp { get; set; } public long BlockIndex { get; set; } + + public int Ranking { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/StakeModel.cs b/NineChronicles.DataProvider/Store/Models/StakeModel.cs index 91bf89c8..fbe7f8dd 100644 --- a/NineChronicles.DataProvider/Store/Models/StakeModel.cs +++ b/NineChronicles.DataProvider/Store/Models/StakeModel.cs @@ -21,6 +21,8 @@ public class StakeModel public long NewStakeStartBlockIndex { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/UnlockEquipmentRecipeModel.cs b/NineChronicles.DataProvider/Store/Models/UnlockEquipmentRecipeModel.cs index c2153a32..ebf29d95 100644 --- a/NineChronicles.DataProvider/Store/Models/UnlockEquipmentRecipeModel.cs +++ b/NineChronicles.DataProvider/Store/Models/UnlockEquipmentRecipeModel.cs @@ -22,6 +22,8 @@ public class UnlockEquipmentRecipeModel public decimal BurntCrystal { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/UnlockWorldModel.cs b/NineChronicles.DataProvider/Store/Models/UnlockWorldModel.cs index c5f4bdca..f0ca1ff2 100644 --- a/NineChronicles.DataProvider/Store/Models/UnlockWorldModel.cs +++ b/NineChronicles.DataProvider/Store/Models/UnlockWorldModel.cs @@ -22,6 +22,8 @@ public class UnlockWorldModel public decimal BurntCrystal { get; set; } + public DateOnly Date { get; set; } + public DateTimeOffset TimeStamp { get; set; } } } diff --git a/NineChronicles.DataProvider/Store/Models/UserConsumablesModel.cs b/NineChronicles.DataProvider/Store/Models/UserConsumablesModel.cs new file mode 100644 index 00000000..26d76817 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserConsumablesModel.cs @@ -0,0 +1,43 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserConsumablesModel + { + public long? BlockIndex { get; set; } + + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public string? AvatarAddress { get; set; } + + public AvatarModel? Avatar { get; set; } + + public string? ItemType { get; set; } + + public string? ItemSubType { get; set; } + + public int? Id { get; set; } + + public int? BuffSkillCount { get; set; } + + public string? ElementalType { get; set; } + + public int? Grade { get; set; } + + public int? SkillsCount { get; set; } + + public long? RequiredBlockIndex { get; set; } + + public string? NonFungibleId { get; set; } + + public string? TradableId { get; set; } + + public string? MainStat { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/UserCostumesModel.cs b/NineChronicles.DataProvider/Store/Models/UserCostumesModel.cs new file mode 100644 index 00000000..f0ae9e43 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserCostumesModel.cs @@ -0,0 +1,41 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserCostumesModel + { + public long? BlockIndex { get; set; } + + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public string? AvatarAddress { get; set; } + + public AvatarModel? Avatar { get; set; } + + public string? ItemType { get; set; } + + public string? ItemSubType { get; set; } + + public int? Id { get; set; } + + public string? ElementalType { get; set; } + + public int? Grade { get; set; } + + public bool? Equipped { get; set; } + + public string? SpineResourcePath { get; set; } + + public long? RequiredBlockIndex { get; set; } + + public string? NonFungibleId { get; set; } + + public string? TradableId { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/UserCrystalsModel.cs b/NineChronicles.DataProvider/Store/Models/UserCrystalsModel.cs new file mode 100644 index 00000000..0b4c0f16 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserCrystalsModel.cs @@ -0,0 +1,17 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserCrystalsModel + { + public long? BlockIndex { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public decimal? CrystalBalance { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/UserEquipmentsModel.cs b/NineChronicles.DataProvider/Store/Models/UserEquipmentsModel.cs new file mode 100644 index 00000000..f993c034 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserEquipmentsModel.cs @@ -0,0 +1,45 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserEquipmentsModel + { + public long? BlockIndex { get; set; } + + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public string? AvatarAddress { get; set; } + + public string? ItemType { get; set; } + + public string? ItemSubType { get; set; } + + public int? Id { get; set; } + + public int? BuffSkillCount { get; set; } + + public string? ElementalType { get; set; } + + public int? Grade { get; set; } + + public int? Level { get; set; } + + public int? SetId { get; set; } + + public int? SkillsCount { get; set; } + + public string? SpineResourcePath { get; set; } + + public long? RequiredBlockIndex { get; set; } + + public string? NonFungibleId { get; set; } + + public string? TradableId { get; set; } + + public string? UniqueStatType { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/UserMaterialsModel.cs b/NineChronicles.DataProvider/Store/Models/UserMaterialsModel.cs new file mode 100644 index 00000000..2ace0b92 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserMaterialsModel.cs @@ -0,0 +1,33 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserMaterialsModel + { + public long? BlockIndex { get; set; } + + public string? ItemId { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public string? AvatarAddress { get; set; } + + public AvatarModel? Avatar { get; set; } + + public string? ItemType { get; set; } + + public string? ItemSubType { get; set; } + + public int? Count { get; set; } + + public int? Id { get; set; } + + public string? ElementalType { get; set; } + + public int? Grade { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/UserMonsterCollectionsModel.cs b/NineChronicles.DataProvider/Store/Models/UserMonsterCollectionsModel.cs new file mode 100644 index 00000000..04c22b1c --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserMonsterCollectionsModel.cs @@ -0,0 +1,27 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserMonsterCollectionsModel + { + public long? BlockIndex { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public decimal? MonsterCollectionAmount { get; set; } + + public int? Level { get; set; } + + public long? RewardLevel { get; set; } + + public long? StartedBlockIndex { get; set; } + + public long? ReceivedBlockIndex { get; set; } + + public long? ExpiredBlockIndex { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/UserNCGsModel.cs b/NineChronicles.DataProvider/Store/Models/UserNCGsModel.cs new file mode 100644 index 00000000..09996c3d --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserNCGsModel.cs @@ -0,0 +1,17 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserNCGsModel + { + public long? BlockIndex { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public decimal? NCGBalance { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/UserRunesModel.cs b/NineChronicles.DataProvider/Store/Models/UserRunesModel.cs new file mode 100644 index 00000000..a2534e76 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserRunesModel.cs @@ -0,0 +1,23 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserRunesModel + { + public long? BlockIndex { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public string? AvatarAddress { get; set; } + + public AvatarModel? Avatar { get; set; } + + public string? Ticker { get; set; } + + public decimal? RuneBalance { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/Models/UserStakingsModel.cs b/NineChronicles.DataProvider/Store/Models/UserStakingsModel.cs new file mode 100644 index 00000000..7b59bde2 --- /dev/null +++ b/NineChronicles.DataProvider/Store/Models/UserStakingsModel.cs @@ -0,0 +1,23 @@ +namespace NineChronicles.DataProvider.Store.Models +{ + using System; + + public class UserStakingsModel + { + public long? BlockIndex { get; set; } + + public string? AgentAddress { get; set; } + + public AgentModel? Agent { get; set; } + + public decimal? StakeAmount { get; set; } + + public long? StartedBlockIndex { get; set; } + + public long? ReceivedBlockIndex { get; set; } + + public long? CancellableBlockIndex { get; set; } + + public DateTimeOffset? TimeStamp { get; set; } + } +} diff --git a/NineChronicles.DataProvider/Store/MySqlStore.cs b/NineChronicles.DataProvider/Store/MySqlStore.cs index fd8fb45f..ceb166d7 100644 --- a/NineChronicles.DataProvider/Store/MySqlStore.cs +++ b/NineChronicles.DataProvider/Store/MySqlStore.cs @@ -593,7 +593,7 @@ public void StoreCombinationConsumable( else { ctx.CraftRankings!.Add( - new CraftRankingInputModel() + new CraftRankingModel() { AgentAddress = agentAddress.ToString(), AvatarAddress = avatarAddress.ToString(), @@ -697,7 +697,7 @@ public void StoreCombinationEquipment( else { ctx.CraftRankings!.Add( - new CraftRankingInputModel() + new CraftRankingModel() { AgentAddress = agentAddress.ToString(), AvatarAddress = avatarAddress.ToString(), @@ -979,7 +979,7 @@ public void StoreItemEnhancement( else { ctx.CraftRankings!.Add( - new CraftRankingInputModel() + new CraftRankingModel() { AgentAddress = agentAddress.ToString(), AvatarAddress = avatarAddress.ToString(), @@ -1950,12 +1950,12 @@ public void StorePetEnhancementList(List petEnhancementList } } - public IEnumerable GetCraftRanking( + public IEnumerable GetCraftRanking( Address? avatarAddress = null, int? limit = null) { using NineChroniclesContext ctx = _dbContextFactory.CreateDbContext(); - var query = ctx.Set() + var query = ctx.Set() .FromSqlRaw("SELECT * FROM CraftRankings ORDER BY Ranking "); if (avatarAddress is { } avatarAddressNotNull) diff --git a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs index 1bfb5fa1..e58e998d 100644 --- a/NineChronicles.DataProvider/Store/NineChroniclesContext.cs +++ b/NineChronicles.DataProvider/Store/NineChroniclesContext.cs @@ -26,9 +26,7 @@ public NineChroniclesContext(DbContextOptions options) public DbSet? ItemEnhancements { get; set; } // Table for ranking avatars' total craft counts - public DbSet? CraftRankings { get; set; } - - public DbSet? CraftRankingsOutput { get; set; } + public DbSet? CraftRankings { get; set; } // Table for storing avatar information public DbSet? Avatars { get; set; } @@ -180,6 +178,24 @@ public NineChroniclesContext(DbContextOptions options) public DbSet AuraSummonFails => Set(); + public DbSet UserConsumables => Set(); + + public DbSet UserCostumes => Set(); + + public DbSet UserCrystals => Set(); + + public DbSet UserEquipments => Set(); + + public DbSet UserMaterials => Set(); + + public DbSet UserMonsterCollections => Set(); + + public DbSet UserNCGs => Set(); + + public DbSet UserRunes => Set(); + + public DbSet UserStakings => Set(); + /* * This override method enables EF database update & migration when certain models are required for data querying, * but tables constructed by these models are not needed. @@ -188,7 +204,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); - modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasNoKey(); @@ -206,6 +222,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity() .HasNoKey() .ToTable("WorldBossRankings", t => t.ExcludeFromMigrations()); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); } } } From fed9b44af5d3bf2c5db3384cdf1440cc3933e721 Mon Sep 17 00:00:00 2001 From: area363 Date: Mon, 6 Nov 2023 20:52:41 +0900 Subject: [PATCH 18/20] add migrations --- .../Commands/MySqlMigration.cs | 222 +- ...231106114947_AddUserDataTables.Designer.cs | 3525 +++++++++++++++++ .../20231106114947_AddUserDataTables.cs | 774 ++++ .../NineChroniclesContextModelSnapshot.cs | 539 ++- 4 files changed, 4962 insertions(+), 98 deletions(-) create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20231106114947_AddUserDataTables.Designer.cs create mode 100644 NineChronicles.DataProvider.Executable/Migrations/20231106114947_AddUserDataTables.cs diff --git a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs index 47431a1c..bf0f6263 100644 --- a/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs +++ b/NineChronicles.DataProvider.Executable/Commands/MySqlMigration.cs @@ -1045,7 +1045,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationConsumable.recipeId, combinationConsumable.slotIndex, combinationConsumable.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing CombinationConsumable action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -1061,7 +1062,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationConsumable7.recipeId, combinationConsumable7.slotIndex, combinationConsumable7.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing CombinationConsumable action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -1077,7 +1079,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationConsumable6.recipeId, combinationConsumable6.slotIndex, combinationConsumable6.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing CombinationConsumable action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -1093,7 +1096,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationConsumable5.recipeId, combinationConsumable5.slotIndex, combinationConsumable5.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing CombinationConsumable action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -1109,7 +1113,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationConsumable4.recipeId, combinationConsumable4.slotIndex, combinationConsumable4.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing CombinationConsumable action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -1125,7 +1130,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationConsumable3.recipeId, combinationConsumable3.slotIndex, combinationConsumable3.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing CombinationConsumable action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -1141,7 +1147,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationConsumable2.recipeId, combinationConsumable2.slotIndex, combinationConsumable2.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing CombinationConsumable action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -1157,7 +1164,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationConsumable0.recipeId, combinationConsumable0.slotIndex, combinationConsumable0.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing CombinationConsumable action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); } @@ -1174,7 +1182,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment.slotIndex, combinationEquipment.subRecipeId, combinationEquipment.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); if (combinationEquipment.payByCrystal) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData @@ -1211,7 +1220,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1234,7 +1244,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment15.slotIndex, combinationEquipment15.subRecipeId, combinationEquipment15.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); if (combinationEquipment15.payByCrystal) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData @@ -1271,7 +1282,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment15.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1294,7 +1306,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment14.slotIndex, combinationEquipment14.subRecipeId, combinationEquipment14.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); if (combinationEquipment14.payByCrystal) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData @@ -1331,7 +1344,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment14.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1354,7 +1368,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment13.slotIndex, combinationEquipment13.subRecipeId, combinationEquipment13.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); if (combinationEquipment13.payByCrystal) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData @@ -1391,7 +1406,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment13.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1414,7 +1430,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment12.slotIndex, combinationEquipment12.subRecipeId, combinationEquipment12.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); if (combinationEquipment12.payByCrystal) { var replaceCombinationEquipmentMaterialList = ReplaceCombinationEquipmentMaterialData @@ -1451,7 +1468,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment12.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1474,7 +1492,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment11.slotIndex, combinationEquipment11.subRecipeId, combinationEquipment11.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1492,7 +1511,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment11.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1515,7 +1535,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment10.slotIndex, combinationEquipment10.subRecipeId, combinationEquipment10.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1533,7 +1554,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment10.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1556,7 +1578,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment9.slotIndex, combinationEquipment9.subRecipeId, combinationEquipment9.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1574,7 +1597,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment9.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1597,7 +1621,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment8.slotIndex, combinationEquipment8.subRecipeId, combinationEquipment8.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1615,7 +1640,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment8.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1638,7 +1664,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment7.SlotIndex, combinationEquipment7.SubRecipeId, combinationEquipment7.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1656,7 +1683,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment7.AvatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1679,7 +1707,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment6.SlotIndex, combinationEquipment6.SubRecipeId, combinationEquipment6.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1697,7 +1726,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment6.AvatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1720,7 +1750,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment5.SlotIndex, combinationEquipment5.SubRecipeId, combinationEquipment5.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1738,7 +1769,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment5.AvatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1761,7 +1793,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment4.SlotIndex, combinationEquipment4.SubRecipeId, combinationEquipment4.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1779,7 +1812,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment4.AvatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1802,7 +1836,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment3.SlotIndex, combinationEquipment3.SubRecipeId, combinationEquipment3.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1820,7 +1855,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment3.AvatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1843,7 +1879,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment2.SlotIndex, combinationEquipment2.SubRecipeId, combinationEquipment2.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1861,7 +1898,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment2.AvatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1884,7 +1922,8 @@ private void ProcessTasks(Task>[] taskArray, IB combinationEquipment0.SlotIndex, combinationEquipment0.SubRecipeId, combinationEquipment0.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine( @@ -1902,7 +1941,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, combinationEquipment0.AvatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1941,7 +1981,8 @@ private void ProcessTasks(Task>[] taskArray, IB itemEnhancement.materialIds, itemEnhancement.itemId, itemEnhancement.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -1955,7 +1996,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -1994,7 +2036,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement10.itemId, itemEnhancement10.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2008,7 +2051,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement10.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2047,7 +2091,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement9.itemId, itemEnhancement9.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2061,7 +2106,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement9.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2100,7 +2146,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement8.itemId, itemEnhancement8.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2114,7 +2161,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement8.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2153,7 +2201,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement7.itemId, itemEnhancement7.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2167,7 +2216,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement7.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2206,7 +2256,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement6.itemId, itemEnhancement6.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2220,7 +2271,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement6.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2259,7 +2311,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement5.itemId, itemEnhancement5.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2273,7 +2326,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement5.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2312,7 +2366,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement4.itemId, itemEnhancement4.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2326,7 +2381,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement4.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2365,7 +2421,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement3.itemId, itemEnhancement3.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2379,7 +2436,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement3.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2418,7 +2476,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement2.itemId, itemEnhancement2.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2432,7 +2491,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement2.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2471,7 +2531,8 @@ private void ProcessTasks(Task>[] taskArray, IB new List(), itemEnhancement0.itemId, itemEnhancement0.Id, - ae.InputContext.BlockIndex)); + ae.InputContext.BlockIndex, + _blockTimeOffset)); var end = DateTimeOffset.UtcNow; Console.WriteLine("Writing ItemEnhancement action in block #{0}. Time Taken: {1} ms.", ae.InputContext.BlockIndex, (end - start).Milliseconds); start = DateTimeOffset.UtcNow; @@ -2485,7 +2546,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, itemEnhancement0.avatarAddress, - (Equipment)slotState.Result.itemUsable)); + (Equipment)slotState.Result.itemUsable, + _blockTimeOffset)); } end = DateTimeOffset.UtcNow; @@ -2585,7 +2647,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -2687,7 +2750,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy11.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -2789,7 +2853,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy10.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -2891,7 +2956,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy9.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -2993,7 +3059,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy8.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -3095,7 +3162,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy7.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -3197,7 +3265,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy6.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -3299,7 +3368,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy5.buyerAvatarAddress, - equipmentNotNull)); + equipmentNotNull, + _blockTimeOffset)); } } } @@ -3333,7 +3403,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy4.buyerAvatarAddress, - equipment)); + equipment, + _blockTimeOffset)); } if (shopItem.ItemUsable.ItemType == ItemType.Costume) @@ -3407,7 +3478,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy3.buyerAvatarAddress, - equipment)); + equipment, + _blockTimeOffset)); } if (shopItem.ItemUsable.ItemType == ItemType.Costume) @@ -3481,7 +3553,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy2.buyerAvatarAddress, - equipment)); + equipment, + _blockTimeOffset)); } if (shopItem.ItemUsable.ItemType == ItemType.Costume) @@ -3555,7 +3628,8 @@ private void ProcessTasks(Task>[] taskArray, IB _equipmentList.Add(EquipmentData.GetEquipmentInfo( ae.InputContext.Signer, buy0.buyerAvatarAddress, - equipment)); + equipment, + _blockTimeOffset)); } if (shopItem.ItemUsable.ItemType == ItemType.Costume) diff --git a/NineChronicles.DataProvider.Executable/Migrations/20231106114947_AddUserDataTables.Designer.cs b/NineChronicles.DataProvider.Executable/Migrations/20231106114947_AddUserDataTables.Designer.cs new file mode 100644 index 00000000..4708e01b --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20231106114947_AddUserDataTables.Designer.cs @@ -0,0 +1,3525 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using NineChronicles.DataProvider.Store; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + [DbContext(typeof(NineChroniclesContext))] + [Migration("20231106114947_AddUserDataTables")] + partial class AddUserDataTables + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AbilityRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("AbilityRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AgentModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.HasKey("Address"); + + b.ToTable("Agents"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Exception") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AuraSummonFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonResult") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("AuraSummons"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.Property("Address") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.HasKey("Address"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Avatars"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EnemyAvatarAddress") + .HasColumnType("longtext"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("TicketCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("BattleArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaRankingModel", b => + { + b.Property("AdditionalTicketPrice") + .HasColumnType("bigint"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArenaType") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EndBlockIndex") + .HasColumnType("bigint"); + + b.Property("EntranceFee") + .HasColumnType("bigint"); + + b.Property("LossCount") + .HasColumnType("int"); + + b.Property("MedalCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PurchasedTicketCount") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("RequiredMedalCount") + .HasColumnType("int"); + + b.Property("Round") + .HasColumnType("int"); + + b.Property("Score") + .HasColumnType("int"); + + b.Property("StartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Ticket") + .HasColumnType("int"); + + b.Property("TicketPrice") + .HasColumnType("bigint"); + + b.Property("TicketResetCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.Property("WinCount") + .HasColumnType("int"); + + b.ToTable("BattleArenaRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EnemyAvatarAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("GrandFinaleId") + .HasColumnType("int"); + + b.Property("GrandFinaleScore") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("Victory") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("BattleGrandFinales"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BlockModel", b => + { + b.Property("Hash") + .HasColumnType("varchar(255)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Difficulty") + .HasColumnType("bigint"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("Miner") + .HasColumnType("longtext"); + + b.Property("Nonce") + .HasColumnType("longtext"); + + b.Property("PreviousHash") + .HasColumnType("longtext"); + + b.Property("ProtocolVersion") + .HasColumnType("int"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("StateRootHash") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalDifficulty") + .HasColumnType("bigint"); + + b.Property("TxCount") + .HasColumnType("int"); + + b.Property("TxHash") + .HasColumnType("longtext"); + + b.HasKey("Hash"); + + b.ToTable("Blocks"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApPotionCount") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimRewardAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ClaimStakeEndBlockIndex") + .HasColumnType("bigint"); + + b.Property("ClaimStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourGlassCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.ToTable("ClaimStakeRewards"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CombinationConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("SubRecipeId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("CombinationEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CraftCount") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("CraftRankings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("ItemId"); + + b.ToTable("Equipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingArmorModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingArmor"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingBeltModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingBelt"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingNecklaceModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingNecklace"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingRingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingRing"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentRankingWeaponModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("EquipmentRankingWeapon"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EventConsumableItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("RequiredItem1Count") + .HasColumnType("int"); + + b.Property("RequiredItem1Id") + .HasColumnType("int"); + + b.Property("RequiredItem2Count") + .HasColumnType("int"); + + b.Property("RequiredItem2Id") + .HasColumnType("int"); + + b.Property("RequiredItem3Count") + .HasColumnType("int"); + + b.Property("RequiredItem3Id") + .HasColumnType("int"); + + b.Property("RequiredItem4Count") + .HasColumnType("int"); + + b.Property("RequiredItem4Id") + .HasColumnType("int"); + + b.Property("RequiredItem5Count") + .HasColumnType("int"); + + b.Property("RequiredItem5Id") + .HasColumnType("int"); + + b.Property("RequiredItem6Count") + .HasColumnType("int"); + + b.Property("RequiredItem6Id") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventConsumableItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("EventDungeonId") + .HasColumnType("int"); + + b.Property("EventDungeonStageId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("FoodsCount") + .HasColumnType("int"); + + b.Property("RemainingTickets") + .HasColumnType("int"); + + b.Property("RewardItem10Count") + .HasColumnType("int"); + + b.Property("RewardItem10Id") + .HasColumnType("int"); + + b.Property("RewardItem1Count") + .HasColumnType("int"); + + b.Property("RewardItem1Id") + .HasColumnType("int"); + + b.Property("RewardItem2Count") + .HasColumnType("int"); + + b.Property("RewardItem2Id") + .HasColumnType("int"); + + b.Property("RewardItem3Count") + .HasColumnType("int"); + + b.Property("RewardItem3Id") + .HasColumnType("int"); + + b.Property("RewardItem4Count") + .HasColumnType("int"); + + b.Property("RewardItem4Id") + .HasColumnType("int"); + + b.Property("RewardItem5Count") + .HasColumnType("int"); + + b.Property("RewardItem5Id") + .HasColumnType("int"); + + b.Property("RewardItem6Count") + .HasColumnType("int"); + + b.Property("RewardItem6Id") + .HasColumnType("int"); + + b.Property("RewardItem7Count") + .HasColumnType("int"); + + b.Property("RewardItem7Id") + .HasColumnType("int"); + + b.Property("RewardItem8Count") + .HasColumnType("int"); + + b.Property("RewardItem8Id") + .HasColumnType("int"); + + b.Property("RewardItem9Count") + .HasColumnType("int"); + + b.Property("RewardItem9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventDungeonBattles"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EventMaterialItemRecipeId") + .HasColumnType("int"); + + b.Property("EventScheduleId") + .HasColumnType("int"); + + b.Property("Material10Count") + .HasColumnType("int"); + + b.Property("Material10Id") + .HasColumnType("int"); + + b.Property("Material11Count") + .HasColumnType("int"); + + b.Property("Material11Id") + .HasColumnType("int"); + + b.Property("Material12Count") + .HasColumnType("int"); + + b.Property("Material12Id") + .HasColumnType("int"); + + b.Property("Material1Count") + .HasColumnType("int"); + + b.Property("Material1Id") + .HasColumnType("int"); + + b.Property("Material2Count") + .HasColumnType("int"); + + b.Property("Material2Id") + .HasColumnType("int"); + + b.Property("Material3Count") + .HasColumnType("int"); + + b.Property("Material3Id") + .HasColumnType("int"); + + b.Property("Material4Count") + .HasColumnType("int"); + + b.Property("Material4Id") + .HasColumnType("int"); + + b.Property("Material5Count") + .HasColumnType("int"); + + b.Property("Material5Id") + .HasColumnType("int"); + + b.Property("Material6Count") + .HasColumnType("int"); + + b.Property("Material6Id") + .HasColumnType("int"); + + b.Property("Material7Count") + .HasColumnType("int"); + + b.Property("Material7Id") + .HasColumnType("int"); + + b.Property("Material8Count") + .HasColumnType("int"); + + b.Property("Material8Id") + .HasColumnType("int"); + + b.Property("Material9Count") + .HasColumnType("int"); + + b.Property("Material9Id") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("EventMaterialItemCrafts"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Crystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentId") + .HasColumnType("int"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("Grindings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HackAndSlashes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionPoint") + .HasColumnType("int"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ApStoneCount") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("CostumesCount") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentsCount") + .HasColumnType("int"); + + b.Property("Mimisbrunnr") + .HasColumnType("tinyint(1)"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("WorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HackAndSlashSweeps"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("GachaCount") + .HasColumnType("int"); + + b.Property("HasStageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HasRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffId") + .HasColumnType("int"); + + b.Property("Cleared") + .HasColumnType("tinyint(1)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("StageId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("HasWithRandomBuffs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("EquipmentItemId") + .HasColumnType("longtext"); + + b.Property("EquipmentLevel") + .HasColumnType("int"); + + b.Property("GainedCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("MaterialItemId") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancementFails"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Exp") + .HasColumnType("bigint"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MaterialId") + .HasColumnType("longtext"); + + b.Property("MaterialIdsCount") + .HasColumnType("int"); + + b.Property("SheetId") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ItemEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("ArenaRound") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("ChampionshipId") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("JoinArenas"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("MigrationAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("MigrationStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("MigrateMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntSoulStone") + .HasColumnType("decimal(65,30)"); + + b.Property("ChangedLevel") + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("OutputPetLevel") + .HasColumnType("int"); + + b.Property("PetId") + .HasColumnType("int"); + + b.Property("PreviousPetLevel") + .HasColumnType("int"); + + b.Property("TargetLevel") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("PetEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RaiderModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Address") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("AvatarName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("PurchaseCount") + .HasColumnType("int"); + + b.Property("RaidId") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("RaidId", "Address") + .IsUnique(); + + b.ToTable("Raiders"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("HourglassCount") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("RapidCombinations"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("ReplacedMaterialCount") + .HasColumnType("int"); + + b.Property("ReplacedMaterialId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("ReplaceCombinationEquipmentMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RequestPledgeModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("PledgeAgentAddress") + .HasColumnType("longtext"); + + b.Property("RefillMead") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxSigner") + .HasColumnType("longtext"); + + b.HasKey("TxId"); + + b.ToTable("RequestPledges"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("BurntRune") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("OutputRuneLevel") + .HasColumnType("int"); + + b.Property("PreviousRuneLevel") + .HasColumnType("int"); + + b.Property("RuneId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("RuneEnhancements"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("varchar(255)"); + + b.Property("TickerType") + .HasColumnType("varchar(255)"); + + b.Property("AcquiredRune") + .HasColumnType("decimal(65,30)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id", "ActionType", "TickerType"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.HasIndex("Id", "ActionType", "TickerType") + .IsUnique(); + + b.ToTable("RunesAcquired"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopConsumableModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopCostumeModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopEquipmentModel", b => + { + b.Property("ItemId") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("ItemId"); + + b.ToTable("ShopEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryConsumableModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryCostumeModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryEquipmentModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryFungibleAssetValueModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("Quantity") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryFungibleAssetValues"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopHistoryMaterialModel", b => + { + b.Property("OrderId") + .HasColumnType("varchar(255)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuyerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("OrderId"); + + b.ToTable("ShopHistoryMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ShopMaterialModel", b => + { + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CombatPoint") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemCount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("OrderId") + .HasColumnType("longtext"); + + b.Property("Price") + .HasColumnType("decimal(65,30)"); + + b.Property("SellExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellStartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("SellerAgentAddress") + .HasColumnType("longtext"); + + b.Property("SellerAvatarAddress") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.ToTable("ShopMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StageRankingModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("AvatarLevel") + .HasColumnType("int"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ClearedStageId") + .HasColumnType("int"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TitleId") + .HasColumnType("int"); + + b.ToTable("StageRanking"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("NewAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("NewStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PrevStakeStartBlockIndex") + .HasColumnType("bigint"); + + b.Property("PreviousAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("RemainingNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("Stakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransactionModel", b => + { + b.Property("TxId") + .HasColumnType("varchar(255)"); + + b.Property("ActionType") + .HasColumnType("longtext"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Nonce") + .HasColumnType("bigint"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("Signer") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedAddressesCount") + .HasColumnType("int"); + + b.HasKey("TxId"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.TransferAssetModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BlockHash") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("Recipient") + .HasColumnType("longtext"); + + b.Property("Sender") + .HasColumnType("longtext"); + + b.Property("TickerType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TxId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("TransferAssets"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockEquipmentRecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockEquipmentRecipes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntNCG") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockRuneSlots"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BurntCrystal") + .HasColumnType("decimal(65,30)"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UnlockWorldId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UnlockWorlds"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CrystalBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserCrystals"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserEquipmentsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.ToTable("UserEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MonsterCollectionAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("RewardLevel") + .HasColumnType("bigint"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("NCGBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserNCGs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RuneBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserRunes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CancellableBlockIndex") + .HasColumnType("bigint"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserStakings"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossRankingModel", b => + { + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("AvatarName") + .HasColumnType("longtext"); + + b.Property("Cp") + .HasColumnType("int"); + + b.Property("HighScore") + .HasColumnType("int"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Ranking") + .HasColumnType("int"); + + b.Property("TotalScore") + .HasColumnType("int"); + + b.ToTable("WorldBossRankings", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossSeasonMigrationModel", b => + { + b.Property("RaidId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("MigratedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("RaidId"); + + b.HasIndex("RaidId") + .IsUnique(); + + b.ToTable("WorldBossSeasonMigrationModels"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AuraSummonModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.AvatarModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.BattleGrandFinaleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ClaimStakeRewardModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationConsumableModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CombinationEquipmentModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventConsumableItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventDungeonBattleModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EventMaterialItemCraftsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.GrindingModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HackAndSlashSweepModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.HasWithRandomBuffModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementFailModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ItemEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.JoinArenaModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.MigrateMonsterCollectionModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.PetEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RapidCombinationModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.ReplaceCombinationEquipmentMaterialModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RuneEnhancementModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.RunesAcquiredModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.StakeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockEquipmentRecipeModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockRuneSlotModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UnlockWorldModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/20231106114947_AddUserDataTables.cs b/NineChronicles.DataProvider.Executable/Migrations/20231106114947_AddUserDataTables.cs new file mode 100644 index 00000000..d519cda9 --- /dev/null +++ b/NineChronicles.DataProvider.Executable/Migrations/20231106114947_AddUserDataTables.cs @@ -0,0 +1,774 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NineChronicles.DataProvider.Executable.Migrations +{ + public partial class AddUserDataTables : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CraftRankingsOutput"); + + migrationBuilder.DropPrimaryKey( + name: "PK_CraftRankings", + table: "CraftRankings"); + + migrationBuilder.AddColumn( + name: "Date", + table: "UnlockWorlds", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "UnlockEquipmentRecipes", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "Stakings", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "ReplaceCombinationEquipmentMaterials", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "MigrateMonsterCollections", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "JoinArenas", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "ItemEnhancements", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "TimeStamp", + table: "ItemEnhancements", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); + + migrationBuilder.AddColumn( + name: "Date", + table: "ItemEnhancementFails", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "HasWithRandomBuffs", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "HasRandomBuffs", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "HackAndSlashSweeps", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "HackAndSlashes", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Timestamp", + table: "HackAndSlashes", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); + + migrationBuilder.AddColumn( + name: "Date", + table: "Grindings", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "EventDungeonBattles", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "EventConsumableItemCrafts", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "TimeStamp", + table: "Equipments", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); + + migrationBuilder.AlterColumn( + name: "AvatarAddress", + table: "CraftRankings", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "ArmorId", + table: "CraftRankings", + type: "int", + nullable: true); + + migrationBuilder.AddColumn( + name: "AvatarLevel", + table: "CraftRankings", + type: "int", + nullable: true); + + migrationBuilder.AddColumn( + name: "Cp", + table: "CraftRankings", + type: "int", + nullable: true); + + migrationBuilder.AddColumn( + name: "Name", + table: "CraftRankings", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "TitleId", + table: "CraftRankings", + type: "int", + nullable: true); + + migrationBuilder.AddColumn( + name: "Date", + table: "CombinationEquipments", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "TimeStamp", + table: "CombinationEquipments", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); + + migrationBuilder.AddColumn( + name: "Date", + table: "CombinationConsumables", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "TimeStamp", + table: "CombinationConsumables", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); + + migrationBuilder.AddColumn( + name: "Date", + table: "ClaimStakeRewards", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "Blocks", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.AddColumn( + name: "Date", + table: "BattleArenas", + type: "date", + nullable: false, + defaultValue: new DateOnly(1, 1, 1)); + + migrationBuilder.CreateTable( + name: "UserConsumables", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Id = table.Column(type: "int", nullable: true), + BuffSkillCount = table.Column(type: "int", nullable: true), + ElementalType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Grade = table.Column(type: "int", nullable: true), + SkillsCount = table.Column(type: "int", nullable: true), + RequiredBlockIndex = table.Column(type: "bigint", nullable: true), + NonFungibleId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TradableId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + MainStat = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_UserConsumables_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + table.ForeignKey( + name: "FK_UserConsumables_Avatars_AvatarAddress", + column: x => x.AvatarAddress, + principalTable: "Avatars", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserCostumes", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Id = table.Column(type: "int", nullable: true), + ElementalType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Grade = table.Column(type: "int", nullable: true), + Equipped = table.Column(type: "tinyint(1)", nullable: true), + SpineResourcePath = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RequiredBlockIndex = table.Column(type: "bigint", nullable: true), + NonFungibleId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TradableId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_UserCostumes_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + table.ForeignKey( + name: "FK_UserCostumes_Avatars_AvatarAddress", + column: x => x.AvatarAddress, + principalTable: "Avatars", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserCrystals", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CrystalBalance = table.Column(type: "decimal(65,30)", nullable: true), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_UserCrystals_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserEquipments", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Id = table.Column(type: "int", nullable: true), + BuffSkillCount = table.Column(type: "int", nullable: true), + ElementalType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Grade = table.Column(type: "int", nullable: true), + Level = table.Column(type: "int", nullable: true), + SetId = table.Column(type: "int", nullable: true), + SkillsCount = table.Column(type: "int", nullable: true), + SpineResourcePath = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RequiredBlockIndex = table.Column(type: "bigint", nullable: true), + NonFungibleId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TradableId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UniqueStatType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserMaterials", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + ItemId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemSubType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Count = table.Column(type: "int", nullable: true), + Id = table.Column(type: "int", nullable: true), + ElementalType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Grade = table.Column(type: "int", nullable: true), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_UserMaterials_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + table.ForeignKey( + name: "FK_UserMaterials_Avatars_AvatarAddress", + column: x => x.AvatarAddress, + principalTable: "Avatars", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserMonsterCollections", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + MonsterCollectionAmount = table.Column(type: "decimal(65,30)", nullable: true), + Level = table.Column(type: "int", nullable: true), + RewardLevel = table.Column(type: "bigint", nullable: true), + StartedBlockIndex = table.Column(type: "bigint", nullable: true), + ReceivedBlockIndex = table.Column(type: "bigint", nullable: true), + ExpiredBlockIndex = table.Column(type: "bigint", nullable: true), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_UserMonsterCollections_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserNCGs", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + NCGBalance = table.Column(type: "decimal(65,30)", nullable: true), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_UserNCGs_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserRunes", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Ticker = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RuneBalance = table.Column(type: "decimal(65,30)", nullable: true), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_UserRunes_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + table.ForeignKey( + name: "FK_UserRunes_Avatars_AvatarAddress", + column: x => x.AvatarAddress, + principalTable: "Avatars", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "UserStakings", + columns: table => new + { + BlockIndex = table.Column(type: "bigint", nullable: true), + AgentAddress = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + StakeAmount = table.Column(type: "decimal(65,30)", nullable: true), + StartedBlockIndex = table.Column(type: "bigint", nullable: true), + ReceivedBlockIndex = table.Column(type: "bigint", nullable: true), + CancellableBlockIndex = table.Column(type: "bigint", nullable: true), + TimeStamp = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_UserStakings_Agents_AgentAddress", + column: x => x.AgentAddress, + principalTable: "Agents", + principalColumn: "Address"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_UserConsumables_AgentAddress", + table: "UserConsumables", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserConsumables_AvatarAddress", + table: "UserConsumables", + column: "AvatarAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserCostumes_AgentAddress", + table: "UserCostumes", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserCostumes_AvatarAddress", + table: "UserCostumes", + column: "AvatarAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserCrystals_AgentAddress", + table: "UserCrystals", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserMaterials_AgentAddress", + table: "UserMaterials", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserMaterials_AvatarAddress", + table: "UserMaterials", + column: "AvatarAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserMonsterCollections_AgentAddress", + table: "UserMonsterCollections", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserNCGs_AgentAddress", + table: "UserNCGs", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserRunes_AgentAddress", + table: "UserRunes", + column: "AgentAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserRunes_AvatarAddress", + table: "UserRunes", + column: "AvatarAddress"); + + migrationBuilder.CreateIndex( + name: "IX_UserStakings_AgentAddress", + table: "UserStakings", + column: "AgentAddress"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "UserConsumables"); + + migrationBuilder.DropTable( + name: "UserCostumes"); + + migrationBuilder.DropTable( + name: "UserCrystals"); + + migrationBuilder.DropTable( + name: "UserEquipments"); + + migrationBuilder.DropTable( + name: "UserMaterials"); + + migrationBuilder.DropTable( + name: "UserMonsterCollections"); + + migrationBuilder.DropTable( + name: "UserNCGs"); + + migrationBuilder.DropTable( + name: "UserRunes"); + + migrationBuilder.DropTable( + name: "UserStakings"); + + migrationBuilder.DropColumn( + name: "Date", + table: "UnlockWorlds"); + + migrationBuilder.DropColumn( + name: "Date", + table: "UnlockEquipmentRecipes"); + + migrationBuilder.DropColumn( + name: "Date", + table: "Stakings"); + + migrationBuilder.DropColumn( + name: "Date", + table: "ReplaceCombinationEquipmentMaterials"); + + migrationBuilder.DropColumn( + name: "Date", + table: "MigrateMonsterCollections"); + + migrationBuilder.DropColumn( + name: "Date", + table: "JoinArenas"); + + migrationBuilder.DropColumn( + name: "Date", + table: "ItemEnhancements"); + + migrationBuilder.DropColumn( + name: "TimeStamp", + table: "ItemEnhancements"); + + migrationBuilder.DropColumn( + name: "Date", + table: "ItemEnhancementFails"); + + migrationBuilder.DropColumn( + name: "Date", + table: "HasWithRandomBuffs"); + + migrationBuilder.DropColumn( + name: "Date", + table: "HasRandomBuffs"); + + migrationBuilder.DropColumn( + name: "Date", + table: "HackAndSlashSweeps"); + + migrationBuilder.DropColumn( + name: "Date", + table: "HackAndSlashes"); + + migrationBuilder.DropColumn( + name: "Timestamp", + table: "HackAndSlashes"); + + migrationBuilder.DropColumn( + name: "Date", + table: "Grindings"); + + migrationBuilder.DropColumn( + name: "Date", + table: "EventDungeonBattles"); + + migrationBuilder.DropColumn( + name: "Date", + table: "EventConsumableItemCrafts"); + + migrationBuilder.DropColumn( + name: "TimeStamp", + table: "Equipments"); + + migrationBuilder.DropColumn( + name: "ArmorId", + table: "CraftRankings"); + + migrationBuilder.DropColumn( + name: "AvatarLevel", + table: "CraftRankings"); + + migrationBuilder.DropColumn( + name: "Cp", + table: "CraftRankings"); + + migrationBuilder.DropColumn( + name: "Name", + table: "CraftRankings"); + + migrationBuilder.DropColumn( + name: "TitleId", + table: "CraftRankings"); + + migrationBuilder.DropColumn( + name: "Date", + table: "CombinationEquipments"); + + migrationBuilder.DropColumn( + name: "TimeStamp", + table: "CombinationEquipments"); + + migrationBuilder.DropColumn( + name: "Date", + table: "CombinationConsumables"); + + migrationBuilder.DropColumn( + name: "TimeStamp", + table: "CombinationConsumables"); + + migrationBuilder.DropColumn( + name: "Date", + table: "ClaimStakeRewards"); + + migrationBuilder.DropColumn( + name: "Date", + table: "Blocks"); + + migrationBuilder.DropColumn( + name: "Date", + table: "BattleArenas"); + + migrationBuilder.UpdateData( + table: "CraftRankings", + keyColumn: "AvatarAddress", + keyValue: null, + column: "AvatarAddress", + value: string.Empty); + + migrationBuilder.AlterColumn( + name: "AvatarAddress", + table: "CraftRankings", + type: "varchar(255)", + nullable: false, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddPrimaryKey( + name: "PK_CraftRankings", + table: "CraftRankings", + column: "AvatarAddress"); + + migrationBuilder.CreateTable( + name: "CraftRankingsOutput", + columns: table => new + { + AgentAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ArmorId = table.Column(type: "int", nullable: true), + AvatarAddress = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AvatarLevel = table.Column(type: "int", nullable: true), + BlockIndex = table.Column(type: "bigint", nullable: false), + Cp = table.Column(type: "int", nullable: true), + CraftCount = table.Column(type: "int", nullable: false), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Ranking = table.Column(type: "int", nullable: false), + TitleId = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + }) + .Annotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs index 3a8bdba0..85b1accc 100644 --- a/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs +++ b/NineChronicles.DataProvider.Executable/Migrations/NineChroniclesContextModelSnapshot.cs @@ -178,6 +178,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ChampionshipId") .HasColumnType("int"); + b.Property("Date") + .HasColumnType("date"); + b.Property("EnemyAvatarAddress") .HasColumnType("longtext"); @@ -340,6 +343,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Hash") .HasColumnType("varchar(255)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("Difficulty") .HasColumnType("bigint"); @@ -404,6 +410,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ClaimStakeStartBlockIndex") .HasColumnType("bigint"); + b.Property("Date") + .HasColumnType("date"); + b.Property("HourGlassCount") .HasColumnType("int"); @@ -431,12 +440,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BlockIndex") .HasColumnType("bigint"); + b.Property("Date") + .HasColumnType("date"); + b.Property("RecipeId") .HasColumnType("int"); b.Property("SlotIndex") .HasColumnType("int"); + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + b.HasKey("Id"); b.HasIndex("AgentAddress"); @@ -460,6 +475,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BlockIndex") .HasColumnType("bigint"); + b.Property("Date") + .HasColumnType("date"); + b.Property("RecipeId") .HasColumnType("int"); @@ -469,6 +487,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("SubRecipeId") .HasColumnType("int"); + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + b.HasKey("Id"); b.HasIndex("AgentAddress"); @@ -478,29 +499,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("CombinationEquipments"); }); - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingInputModel", b => - { - b.Property("AvatarAddress") - .HasColumnType("varchar(255)"); - - b.Property("AgentAddress") - .HasColumnType("longtext"); - - b.Property("BlockIndex") - .HasColumnType("bigint"); - - b.Property("CraftCount") - .HasColumnType("int"); - - b.Property("Ranking") - .HasColumnType("int"); - - b.HasKey("AvatarAddress"); - - b.ToTable("CraftRankings"); - }); - - modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingOutputModel", b => + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.CraftRankingModel", b => { b.Property("AgentAddress") .HasColumnType("longtext"); @@ -532,7 +531,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("TitleId") .HasColumnType("int"); - b.ToTable("CraftRankingsOutput"); + b.ToTable("CraftRankings"); }); modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.EquipmentModel", b => @@ -558,6 +557,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Level") .HasColumnType("int"); + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + b.HasKey("ItemId"); b.ToTable("Equipments"); @@ -823,6 +825,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BlockIndex") .HasColumnType("bigint"); + b.Property("Date") + .HasColumnType("date"); + b.Property("EventConsumableItemRecipeId") .HasColumnType("int"); @@ -903,6 +908,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("CostumesCount") .HasColumnType("int"); + b.Property("Date") + .HasColumnType("date"); + b.Property("EquipmentsCount") .HasColumnType("int"); @@ -1119,6 +1127,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Crystal") .HasColumnType("decimal(65,30)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("EquipmentId") .HasColumnType("int"); @@ -1157,12 +1168,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Cleared") .HasColumnType("tinyint(1)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("Mimisbrunnr") .HasColumnType("tinyint(1)"); b.Property("StageId") .HasColumnType("int"); + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + b.HasKey("Id"); b.HasIndex("AgentAddress"); @@ -1198,6 +1215,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("CostumesCount") .HasColumnType("int"); + b.Property("Date") + .HasColumnType("date"); + b.Property("EquipmentsCount") .HasColumnType("int"); @@ -1239,6 +1259,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BurntCrystal") .HasColumnType("decimal(65,30)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("GachaCount") .HasColumnType("int"); @@ -1277,6 +1300,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Cleared") .HasColumnType("tinyint(1)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("StageId") .HasColumnType("int"); @@ -1309,6 +1335,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BurntNCG") .HasColumnType("decimal(65,30)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("EquipmentItemId") .HasColumnType("longtext"); @@ -1353,6 +1382,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BurntNCG") .HasColumnType("decimal(65,30)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("Exp") .HasColumnType("bigint"); @@ -1374,6 +1406,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("SlotIndex") .HasColumnType("int"); + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + b.HasKey("Id"); b.HasIndex("AgentAddress"); @@ -1409,6 +1444,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ChampionshipId") .HasColumnType("int"); + b.Property("Date") + .HasColumnType("date"); + b.Property("TimeStamp") .HasColumnType("datetime(6)"); @@ -1429,6 +1467,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BlockIndex") .HasColumnType("bigint"); + b.Property("Date") + .HasColumnType("date"); + b.Property("MigrationAmount") .HasColumnType("decimal(65,30)"); @@ -1599,6 +1640,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BurntCrystal") .HasColumnType("decimal(65,30)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("ReplacedMaterialCount") .HasColumnType("int"); @@ -2365,6 +2409,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BlockIndex") .HasColumnType("bigint"); + b.Property("Date") + .HasColumnType("date"); + b.Property("NewAmount") .HasColumnType("decimal(65,30)"); @@ -2479,6 +2526,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BurntCrystal") .HasColumnType("decimal(65,30)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("TimeStamp") .HasColumnType("datetime(6)"); @@ -2546,6 +2596,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("BurntCrystal") .HasColumnType("decimal(65,30)"); + b.Property("Date") + .HasColumnType("date"); + b.Property("TimeStamp") .HasColumnType("datetime(6)"); @@ -2561,6 +2614,348 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("UnlockWorlds"); }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("MainStat") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserConsumables"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Equipped") + .HasColumnType("tinyint(1)"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserCostumes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CrystalBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserCrystals"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserEquipmentsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("longtext"); + + b.Property("AvatarAddress") + .HasColumnType("longtext"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("BuffSkillCount") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("NonFungibleId") + .HasColumnType("longtext"); + + b.Property("RequiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("SetId") + .HasColumnType("int"); + + b.Property("SkillsCount") + .HasColumnType("int"); + + b.Property("SpineResourcePath") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("TradableId") + .HasColumnType("longtext"); + + b.Property("UniqueStatType") + .HasColumnType("longtext"); + + b.ToTable("UserEquipments"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("ElementalType") + .HasColumnType("longtext"); + + b.Property("Grade") + .HasColumnType("int"); + + b.Property("Id") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("longtext"); + + b.Property("ItemSubType") + .HasColumnType("longtext"); + + b.Property("ItemType") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserMaterials"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("ExpiredBlockIndex") + .HasColumnType("bigint"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MonsterCollectionAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("RewardLevel") + .HasColumnType("bigint"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserMonsterCollections"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("NCGBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserNCGs"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("AvatarAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("RuneBalance") + .HasColumnType("decimal(65,30)"); + + b.Property("Ticker") + .HasColumnType("longtext"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.HasIndex("AvatarAddress"); + + b.ToTable("UserRunes"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.Property("AgentAddress") + .HasColumnType("varchar(255)"); + + b.Property("BlockIndex") + .HasColumnType("bigint"); + + b.Property("CancellableBlockIndex") + .HasColumnType("bigint"); + + b.Property("ReceivedBlockIndex") + .HasColumnType("bigint"); + + b.Property("StakeAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("StartedBlockIndex") + .HasColumnType("bigint"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasIndex("AgentAddress"); + + b.ToTable("UserStakings"); + }); + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.WorldBossRankingModel", b => { b.Property("Address") @@ -3026,6 +3421,102 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Avatar"); }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserConsumablesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCostumesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserCrystalsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMaterialsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserMonsterCollectionsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserNCGsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserRunesModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.HasOne("NineChronicles.DataProvider.Store.Models.AvatarModel", "Avatar") + .WithMany() + .HasForeignKey("AvatarAddress"); + + b.Navigation("Agent"); + + b.Navigation("Avatar"); + }); + + modelBuilder.Entity("NineChronicles.DataProvider.Store.Models.UserStakingsModel", b => + { + b.HasOne("NineChronicles.DataProvider.Store.Models.AgentModel", "Agent") + .WithMany() + .HasForeignKey("AgentAddress"); + + b.Navigation("Agent"); + }); #pragma warning restore 612, 618 } } From 9c0644b796f77c01b9c8e7beb8b5bfb15fcadcca Mon Sep 17 00:00:00 2001 From: Submodule Updater Date: Tue, 7 Nov 2023 04:46:44 +0000 Subject: [PATCH 19/20] Update NineChronicles.Headless submodule to planetarium/NineChronicles.Headless@f43535afbb2cb5c2f2258ed6f4e1d0ab49d670e8 This commit was automatically generated by Submodule Updater. --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index ba982836..f43535af 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit ba9828361d22625a0b47c706c7cdf4a3b57b811a +Subproject commit f43535afbb2cb5c2f2258ed6f4e1d0ab49d670e8 From 9eb7065f51530ee731e5f079aec54ec3ffc12600 Mon Sep 17 00:00:00 2001 From: area363 Date: Tue, 7 Nov 2023 18:22:24 +0900 Subject: [PATCH 20/20] bump headless to main --- NineChronicles.Headless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless b/NineChronicles.Headless index f43535af..256fa4c7 160000 --- a/NineChronicles.Headless +++ b/NineChronicles.Headless @@ -1 +1 @@ -Subproject commit f43535afbb2cb5c2f2258ed6f4e1d0ab49d670e8 +Subproject commit 256fa4c742ce07fa0b386dabe96a9eb937f41b97