diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests/ActionEvaluationSerializerTest.cs b/.Lib9c.ActionEvaluatorCommonComponents.Tests/ActionEvaluationSerializerTest.cs
similarity index 96%
rename from .Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests/ActionEvaluationSerializerTest.cs
rename to .Lib9c.ActionEvaluatorCommonComponents.Tests/ActionEvaluationSerializerTest.cs
index da80fffcf2..f2f468961f 100644
--- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests/ActionEvaluationSerializerTest.cs
+++ b/.Lib9c.ActionEvaluatorCommonComponents.Tests/ActionEvaluationSerializerTest.cs
@@ -5,7 +5,7 @@
using Libplanet.Common;
using Libplanet.Crypto;
-namespace Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests;
+namespace Lib9c.ActionEvaluatorCommonComponents.Tests;
public class ActionEvaluationSerializerTest
{
diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests/Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests.csproj b/.Lib9c.ActionEvaluatorCommonComponents.Tests/Lib9c.ActionEvaluatorCommonComponents.Tests.csproj
similarity index 85%
rename from .Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests/Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests.csproj
rename to .Lib9c.ActionEvaluatorCommonComponents.Tests/Lib9c.ActionEvaluatorCommonComponents.Tests.csproj
index 1dfcb77ebb..8e3825eca5 100644
--- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests/Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests.csproj
+++ b/.Lib9c.ActionEvaluatorCommonComponents.Tests/Lib9c.ActionEvaluatorCommonComponents.Tests.csproj
@@ -23,7 +23,7 @@
-
+
diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests/Usings.cs b/.Lib9c.ActionEvaluatorCommonComponents.Tests/Usings.cs
similarity index 100%
rename from .Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests/Usings.cs
rename to .Lib9c.ActionEvaluatorCommonComponents.Tests/Usings.cs
diff --git a/.Lib9c.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs b/.Lib9c.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs
new file mode 100644
index 0000000000..62bf90a62c
--- /dev/null
+++ b/.Lib9c.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs
@@ -0,0 +1,68 @@
+using System.Security.Cryptography;
+using Bencodex;
+using Bencodex.Types;
+using Libplanet.Action;
+using Libplanet.Common;
+using Libplanet.Crypto;
+using Libplanet.Types.Tx;
+using Boolean = Bencodex.Types.Boolean;
+
+namespace Lib9c.ActionEvaluatorCommonComponents
+{
+ public static class ActionContextMarshaller
+ {
+ private static readonly Codec Codec = new Codec();
+
+ public static byte[] Serialize(this ICommittedActionContext actionContext)
+ {
+ return Codec.Encode(Marshal(actionContext));
+ }
+
+ public static Dictionary Marshal(this ICommittedActionContext actionContext)
+ {
+ var dictionary = Bencodex.Types.Dictionary.Empty
+ .Add("signer", actionContext.Signer.ToHex())
+ .Add("miner", actionContext.Miner.ToHex())
+ .Add("block_index", actionContext.BlockIndex)
+ .Add("block_protocol_version", actionContext.BlockProtocolVersion)
+ .Add("previous_states", actionContext.PreviousState.ByteArray)
+ .Add("random_seed", actionContext.RandomSeed)
+ .Add("block_action", actionContext.IsPolicyAction);
+
+ if (actionContext.TxId is { } txId)
+ {
+ dictionary = dictionary.Add("tx_id", txId.ByteArray);
+ }
+
+ return dictionary;
+ }
+
+ public static ICommittedActionContext Unmarshal(Dictionary dictionary)
+ {
+ return new CommittedActionContext(
+ signer: new Address(((Text)dictionary["signer"]).Value),
+ txId: dictionary.TryGetValue((Text)"tx_id", out IValue txIdValue) &&
+ txIdValue is Binary txIdBinaryValue
+ ? new TxId(txIdBinaryValue.ByteArray)
+ : null,
+ miner: new Address(((Text)dictionary["miner"]).Value),
+ blockIndex: (Integer)dictionary["block_index"],
+ blockProtocolVersion: (Integer)dictionary["block_protocol_version"],
+ previousState: new HashDigest(dictionary["previous_states"]),
+ randomSeed: (Integer)dictionary["random_seed"],
+ isPolicyAction: (Boolean)dictionary["block_action"]
+ );
+ }
+
+ public static ICommittedActionContext Deserialize(byte[] serialized)
+ {
+ var decoded = Codec.Decode(serialized);
+ if (!(decoded is Dictionary dictionary))
+ {
+ throw new ArgumentException($"Expected 'Dictionary' but {decoded.GetType().Name}", nameof(serialized));
+ }
+
+ return Unmarshal(dictionary);
+ }
+ }
+}
diff --git a/.Lib9c.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs b/.Lib9c.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs
new file mode 100644
index 0000000000..47f35995b8
--- /dev/null
+++ b/.Lib9c.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs
@@ -0,0 +1,46 @@
+using System.Security.Cryptography;
+using Bencodex;
+using Bencodex.Types;
+using Libplanet.Action;
+using Libplanet.Common;
+
+namespace Lib9c.ActionEvaluatorCommonComponents
+{
+ public static class ActionEvaluationMarshaller
+ {
+ private static readonly Codec Codec = new Codec();
+
+ public static byte[] Serialize(this ICommittedActionEvaluation actionEvaluation)
+ {
+ return Codec.Encode(Marshal(actionEvaluation));
+ }
+
+ public static Dictionary Marshal(this ICommittedActionEvaluation actionEvaluation) =>
+ Dictionary.Empty
+ .Add("action", actionEvaluation.Action)
+ .Add("output_states", actionEvaluation.OutputState.ByteArray)
+ .Add("input_context", actionEvaluation.InputContext.Marshal())
+ .Add("exception", actionEvaluation.Exception?.GetType().FullName is { } typeName ? (Text)typeName : Null.Value);
+
+ public static ICommittedActionEvaluation Unmarshal(IValue value)
+ {
+ if (value is not Dictionary dictionary)
+ {
+ throw new ArgumentException(nameof(value));
+ }
+
+ return new CommittedActionEvaluation(
+ dictionary["action"],
+ ActionContextMarshaller.Unmarshal((Dictionary)dictionary["input_context"]),
+ new HashDigest(dictionary["output_states"]),
+ dictionary["exception"] is Text typeName ? new Exception(typeName) : null
+ );
+ }
+
+ public static ICommittedActionEvaluation Deserialize(byte[] serialized)
+ {
+ var decoded = Codec.Decode(serialized);
+ return Unmarshal(decoded);
+ }
+ }
+}
diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj b/.Lib9c.ActionEvaluatorCommonComponents/Lib9c.ActionEvaluatorCommonComponents.csproj
similarity index 84%
rename from .Libplanet.Extensions.ActionEvaluatorCommonComponents/Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj
rename to .Lib9c.ActionEvaluatorCommonComponents/Lib9c.ActionEvaluatorCommonComponents.csproj
index 8ac2e4e9a1..24567fd450 100644
--- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj
+++ b/.Lib9c.ActionEvaluatorCommonComponents/Lib9c.ActionEvaluatorCommonComponents.csproj
@@ -4,6 +4,8 @@
net6.0
enable
enable
+ .bin
+ .obj
diff --git a/.Lib9c.ActionEvaluatorCommonComponents/PreEvaluationBlockMarshaller.cs b/.Lib9c.ActionEvaluatorCommonComponents/PreEvaluationBlockMarshaller.cs
new file mode 100644
index 0000000000..0c95f5b828
--- /dev/null
+++ b/.Lib9c.ActionEvaluatorCommonComponents/PreEvaluationBlockMarshaller.cs
@@ -0,0 +1,41 @@
+using Bencodex;
+using Bencodex.Types;
+using Libplanet.Types.Blocks;
+
+namespace Lib9c.ActionEvaluatorCommonComponents
+{
+ public static class PreEvaluationBlockMarshaller
+ {
+ private static readonly Codec Codec = new Codec();
+
+ // Copied form Libplanet/Blocks/BlockMarshaler.cs
+ // Block fields:
+ private static readonly byte[] HeaderKey = { 0x48 }; // 'H'
+ private static readonly byte[] TransactionsKey = { 0x54 }; // 'T'
+
+ public static Dictionary Marshal(this IPreEvaluationBlock block)
+ {
+ return Dictionary.Empty
+ .Add(HeaderKey, BlockMarshaler.MarshalPreEvaluationBlockHeader(block))
+ .Add(TransactionsKey, new List(block.Transactions.Select(TransactionMarshaller.Serialize)));
+ }
+
+ public static IPreEvaluationBlock Unmarshal(Dictionary dictionary)
+ {
+ return new PreEvaluationBlock(
+ BlockMarshaler.UnmarshalPreEvaluationBlockHeader((Dictionary)dictionary[HeaderKey]),
+ BlockMarshaler.UnmarshalBlockTransactions(dictionary),
+ BlockMarshaler.UnmarshalBlockEvidence(dictionary));
+ }
+
+ public static byte[] Serialize(this IPreEvaluationBlock block)
+ {
+ return Codec.Encode(Marshal(block));
+ }
+
+ public static IPreEvaluationBlock Deserialize(byte[] serialized)
+ {
+ return Unmarshal((Dictionary)Codec.Decode(serialized));
+ }
+ }
+}
diff --git a/.Lib9c.ActionEvaluatorCommonComponents/Random.cs b/.Lib9c.ActionEvaluatorCommonComponents/Random.cs
new file mode 100644
index 0000000000..03782e5d90
--- /dev/null
+++ b/.Lib9c.ActionEvaluatorCommonComponents/Random.cs
@@ -0,0 +1,15 @@
+using Libplanet.Action;
+
+namespace Lib9c.ActionEvaluatorCommonComponents
+{
+ public class Random : System.Random, IRandom
+ {
+ public Random(int seed)
+ : base(seed)
+ {
+ Seed = seed;
+ }
+
+ public int Seed { get; private set; }
+ }
+}
diff --git a/.Lib9c.ActionEvaluatorCommonComponents/TransactionMarshaller.cs b/.Lib9c.ActionEvaluatorCommonComponents/TransactionMarshaller.cs
new file mode 100644
index 0000000000..d928fb606a
--- /dev/null
+++ b/.Lib9c.ActionEvaluatorCommonComponents/TransactionMarshaller.cs
@@ -0,0 +1,24 @@
+using Bencodex;
+using Bencodex.Types;
+using Libplanet.Types.Tx;
+
+namespace Lib9c.ActionEvaluatorCommonComponents
+{
+ public static class TransactionMarshaller
+ {
+ private static readonly Codec Codec = new Codec();
+
+ // Copied from Libplanet/Tx/TxMarshaler.cs
+ private static readonly Binary SignatureKey = new Binary(new byte[] { 0x53 }); // 'S'
+
+ public static Dictionary Marshal(this ITransaction transaction)
+ {
+ return transaction.MarshalUnsignedTx().Add(SignatureKey, transaction.Signature);
+ }
+
+ public static byte[] Serialize(this ITransaction transaction)
+ {
+ return Codec.Encode(Marshal(transaction));
+ }
+ }
+}
diff --git a/.Lib9c.Plugin.Shared/Lib9c.Plugin.Shared.csproj b/.Lib9c.Plugin.Shared/Lib9c.Plugin.Shared.csproj
index 132c02c59c..b9be2cc5bc 100644
--- a/.Lib9c.Plugin.Shared/Lib9c.Plugin.Shared.csproj
+++ b/.Lib9c.Plugin.Shared/Lib9c.Plugin.Shared.csproj
@@ -4,6 +4,8 @@
net6.0
enable
enable
+ .bin
+ .obj
diff --git a/.Lib9c.Plugin/Lib9c.Plugin.csproj b/.Lib9c.Plugin/Lib9c.Plugin.csproj
index 13a041c34a..264114aa55 100644
--- a/.Lib9c.Plugin/Lib9c.Plugin.csproj
+++ b/.Lib9c.Plugin/Lib9c.Plugin.csproj
@@ -8,7 +8,7 @@
-
+
false
diff --git a/.Lib9c.Plugin/PluginActionEvaluator.cs b/.Lib9c.Plugin/PluginActionEvaluator.cs
index 0a9c3366de..6fa175f3eb 100644
--- a/.Lib9c.Plugin/PluginActionEvaluator.cs
+++ b/.Lib9c.Plugin/PluginActionEvaluator.cs
@@ -3,7 +3,7 @@
using Lib9c.Plugin.Shared;
using Libplanet.Action;
using Libplanet.Common;
-using Libplanet.Extensions.ActionEvaluatorCommonComponents;
+using Lib9c.ActionEvaluatorCommonComponents;
using Libplanet.Store;
using Nekoyume.Action;
using Nekoyume.Action.Loader;
diff --git a/.Lib9c.Tests/Action/AdventureBoss/ClaimAdventureBossRewardTest.cs b/.Lib9c.Tests/Action/AdventureBoss/ClaimAdventureBossRewardTest.cs
index fbbfff5976..934f9fa19b 100644
--- a/.Lib9c.Tests/Action/AdventureBoss/ClaimAdventureBossRewardTest.cs
+++ b/.Lib9c.Tests/Action/AdventureBoss/ClaimAdventureBossRewardTest.cs
@@ -699,6 +699,7 @@ FungibleAssetValue expectedRemainingNcg
expectedRemainingNcg,
resultState.GetBalance(seasonBountyBoardAddress, NCG)
);
+ Assert.True(resultState.GetBalance(Addresses.RewardPool, NCG) > 0 * NCG);
Assert.True(resultState.GetExplorer(1, TesterAvatarAddress).Claimed);
if (anotherExplorerCount > 0)
diff --git a/.Lib9c.Tests/Action/AdventureBoss/UnlockFloorTest.cs b/.Lib9c.Tests/Action/AdventureBoss/UnlockFloorTest.cs
index 814e380c0a..47bd943375 100644
--- a/.Lib9c.Tests/Action/AdventureBoss/UnlockFloorTest.cs
+++ b/.Lib9c.Tests/Action/AdventureBoss/UnlockFloorTest.cs
@@ -12,6 +12,7 @@ namespace Lib9c.Tests.Action.AdventureBoss
using Nekoyume;
using Nekoyume.Action;
using Nekoyume.Action.AdventureBoss;
+ using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Model.Item;
using Nekoyume.Model.State;
using Nekoyume.Module;
@@ -84,7 +85,8 @@ public class UnlockFloorTest
.SetAgentState(WantedAddress, WantedState)
.SetAvatarState(TesterAvatarAddress, TesterAvatarState)
.SetAgentState(TesterAddress, TesterState)
- .MintAsset(new ActionContext(), WantedAddress, 1_000_000 * NCG);
+ .MintAsset(new ActionContext(), WantedAddress, 1_000_000 * NCG)
+ .SetDelegationMigrationHeight(0);
[Theory]
// Success
@@ -217,6 +219,10 @@ Type exc
var inventory = resultState.GetInventoryV2(TesterAvatarAddress);
Assert.Null(inventory.Items.FirstOrDefault(i => i.item.Id == 600202));
}
+ else
+ {
+ Assert.True(resultState.GetBalance(Addresses.RewardPool, NCG) > 0 * NCG);
+ }
Assert.Equal(
expectedFloor,
diff --git a/.Lib9c.Tests/Action/BuyMultipleTest.cs b/.Lib9c.Tests/Action/BuyMultipleTest.cs
index fb546b13c4..4fa2dfaa1f 100644
--- a/.Lib9c.Tests/Action/BuyMultipleTest.cs
+++ b/.Lib9c.Tests/Action/BuyMultipleTest.cs
@@ -264,7 +264,7 @@ public void Execute(params ShopItemData[] productDatas)
// Case for backward compatibility of `Buy`
if (product.ContainsInInventory)
{
- sellerAvatarState.inventory.AddItem2((ItemBase)nonFungibleItem);
+ sellerAvatarState.inventory.AddItem((ItemBase)nonFungibleItem);
}
var shopItemId = Guid.NewGuid();
diff --git a/.Lib9c.Tests/Action/BuyTest.cs b/.Lib9c.Tests/Action/BuyTest.cs
index b2e2fa7674..76560ca4b0 100644
--- a/.Lib9c.Tests/Action/BuyTest.cs
+++ b/.Lib9c.Tests/Action/BuyTest.cs
@@ -16,7 +16,6 @@ namespace Lib9c.Tests.Action
using Nekoyume;
using Nekoyume.Action;
using Nekoyume.Action.Guild.Migration.LegacyModels;
- using Nekoyume.Arena;
using Nekoyume.Model;
using Nekoyume.Model.Item;
using Nekoyume.Model.Mail;
@@ -26,7 +25,6 @@ namespace Lib9c.Tests.Action
using Serilog;
using Xunit;
using Xunit.Abstractions;
- using static Lib9c.SerializeKeys;
public class BuyTest
{
@@ -685,7 +683,7 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList)
var dummyItem = ItemFactory.CreateTradableMaterial(
_tableSheets.MaterialItemSheet.OrderedList.First(r => r.ItemSubType == ItemSubType.Hourglass));
- sellerAvatarState.inventory.AddItem2((ItemBase)dummyItem, orderDataList.Sum(x => x.ItemCount));
+ sellerAvatarState.inventory.AddItem((ItemBase)dummyItem, orderDataList.Sum(x => x.ItemCount));
foreach (var orderData in orderDataList)
{
@@ -724,7 +722,7 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList)
);
_initialState.SetAvatarState(orderData.SellerAvatarAddress, sellerAvatarState);
- var sellItem = order.Sell3(sellerAvatarState);
+ var sellItem = order.Sell(sellerAvatarState);
var orderDigest = order.Digest(sellerAvatarState, _tableSheets.CostumeStatSheet);
var digestListAddress = OrderDigestListState.DeriveAddress(firstData.SellerAvatarAddress);
@@ -767,9 +765,10 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList)
.SetLegacyState(orderDigestListState.Address, orderDigestListState.Serialize());
}
- var sumCount = orderDataList.Sum(x => x.ItemCount);
- Assert.Equal(1, sellerAvatarState.inventory.Items.Count);
- Assert.Equal(sumCount, sellerAvatarState.inventory.Items.First().count);
+ // 2 -> because Locked item see AddFungibleItem(ItemBase itemBase, int count = 1, ILock iLock = null)
+ Assert.Equal(2, sellerAvatarState.inventory.Items.Count);
+ Assert.Equal(orderDataList[0].ItemCount, sellerAvatarState.inventory.Items.First().count);
+ Assert.Equal(orderDataList[1].ItemCount, sellerAvatarState.inventory.Items.Last().count);
var buyAction = new Buy
{
diff --git a/.Lib9c.Tests/Action/CustomEquipmentCraft/CustomEquipmentCraftTest.cs b/.Lib9c.Tests/Action/CustomEquipmentCraft/CustomEquipmentCraftTest.cs
index 44f2a03ee0..9829f83c7c 100644
--- a/.Lib9c.Tests/Action/CustomEquipmentCraft/CustomEquipmentCraftTest.cs
+++ b/.Lib9c.Tests/Action/CustomEquipmentCraft/CustomEquipmentCraftTest.cs
@@ -1,7 +1,7 @@
-#nullable enable
-
namespace Lib9c.Tests.Action.CustomEquipmentCraft
{
+#nullable enable
+
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -16,6 +16,7 @@ namespace Lib9c.Tests.Action.CustomEquipmentCraft
using Nekoyume.Action.CustomEquipmentCraft;
using Nekoyume.Action.Exceptions;
using Nekoyume.Action.Exceptions.CustomEquipmentCraft;
+ using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Battle;
using Nekoyume.Exceptions;
using Nekoyume.Model.Elemental;
@@ -75,6 +76,7 @@ public CustomEquipmentCraftTest()
GameConfigState.Address,
new GameConfigState(sheets["GameConfigSheet"]).Serialize()
)
+ .SetDelegationMigrationHeight(0)
;
for (var i = 0; i < 4; i++)
@@ -371,6 +373,7 @@ public void Execute(
var gameConfig = state.GetGameConfigState();
var materialList = new List { ScrollItemId, CircleItemId, };
+ bool costExist = false;
if (enoughMaterials)
{
var relationshipSheet = _tableSheets.CustomEquipmentCraftRelationshipSheet;
@@ -411,6 +414,7 @@ public void Execute(
{
if (nextRow.GoldAmount > 0)
{
+ costExist = true;
state = state.MintAsset(
context,
_agentAddress,
@@ -488,6 +492,10 @@ public void Execute(
// Test
var gold = resultState.GetGoldCurrency();
Assert.Equal(0 * gold, resultState.GetBalance(_agentAddress, gold));
+ if (costExist)
+ {
+ Assert.True(resultState.GetBalance(Addresses.RewardPool, gold) > 0 * gold);
+ }
var inventory = resultState.GetInventoryV2(_avatarAddress);
foreach (var material in materialList)
diff --git a/.Lib9c.Tests/Action/Summon/CostumeSummonTest.cs b/.Lib9c.Tests/Action/Summon/CostumeSummonTest.cs
index 80b10c9236..f971573579 100644
--- a/.Lib9c.Tests/Action/Summon/CostumeSummonTest.cs
+++ b/.Lib9c.Tests/Action/Summon/CostumeSummonTest.cs
@@ -12,6 +12,7 @@
using Nekoyume;
using Nekoyume.Action;
using Nekoyume.Action.Exceptions;
+ using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Model.Item;
using Nekoyume.Model.State;
using Nekoyume.Module;
@@ -66,7 +67,8 @@ public CostumeSummonTest()
Addresses.GoldCurrency,
_agentAddress,
gold.Currency * 1000
- );
+ )
+ .SetDelegationMigrationHeight(0);
Assert.Equal(
gold.Currency * 99999999000,
@@ -146,6 +148,12 @@ Type expectedExc
inventory.TryGetItem((int)materialId!, out var resultMaterial);
Assert.Equal(0, resultMaterial?.count ?? 0);
+
+ var row = _tableSheets.CostumeSummonSheet[groupId];
+ if (row.CostNcg > 0)
+ {
+ Assert.True(nextState.GetBalance(Addresses.RewardPool, _currency) > 0 * _currency);
+ }
}
else
{
diff --git a/.Lib9c.Tests/Action/UnlockCombinationSlotTest.cs b/.Lib9c.Tests/Action/UnlockCombinationSlotTest.cs
index f742628c0d..a6829535b6 100644
--- a/.Lib9c.Tests/Action/UnlockCombinationSlotTest.cs
+++ b/.Lib9c.Tests/Action/UnlockCombinationSlotTest.cs
@@ -8,6 +8,8 @@
using Libplanet.Types.Assets;
using Nekoyume;
using Nekoyume.Action;
+ using Nekoyume.Action.Guild.Migration.LegacyModels;
+ using Nekoyume.Arena;
using Nekoyume.Extensions;
using Nekoyume.Model.Item;
using Nekoyume.Model.State;
@@ -147,6 +149,7 @@ public void Execute(int slotIndex)
var context = new ActionContext();
var state = Init(out var agentAddress, out var avatarAddress, out var blockIndex);
state = MintAssetForCost(state, slotIndex, context, agentAddress, avatarAddress);
+ state = state.SetDelegationMigrationHeight(0);
var action = new UnlockCombinationSlot()
{
AvatarAddress = avatarAddress,
@@ -164,12 +167,24 @@ public void Execute(int slotIndex)
state = action.Execute(ctx);
// Check Items
+ var costSheet = state.GetSheet();
+ var costRow = costSheet[slotIndex];
var ncgCurrency = state.GetGoldCurrency();
var ncgBalance = state.GetBalance(agentAddress, ncgCurrency);
var crystalBalance = state.GetBalance(agentAddress, Currencies.Crystal);
var inventory = state.GetInventoryV2(avatarAddress);
Assert.Equal("0", ncgBalance.GetQuantityString());
Assert.Equal("0", crystalBalance.GetQuantityString());
+ if (costRow.CrystalPrice > 0)
+ {
+ Assert.True(state.GetBalance(Addresses.RewardPool, Currencies.Crystal) > 0 * Currencies.Crystal);
+ }
+
+ if (costRow.NcgPrice > 0)
+ {
+ Assert.True(state.GetBalance(ArenaHelper.DeriveArenaAddress(0, 0), ncgCurrency) > 0 * ncgCurrency);
+ }
+
Assert.False(inventory.HasItem(GoldenDustId));
Assert.False(inventory.HasItem(RubyDustId));
diff --git a/.Lib9c.Tests/Model/Item/InventoryTest.cs b/.Lib9c.Tests/Model/Item/InventoryTest.cs
index 3204e7bafa..414f2944b9 100644
--- a/.Lib9c.Tests/Model/Item/InventoryTest.cs
+++ b/.Lib9c.Tests/Model/Item/InventoryTest.cs
@@ -59,17 +59,6 @@ public Inventory AddItem_Consumable()
return AddItem_Consumable_After(inventory);
}
- [Fact]
- public Inventory AddItem2_Consumable()
- {
- var item = GetFirstConsumable();
- var inventory = new Inventory();
- Assert.Empty(inventory.Items);
-
- inventory.AddItem2(item);
- return AddItem_Consumable_After(inventory);
- }
-
[Fact]
public Inventory AddItem_Costume()
{
@@ -81,17 +70,6 @@ public Inventory AddItem_Costume()
return AddItem_Costume_After(inventory);
}
- [Fact]
- public Inventory AddItem2_Costume()
- {
- var item = GetFirstCostume();
- var inventory = new Inventory();
- Assert.Empty(inventory.Items);
-
- inventory.AddItem2(item);
- return AddItem_Costume_After(inventory);
- }
-
[Theory]
[InlineData(1)]
[InlineData(2)]
@@ -109,23 +87,6 @@ public Inventory AddItem_Material(int count)
return AddItem_Material_After(inventory, count);
}
- [Theory]
- [InlineData(1)]
- [InlineData(2)]
- public Inventory AddItem2_Material(int count)
- {
- var item = GetFirstMaterial();
- var inventory = new Inventory();
- Assert.Empty(inventory.Items);
-
- for (var i = 0; i < count; i++)
- {
- inventory.AddItem2(item);
- }
-
- return AddItem_Material_After(inventory, count);
- }
-
[Fact]
public Inventory AddItem_Equipment()
{
@@ -137,17 +98,6 @@ public Inventory AddItem_Equipment()
return AddItem_Equipment_After(inventory);
}
- [Fact]
- public Inventory AddItem2_Equipment()
- {
- var item = GetFirstEquipment();
- var inventory = new Inventory();
- Assert.Empty(inventory.Items);
-
- inventory.AddItem2(item);
- return AddItem_Equipment_After(inventory);
- }
-
[Theory]
[InlineData(1)]
[InlineData(2)]
@@ -165,23 +115,6 @@ public Inventory AddItem_TradableMaterial(int count)
return AddItem_Material_After(inventory, count);
}
- [Theory]
- [InlineData(1)]
- [InlineData(2)]
- public Inventory AddItem2_TradableMaterial(int count)
- {
- var item = GetFirstTradableMaterial();
- var inventory = new Inventory();
- Assert.Empty(inventory.Items);
-
- for (var i = 0; i < count; i++)
- {
- inventory.AddItem2(item);
- }
-
- return AddItem_Material_After(inventory, count);
- }
-
[Theory]
[InlineData(1)]
[InlineData(2)]
@@ -195,19 +128,6 @@ public Inventory AddFungibleItem_Material(int count)
return AddItem_Material_After(inventory, count);
}
- [Theory]
- [InlineData(1)]
- [InlineData(2)]
- public Inventory AddFungibleItem2_Material(int count)
- {
- var item = GetFirstMaterial();
- var inventory = new Inventory();
- Assert.Empty(inventory.Items);
-
- inventory.AddFungibleItem2(item, count);
- return AddItem_Material_After(inventory, count);
- }
-
[Theory]
[InlineData(1)]
[InlineData(2)]
@@ -221,19 +141,6 @@ public Inventory AddFungibleItem_TradableMaterial(int count)
return AddItem_Material_After(inventory, count);
}
- [Theory]
- [InlineData(1)]
- [InlineData(2)]
- public Inventory AddFungibleItem2_TradableMaterial(int count)
- {
- var item = GetFirstTradableMaterial();
- var inventory = new Inventory();
- Assert.Empty(inventory.Items);
-
- inventory.AddFungibleItem2(item, count);
- return AddItem_Material_After(inventory, count);
- }
-
[Fact]
public Inventory AddNonFungibleItem_Consumable()
{
diff --git a/.Lib9c.Tests/Model/State/ShardedShopStateV2Test.cs b/.Lib9c.Tests/Model/State/ShardedShopStateV2Test.cs
index 811b96c731..4466c72d84 100644
--- a/.Lib9c.Tests/Model/State/ShardedShopStateV2Test.cs
+++ b/.Lib9c.Tests/Model/State/ShardedShopStateV2Test.cs
@@ -173,8 +173,8 @@ public void Remove()
var item2 = (Weapon)ItemFactory.CreateItem(
tableSheets.ItemSheet.Values.First(r => r.ItemSubType == ItemSubType.Weapon),
random);
- avatarState.inventory.AddItem2(item);
- avatarState.inventory.AddItem2(item2);
+ avatarState.inventory.AddItem(item);
+ avatarState.inventory.AddItem(item2);
var orderId = new Guid("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4");
var orderId2 = new Guid("936DA01F-9ABD-4d9d-80C7-02AF85C822A8");
diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs
deleted file mode 100644
index bd70afa433..0000000000
--- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System.Security.Cryptography;
-using Bencodex;
-using Bencodex.Types;
-using Libplanet.Action;
-using Libplanet.Common;
-using Libplanet.Crypto;
-using Libplanet.Types.Tx;
-using Boolean = Bencodex.Types.Boolean;
-
-namespace Libplanet.Extensions.ActionEvaluatorCommonComponents;
-
-public static class ActionContextMarshaller
-{
- private static readonly Codec Codec = new Codec();
-
- public static byte[] Serialize(this ICommittedActionContext actionContext)
- {
- return Codec.Encode(Marshal(actionContext));
- }
-
- public static Dictionary Marshal(this ICommittedActionContext actionContext)
- {
- var dictionary = Bencodex.Types.Dictionary.Empty
- .Add("signer", actionContext.Signer.ToHex())
- .Add("miner", actionContext.Miner.ToHex())
- .Add("block_index", actionContext.BlockIndex)
- .Add("block_protocol_version", actionContext.BlockProtocolVersion)
- .Add("previous_states", actionContext.PreviousState.ByteArray)
- .Add("random_seed", actionContext.RandomSeed)
- .Add("block_action", actionContext.IsPolicyAction);
-
- if (actionContext.TxId is { } txId)
- {
- dictionary = dictionary.Add("tx_id", txId.ByteArray);
- }
-
- return dictionary;
- }
-
- public static ICommittedActionContext Unmarshal(Dictionary dictionary)
- {
- return new CommittedActionContext(
- signer: new Address(((Text)dictionary["signer"]).Value),
- txId: dictionary.TryGetValue((Text)"tx_id", out IValue txIdValue) &&
- txIdValue is Binary txIdBinaryValue
- ? new TxId(txIdBinaryValue.ByteArray)
- : null,
- miner: new Address(((Text)dictionary["miner"]).Value),
- blockIndex: (Integer)dictionary["block_index"],
- blockProtocolVersion: (Integer)dictionary["block_protocol_version"],
- previousState: new HashDigest(dictionary["previous_states"]),
- randomSeed: (Integer)dictionary["random_seed"],
- isPolicyAction: (Boolean)dictionary["block_action"]
- );
- }
-
- public static ICommittedActionContext Deserialize(byte[] serialized)
- {
- var decoded = Codec.Decode(serialized);
- if (!(decoded is Dictionary dictionary))
- {
- throw new ArgumentException($"Expected 'Dictionary' but {decoded.GetType().Name}", nameof(serialized));
- }
-
- return Unmarshal(dictionary);
- }
-}
diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs
deleted file mode 100644
index 408843b61e..0000000000
--- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System.Security.Cryptography;
-using Bencodex;
-using Bencodex.Types;
-using Libplanet.Action;
-using Libplanet.Common;
-
-namespace Libplanet.Extensions.ActionEvaluatorCommonComponents;
-
-public static class ActionEvaluationMarshaller
-{
- private static readonly Codec Codec = new Codec();
-
- public static byte[] Serialize(this ICommittedActionEvaluation actionEvaluation)
- {
- return Codec.Encode(Marshal(actionEvaluation));
- }
-
- public static Dictionary Marshal(this ICommittedActionEvaluation actionEvaluation) =>
- Dictionary.Empty
- .Add("action", actionEvaluation.Action)
- .Add("output_states", actionEvaluation.OutputState.ByteArray)
- .Add("input_context", actionEvaluation.InputContext.Marshal())
- .Add("exception", actionEvaluation.Exception?.GetType().FullName is { } typeName ? (Text)typeName : Null.Value);
-
- public static ICommittedActionEvaluation Unmarshal(IValue value)
- {
- if (value is not Dictionary dictionary)
- {
- throw new ArgumentException(nameof(value));
- }
-
- return new CommittedActionEvaluation(
- dictionary["action"],
- ActionContextMarshaller.Unmarshal((Dictionary)dictionary["input_context"]),
- new HashDigest(dictionary["output_states"]),
- dictionary["exception"] is Text typeName ? new Exception(typeName) : null
- );
- }
-
- public static ICommittedActionEvaluation Deserialize(byte[] serialized)
- {
- var decoded = Codec.Decode(serialized);
- return Unmarshal(decoded);
- }
-}
diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/PreEvaluationBlockMarshaller.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/PreEvaluationBlockMarshaller.cs
deleted file mode 100644
index cb7a1630d5..0000000000
--- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/PreEvaluationBlockMarshaller.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using Bencodex;
-using Bencodex.Types;
-using Libplanet.Types.Blocks;
-
-namespace Libplanet.Extensions.ActionEvaluatorCommonComponents;
-
-public static class PreEvaluationBlockMarshaller
-{
- private static readonly Codec Codec = new Codec();
-
- // Copied form Libplanet/Blocks/BlockMarshaler.cs
- // Block fields:
- private static readonly byte[] HeaderKey = { 0x48 }; // 'H'
- private static readonly byte[] TransactionsKey = { 0x54 }; // 'T'
-
- public static Dictionary Marshal(this IPreEvaluationBlock block)
- {
- return Dictionary.Empty
- .Add(HeaderKey, BlockMarshaler.MarshalPreEvaluationBlockHeader(block))
- .Add(TransactionsKey, new List(block.Transactions.Select(TransactionMarshaller.Serialize)));
- }
-
- public static IPreEvaluationBlock Unmarshal(Dictionary dictionary)
- {
- return new PreEvaluationBlock(
- BlockMarshaler.UnmarshalPreEvaluationBlockHeader((Dictionary)dictionary[HeaderKey]),
- BlockMarshaler.UnmarshalBlockTransactions(dictionary),
- BlockMarshaler.UnmarshalBlockEvidence(dictionary));
- }
-
- public static byte[] Serialize(this IPreEvaluationBlock block)
- {
- return Codec.Encode(Marshal(block));
- }
-
- public static IPreEvaluationBlock Deserialize(byte[] serialized)
- {
- return Unmarshal((Dictionary)Codec.Decode(serialized));
- }
-}
diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/Random.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/Random.cs
deleted file mode 100644
index f1006cc56e..0000000000
--- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/Random.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using Libplanet.Action;
-
-namespace Libplanet.Extensions.ActionEvaluatorCommonComponents;
-
-public class Random : System.Random, IRandom
-{
- public Random(int seed)
- : base(seed)
- {
- Seed = seed;
- }
-
- public int Seed { get; private set; }
-}
diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/TransactionMarshaller.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/TransactionMarshaller.cs
deleted file mode 100644
index 06dfbcb5e9..0000000000
--- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/TransactionMarshaller.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Bencodex;
-using Bencodex.Types;
-using Libplanet.Types.Tx;
-
-namespace Libplanet.Extensions.ActionEvaluatorCommonComponents;
-
-public static class TransactionMarshaller
-{
- private static readonly Codec Codec = new Codec();
-
- // Copied from Libplanet/Tx/TxMarshaler.cs
- private static readonly Binary SignatureKey = new Binary(new byte[] { 0x53 }); // 'S'
-
- public static Dictionary Marshal(this ITransaction transaction)
- {
- return transaction.MarshalUnsignedTx().Add(SignatureKey, transaction.Signature);
- }
-
- public static byte[] Serialize(this ITransaction transaction)
- {
- return Codec.Encode(Marshal(transaction));
- }
-}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index e22eda3056..232d301007 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -32,7 +32,8 @@ jobs:
if: github.event_name != 'pull_request'
run: |
if [[ "$NUGET_API_KEY" != "" ]]; then
- for project in Lib9c Lib9c.Abstractions Lib9c.MessagePack Lib9c.Renderers Lib9c.Policy .Lib9c.Plugin.Shared
+ for project in Lib9c Lib9c.Abstractions Lib9c.MessagePack Lib9c.Renderers \
+ Lib9c.Policy .Lib9c.Plugin.Shared .Lib9c.ActionEvaluatorCommonComponents
do
dotnet nuget push ./$project/.bin/Lib9c.*.nupkg \
--api-key "$NUGET_API_KEY" \
diff --git a/Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs b/Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs
index 95f2db314d..eba7879a72 100644
--- a/Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs
+++ b/Lib9c.DevExtensions/Manager/Contents/CreateAvatarManager.cs
@@ -21,6 +21,9 @@ namespace Lib9c.DevExtensions.Manager.Contents
///
public static class CreateAvatarManager
{
+ // TODO: Costume과 Grimoire, Aura에 한해 하드코딩같은 형태로 구현되어 있음. 추후 수정 필요.
+ private const int AddItemCount = 10;
+
///
/// Create an avatar and world state for testing.
///
@@ -28,8 +31,9 @@ public static class CreateAvatarManager
/// avatar address
/// base world state
/// avatar state
+ /// random object
/// world state with dev avatar
- public static IWorld ExecuteDevExtensions(IActionContext ctx, Address avatarAddress, IWorld states, AvatarState avatarState)
+ public static IWorld ExecuteDevExtensions(IActionContext ctx, Address avatarAddress, IWorld states, AvatarState avatarState, IRandom random)
{
// prepare for test when executing on editor mode.
var data = TestbedHelper.LoadData("TestbedCreateAvatar");
@@ -49,7 +53,6 @@ public static IWorld ExecuteDevExtensions(IActionContext ctx, Address avatarAddr
var characterLevelSheet = states.GetSheet();
var enhancementCostSheet = states.GetSheet();
var materialItemSheet = states.GetSheet();
- var random = ctx.GetRandom();
AddTestItems(ctx, avatarState, random, materialItemSheet);
@@ -252,17 +255,19 @@ private static void AddItemsForTest(
int tradableMaterialCount,
int foodCount)
{
- foreach (var row in costumeItemSheet.OrderedList)
+ for (var i = 0; i < AddItemCount; ++i)
{
- avatarState.inventory.AddItem(ItemFactory.CreateCostume(row, random.GenerateRandomGuid()));
+ foreach (var row in costumeItemSheet.OrderedList)
+ {
+ avatarState.inventory.AddItem(ItemFactory.CreateCostume(row, random.GenerateRandomGuid()));
+ }
}
foreach (var row in materialItemSheet.OrderedList)
{
avatarState.inventory.AddItem(ItemFactory.CreateMaterial(row), materialCount);
- if (row.ItemSubType == ItemSubType.Hourglass ||
- row.ItemSubType == ItemSubType.ApStone)
+ if (row.ItemSubType is ItemSubType.Hourglass || row.ItemSubType is ItemSubType.ApStone)
{
avatarState.inventory.AddItem(ItemFactory.CreateTradableMaterial(row), tradableMaterialCount);
}
@@ -271,8 +276,14 @@ private static void AddItemsForTest(
foreach (var row in equipmentItemSheet.OrderedList.Where(row =>
row.Id > GameConfig.DefaultAvatarWeaponId))
{
- var itemId = random.GenerateRandomGuid();
- avatarState.inventory.AddItem(ItemFactory.CreateItemUsable(row, itemId, default));
+ if (row.ItemSubType is ItemSubType.Grimoire || row.ItemSubType is ItemSubType.Aura)
+ {
+ for (var i = 0; i < AddItemCount; ++i)
+ {
+ avatarState.inventory.AddItem(ItemFactory.CreateItemUsable(row, random.GenerateRandomGuid(), default));
+ }
+ }
+ avatarState.inventory.AddItem(ItemFactory.CreateItemUsable(row, random.GenerateRandomGuid(), default));
}
foreach (var row in consumableItemSheet.OrderedList)
diff --git a/Lib9c.sln b/Lib9c.sln
index dd95de8b5a..7cf802e8c6 100644
--- a/Lib9c.sln
+++ b/Lib9c.sln
@@ -38,9 +38,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c.Utils", "Lib9c.Utils\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c.Proposer", "Lib9c.Proposer\Lib9c.Proposer.csproj", "{7DC1D595-095D-462A-864D-0CE57915901A}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Extensions.ActionEvaluatorCommonComponents", ".Libplanet.Extensions.ActionEvaluatorCommonComponents\Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj", "{64C44AFB-1E14-44D3-B236-A4A37DF2C27A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c.ActionEvaluatorCommonComponents", ".Lib9c.ActionEvaluatorCommonComponents\Lib9c.ActionEvaluatorCommonComponents.csproj", "{64C44AFB-1E14-44D3-B236-A4A37DF2C27A}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests", ".Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests\Libplanet.Extensions.ActionEvaluatorCommonComponents.Tests.csproj", "{EACB2E8D-9A13-491C-BACD-5D79C6C13783}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c.ActionEvaluatorCommonComponents.Tests", ".Lib9c.ActionEvaluatorCommonComponents.Tests\Lib9c.ActionEvaluatorCommonComponents.Tests.csproj", "{EACB2E8D-9A13-491C-BACD-5D79C6C13783}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c.Plugin", ".Lib9c.Plugin\Lib9c.Plugin.csproj", "{484A5A5B-D610-42D4-9CAC-B19EA1A71281}"
EndProject
diff --git a/Lib9c/Action/AdventureBoss/ClaimAdventureBossReward.cs b/Lib9c/Action/AdventureBoss/ClaimAdventureBossReward.cs
index cfe7ea39ca..412cc228d8 100644
--- a/Lib9c/Action/AdventureBoss/ClaimAdventureBossReward.cs
+++ b/Lib9c/Action/AdventureBoss/ClaimAdventureBossReward.cs
@@ -9,6 +9,8 @@
using Libplanet.Crypto;
using Libplanet.Types.Assets;
using Nekoyume.Action.Exceptions;
+using Nekoyume.Action.Guild.Migration.LegacyModels;
+using Nekoyume.Arena;
using Nekoyume.Data;
using Nekoyume.Exceptions;
using Nekoyume.Helper;
@@ -133,9 +135,16 @@ public override IWorld Execute(IActionContext context)
states.GetBalance(seasonBountyBoardAddress, bountyBoard.totalBounty().Currency)
)
{
+ var feeAddress = Addresses.RewardPool;
+ // TODO: [GuildMigration] Remove this after migration
+ if (states.GetDelegationMigrationHeight() is long migrationHeight
+ && context.BlockIndex < migrationHeight)
+ {
+ feeAddress = AdventureBossGameData.AdventureBossOperationalAddress;
+ }
+
states = states.TransferAsset(context, seasonBountyBoardAddress,
- // FIXME: Set operational account address
- AdventureBossGameData.AdventureBossOperationalAddress,
+ feeAddress,
(bountyBoard.totalBounty() * 80).DivRem(100, out _)
);
}
diff --git a/Lib9c/Action/AdventureBoss/UnlockFloor.cs b/Lib9c/Action/AdventureBoss/UnlockFloor.cs
index fbebd0b082..37584e64ff 100644
--- a/Lib9c/Action/AdventureBoss/UnlockFloor.cs
+++ b/Lib9c/Action/AdventureBoss/UnlockFloor.cs
@@ -7,6 +7,7 @@
using Libplanet.Action.State;
using Libplanet.Crypto;
using Nekoyume.Action.Exceptions.AdventureBoss;
+using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Data;
using Nekoyume.Exceptions;
using Nekoyume.Extensions;
@@ -129,7 +130,7 @@ public override IWorld Execute(IActionContext context)
var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress);
throw new FailedLoadStateException($"{addressesHex}Aborted as the avatar state of the signer was failed to load.");
}
-
+
var agentAddress = avatarState.agentAddress;
var balance = states.GetBalance(agentAddress, currency);
var exploreBoard = states.GetExploreBoard(Season);
@@ -145,8 +146,15 @@ public override IWorld Execute(IActionContext context)
explorer.UsedNcg += price.NcgPrice;
exploreBoard.UsedNcg += price.NcgPrice;
+ var feeAddress = Addresses.RewardPool;
+ // TODO: [GuildMigration] Remove this after migration
+ if (states.GetDelegationMigrationHeight() is long migrationHeight
+ && context.BlockIndex < migrationHeight)
+ {
+ feeAddress = AdventureBossGameData.AdventureBossOperationalAddress;
+ }
states = states.TransferAsset(context, agentAddress,
- AdventureBossGameData.AdventureBossOperationalAddress,
+ feeAddress,
price.NcgPrice * currency);
}
else // Use GoldenDust
diff --git a/Lib9c/Action/AuraSummon.cs b/Lib9c/Action/AuraSummon.cs
index fb0aa96087..c6ad74202a 100644
--- a/Lib9c/Action/AuraSummon.cs
+++ b/Lib9c/Action/AuraSummon.cs
@@ -210,15 +210,7 @@ public override IWorld Execute(IActionContext context)
// Transfer Cost NCG first for fast-fail
if (summonRow.CostNcg > 0L)
{
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(
context,
diff --git a/Lib9c/Action/BattleArena.cs b/Lib9c/Action/BattleArena.cs
index c413843398..64cf2f9aa5 100644
--- a/Lib9c/Action/BattleArena.cs
+++ b/Lib9c/Action/BattleArena.cs
@@ -331,13 +331,7 @@ public override IWorld Execute(IActionContext context)
purchasedCountDuringInterval++;
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- feeAddress = ArenaHelper.DeriveArenaAddress(roundData.ChampionshipId, roundData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states
.TransferAsset(context, context.Signer, feeAddress, ticketBalance)
diff --git a/Lib9c/Action/Buy.cs b/Lib9c/Action/Buy.cs
index a202e16be0..1fc47fadf0 100644
--- a/Lib9c/Action/Buy.cs
+++ b/Lib9c/Action/Buy.cs
@@ -12,6 +12,7 @@
using Libplanet.Types.Assets;
using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Arena;
+using Nekoyume.Extensions;
using Nekoyume.Model.EnumType;
using Nekoyume.Model.Mail;
using Nekoyume.Model.State;
@@ -251,15 +252,7 @@ public override IWorld Execute(IActionContext context)
var taxedPrice = order.Price - tax;
// Transfer tax.
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states
.TransferAsset(context, context.Signer, feeAddress, tax);
diff --git a/Lib9c/Action/Buy7.cs b/Lib9c/Action/Buy7.cs
index a2e6bcf991..87b712e439 100644
--- a/Lib9c/Action/Buy7.cs
+++ b/Lib9c/Action/Buy7.cs
@@ -427,7 +427,7 @@ public override IWorld Execute(IActionContext context)
buyerAvatarState.Update(buyerMail);
if (purchaseResult.itemUsable != null)
{
- buyerAvatarState.UpdateFromAddItem2(purchaseResult.itemUsable, false);
+ buyerAvatarState.UpdateFromAddItem(purchaseResult.itemUsable, false);
}
if (purchaseResult.costume != null)
@@ -437,7 +437,7 @@ public override IWorld Execute(IActionContext context)
if (purchaseResult.tradableFungibleItem is TradableMaterial material)
{
- buyerAvatarState.UpdateFromAddItem2(material, shopItem.TradableFungibleItemCount, false);
+ buyerAvatarState.UpdateFromAddItem(material, shopItem.TradableFungibleItemCount, false);
}
sellerAvatarState.Update(sellerMail);
@@ -449,8 +449,8 @@ public override IWorld Execute(IActionContext context)
sellerAvatarState.updatedAt = ctx.BlockIndex;
sellerAvatarState.blockIndex = ctx.BlockIndex;
- buyerAvatarState.UpdateQuestRewards2(materialSheet);
- sellerAvatarState.UpdateQuestRewards2(materialSheet);
+ buyerAvatarState.UpdateQuestRewards(materialSheet);
+ sellerAvatarState.UpdateQuestRewards(materialSheet);
states = states.SetAvatarState(sellerAvatarAddress, sellerAvatarState);
sw.Stop();
diff --git a/Lib9c/Action/BuyMultiple.cs b/Lib9c/Action/BuyMultiple.cs
index 3d44122c48..9510786236 100644
--- a/Lib9c/Action/BuyMultiple.cs
+++ b/Lib9c/Action/BuyMultiple.cs
@@ -384,7 +384,7 @@ public override IWorld Execute(IActionContext context)
buyerAvatarState.Update(buyerMail);
if (purchaseResult.itemUsable != null)
{
- buyerAvatarState.UpdateFromAddItem2(purchaseResult.itemUsable, false);
+ buyerAvatarState.UpdateFromAddItem(purchaseResult.itemUsable, false);
}
if (purchaseResult.costume != null)
{
@@ -398,7 +398,7 @@ public override IWorld Execute(IActionContext context)
sellerAvatarState.updatedAt = ctx.BlockIndex;
sellerAvatarState.blockIndex = ctx.BlockIndex;
- sellerAvatarState.UpdateQuestRewards2(materialSheet);
+ sellerAvatarState.UpdateQuestRewards(materialSheet);
sw.Restart();
states = states.SetAvatarState(productInfo.sellerAvatarAddress, sellerAvatarState);
@@ -412,7 +412,7 @@ public override IWorld Execute(IActionContext context)
buyerAvatarState.updatedAt = ctx.BlockIndex;
buyerAvatarState.blockIndex = ctx.BlockIndex;
- buyerAvatarState.UpdateQuestRewards2(materialSheet);
+ buyerAvatarState.UpdateQuestRewards(materialSheet);
sw.Restart();
states = states.SetAvatarState(buyerAvatarAddress, buyerAvatarState);
diff --git a/Lib9c/Action/BuyProduct.cs b/Lib9c/Action/BuyProduct.cs
index 3ffe6d8fe3..285f837f79 100644
--- a/Lib9c/Action/BuyProduct.cs
+++ b/Lib9c/Action/BuyProduct.cs
@@ -12,6 +12,7 @@
using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Arena;
using Nekoyume.Battle;
+using Nekoyume.Extensions;
using Nekoyume.Model.EnumType;
using Nekoyume.Model.Item;
using Nekoyume.Model.Mail;
@@ -176,15 +177,7 @@ private IWorld Buy(IActionContext context, IProductInfo productInfo, Address sel
var receipt = new ProductReceipt(productId, sellerAvatarAddress, buyerAvatarState.address, product.Price,
context.BlockIndex);
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states
.RemoveLegacyState(productAddress)
@@ -308,15 +301,7 @@ private static IWorld Buy_Order(PurchaseInfo purchaseInfo, IActionContext contex
var taxedPrice = order.Price - tax;
// Transfer tax.
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(
context,
diff --git a/Lib9c/Action/CombinationConsumable5.cs b/Lib9c/Action/CombinationConsumable5.cs
index e7335242a5..8353caf6e0 100644
--- a/Lib9c/Action/CombinationConsumable5.cs
+++ b/Lib9c/Action/CombinationConsumable5.cs
@@ -236,13 +236,13 @@ public override IWorld Execute(IActionContext context)
);
result.id = mail.id;
avatarState.Update(mail);
- avatarState.UpdateFromCombination2(itemUsable);
+ avatarState.UpdateFromCombination(itemUsable);
sw.Stop();
Log.Verbose("{AddressesHex}Combination Update AvatarState: {Elapsed}", addressesHex, sw.Elapsed);
sw.Restart();
var materialSheet = states.GetSheet();
- avatarState.UpdateQuestRewards2(materialSheet);
+ avatarState.UpdateQuestRewards(materialSheet);
avatarState.updatedAt = ctx.BlockIndex;
avatarState.blockIndex = ctx.BlockIndex;
diff --git a/Lib9c/Action/CombinationEquipment.cs b/Lib9c/Action/CombinationEquipment.cs
index 405610e32a..f30ed9605e 100644
--- a/Lib9c/Action/CombinationEquipment.cs
+++ b/Lib9c/Action/CombinationEquipment.cs
@@ -376,16 +376,7 @@ public override IWorld Execute(IActionContext context)
if (costNcg > 0L)
{
// Transfer tax.
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
-
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(
context,
context.Signer,
diff --git a/Lib9c/Action/CostumeSummon.cs b/Lib9c/Action/CostumeSummon.cs
index 353f4b8643..8c4c5ae746 100644
--- a/Lib9c/Action/CostumeSummon.cs
+++ b/Lib9c/Action/CostumeSummon.cs
@@ -8,6 +8,7 @@
using Libplanet.Action.State;
using Libplanet.Crypto;
using Nekoyume.Action.Exceptions;
+using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Arena;
using Nekoyume.Extensions;
using Nekoyume.Helper;
@@ -161,15 +162,12 @@ public override IWorld Execute(IActionContext context)
// Transfer Cost NCG first for fast-fail
if (summonRow.CostNcg > 0L)
{
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- var feeStoreAddress =
- ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(
context,
context.Signer,
- feeStoreAddress,
+ feeAddress,
states.GetGoldCurrency() * summonRow.CostNcg * SummonCount
);
}
diff --git a/Lib9c/Action/CreateAvatar.cs b/Lib9c/Action/CreateAvatar.cs
index d283b217a4..a5bc51b928 100644
--- a/Lib9c/Action/CreateAvatar.cs
+++ b/Lib9c/Action/CreateAvatar.cs
@@ -80,6 +80,7 @@ public override IWorld Execute(IActionContext context)
)
);
+ var random = ctx.GetRandom();
var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress);
ValidateName(addressesHex);
@@ -110,7 +111,7 @@ public override IWorld Execute(IActionContext context)
avatarState.UpdateQuestRewards(materialItemSheet);
#if LIB9C_DEV_EXTENSIONS || UNITY_EDITOR
- states = CreateAvatarManager.ExecuteDevExtensions(ctx, avatarAddress, states, avatarState);
+ states = CreateAvatarManager.ExecuteDevExtensions(ctx, avatarAddress, states, avatarState, random);
#endif
var sheets = ctx.PreviousState.GetSheets(containItemSheet: true,
@@ -120,7 +121,7 @@ public override IWorld Execute(IActionContext context)
});
var itemSheet = sheets.GetItemSheet();
var createAvatarItemSheet = sheets.GetSheet();
- AddItem(itemSheet, createAvatarItemSheet, avatarState, context.GetRandom());
+ AddItem(itemSheet, createAvatarItemSheet, avatarState, random);
var createAvatarFavSheet = sheets.GetSheet();
states = MintAsset(createAvatarFavSheet, avatarState, states, context);
@@ -257,7 +258,6 @@ public static AvatarState CreateAvatarState(string name,
Address rankingMapAddress)
{
var state = ctx.PreviousState;
- var random = ctx.GetRandom();
var avatarState = AvatarState.Create(
avatarAddress,
ctx.Signer,
diff --git a/Lib9c/Action/CustomEquipmentCraft/CustomEquipmentCraft.cs b/Lib9c/Action/CustomEquipmentCraft/CustomEquipmentCraft.cs
index 9ca9d6e823..6aaa1c81bf 100644
--- a/Lib9c/Action/CustomEquipmentCraft/CustomEquipmentCraft.cs
+++ b/Lib9c/Action/CustomEquipmentCraft/CustomEquipmentCraft.cs
@@ -6,6 +6,7 @@
using Libplanet.Action.State;
using Libplanet.Crypto;
using Nekoyume.Action.Exceptions;
+using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Arena;
using Nekoyume.Battle;
using Nekoyume.Exceptions;
@@ -192,11 +193,8 @@ public override IWorld Execute(IActionContext context)
if (ncgCost > 0)
{
- var arenaData = sheets.GetSheet()
- .GetRoundByBlockIndex(context.BlockIndex);
- states = states.TransferAsset(context, context.Signer,
- ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round),
- ncgCost * states.GetGoldCurrency());
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
+ states = states.TransferAsset(context, context.Signer, feeAddress, ncgCost * states.GetGoldCurrency());
}
foreach (var (itemId, amount) in materialCosts)
diff --git a/Lib9c/Action/DailyReward2.cs b/Lib9c/Action/DailyReward2.cs
index ff3b509a36..81eaa71c2b 100644
--- a/Lib9c/Action/DailyReward2.cs
+++ b/Lib9c/Action/DailyReward2.cs
@@ -80,7 +80,7 @@ public override IWorld Execute(IActionContext context)
result.id = mail.id;
dailyRewardResult = result;
avatarState.Update(mail);
- avatarState.UpdateFromAddItem2(material, rewardItemCount, false);
+ avatarState.UpdateFromAddItem(material, rewardItemCount, false);
return states.SetAvatarState(avatarAddress, avatarState);
}
diff --git a/Lib9c/Action/ItemEnhancement.cs b/Lib9c/Action/ItemEnhancement.cs
index 773c4b3783..3d8a257d35 100644
--- a/Lib9c/Action/ItemEnhancement.cs
+++ b/Lib9c/Action/ItemEnhancement.cs
@@ -373,15 +373,7 @@ public override IWorld Execute(IActionContext context)
var requiredNcg = targetCostRow.Cost - startCostRow.Cost;
if (requiredNcg > 0)
{
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(ctx, ctx.Signer, feeAddress,
states.GetGoldCurrency() * requiredNcg);
diff --git a/Lib9c/Action/ItemEnhancement11.cs b/Lib9c/Action/ItemEnhancement11.cs
index 23fd47b565..b1c1941965 100644
--- a/Lib9c/Action/ItemEnhancement11.cs
+++ b/Lib9c/Action/ItemEnhancement11.cs
@@ -291,15 +291,7 @@ public override IWorld Execute(IActionContext context)
var requiredNcg = row.Cost;
if (requiredNcg > 0)
{
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(ctx, ctx.Signer, feeAddress, states.GetGoldCurrency() * requiredNcg);
}
diff --git a/Lib9c/Action/ItemEnhancement12.cs b/Lib9c/Action/ItemEnhancement12.cs
index 10fc68c4e2..596a1a9060 100644
--- a/Lib9c/Action/ItemEnhancement12.cs
+++ b/Lib9c/Action/ItemEnhancement12.cs
@@ -363,15 +363,7 @@ public override IWorld Execute(IActionContext context)
var requiredNcg = targetCostRow.Cost - startCostRow.Cost;
if (requiredNcg > 0)
{
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(ctx, ctx.Signer, feeAddress,
states.GetGoldCurrency() * requiredNcg);
diff --git a/Lib9c/Action/ItemEnhancement13.cs b/Lib9c/Action/ItemEnhancement13.cs
index 2f866d1578..5225351068 100644
--- a/Lib9c/Action/ItemEnhancement13.cs
+++ b/Lib9c/Action/ItemEnhancement13.cs
@@ -366,15 +366,7 @@ public override IWorld Execute(IActionContext context)
var requiredNcg = targetCostRow.Cost - startCostRow.Cost;
if (requiredNcg > 0)
{
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(ctx, ctx.Signer, feeAddress,
states.GetGoldCurrency() * requiredNcg);
diff --git a/Lib9c/Action/ItemEnhancement7.cs b/Lib9c/Action/ItemEnhancement7.cs
index c01a9e1ad3..2860e34941 100644
--- a/Lib9c/Action/ItemEnhancement7.cs
+++ b/Lib9c/Action/ItemEnhancement7.cs
@@ -265,10 +265,10 @@ public override IWorld Execute(IActionContext context)
avatarState.inventory.RemoveNonFungibleItem(enhancementEquipment);
avatarState.Update(mail);
- avatarState.UpdateFromItemEnhancement2(enhancementEquipment);
+ avatarState.UpdateFromItemEnhancement(enhancementEquipment);
var materialSheet = states.GetSheet();
- avatarState.UpdateQuestRewards2(materialSheet);
+ avatarState.UpdateQuestRewards(materialSheet);
slotState.Update(result, ctx.BlockIndex, requiredBlockIndex);
diff --git a/Lib9c/Action/JoinArena.cs b/Lib9c/Action/JoinArena.cs
index 0de20477d8..aff907f656 100644
--- a/Lib9c/Action/JoinArena.cs
+++ b/Lib9c/Action/JoinArena.cs
@@ -92,7 +92,7 @@ public override IWorld Execute(IActionContext context)
$"[{nameof(JoinArena)}] Aborted as the avatar state of the signer was failed to load.");
}
- // check the avatar already joined the arena.
+ // check the avatar already joined the arena.
if (states.GetArenaParticipant(championshipId, round, avatarAddress) is not null)
{
throw new AlreadyJoinedArenaException(championshipId, round, avatarAddress);
@@ -174,13 +174,7 @@ public override IWorld Execute(IActionContext context)
$"required {fee}, but balance is {crystalBalance}");
}
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- feeAddress = ArenaHelper.DeriveArenaAddress(roundData.ChampionshipId, roundData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(context, context.Signer, feeAddress, fee);
}
diff --git a/Lib9c/Action/JoinArena1.cs b/Lib9c/Action/JoinArena1.cs
index 5ac087ace0..d391483034 100644
--- a/Lib9c/Action/JoinArena1.cs
+++ b/Lib9c/Action/JoinArena1.cs
@@ -146,13 +146,7 @@ public override IWorld Execute(IActionContext context)
$"required {fee}, but balance is {crystalBalance}");
}
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- feeAddress = ArenaHelper.DeriveArenaAddress(roundData.ChampionshipId, roundData.Round);
- }
+var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(context, context.Signer, feeAddress, fee);
}
diff --git a/Lib9c/Action/JoinArena3.cs b/Lib9c/Action/JoinArena3.cs
index 7573de49e7..c6873118b1 100644
--- a/Lib9c/Action/JoinArena3.cs
+++ b/Lib9c/Action/JoinArena3.cs
@@ -163,13 +163,7 @@ public override IWorld Execute(IActionContext context)
$"required {fee}, but balance is {crystalBalance}");
}
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- feeAddress = ArenaHelper.DeriveArenaAddress(roundData.ChampionshipId, roundData.Round);
- }
+var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(context, context.Signer, feeAddress, fee);
}
diff --git a/Lib9c/Action/PetEnhancement.cs b/Lib9c/Action/PetEnhancement.cs
index 31194dec54..a49eac06dc 100644
--- a/Lib9c/Action/PetEnhancement.cs
+++ b/Lib9c/Action/PetEnhancement.cs
@@ -139,15 +139,7 @@ public override IWorld Execute(IActionContext context)
currentNcg);
}
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(context, context.Signer, feeAddress, ncgCost);
}
diff --git a/Lib9c/Action/Raid.cs b/Lib9c/Action/Raid.cs
index 3e6a335749..1cef0b108d 100644
--- a/Lib9c/Action/Raid.cs
+++ b/Lib9c/Action/Raid.cs
@@ -151,15 +151,7 @@ public override IWorld Execute(IActionContext context)
}
var goldCurrency = states.GetGoldCurrency();
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(context, context.Signer, feeAddress,
WorldBossHelper.CalculateTicketPrice(row, raiderState, goldCurrency));
diff --git a/Lib9c/Action/RedeemCode2.cs b/Lib9c/Action/RedeemCode2.cs
index c0c93c3c71..fbd3654a98 100644
--- a/Lib9c/Action/RedeemCode2.cs
+++ b/Lib9c/Action/RedeemCode2.cs
@@ -90,7 +90,7 @@ public override IWorld Execute(IActionContext context)
ItemBase item = ItemFactory.CreateItem(itemSheets[itemId], random);
// We should fix count as 1 because ItemFactory.CreateItem
// will create a new item every time.
- avatarState.inventory.AddItem2(item, count: 1);
+ avatarState.inventory.AddItem(item, count: 1);
}
}
break;
diff --git a/Lib9c/Action/RuneEnhancement.cs b/Lib9c/Action/RuneEnhancement.cs
index d01babfd8d..83334e688a 100644
--- a/Lib9c/Action/RuneEnhancement.cs
+++ b/Lib9c/Action/RuneEnhancement.cs
@@ -153,15 +153,7 @@ public override IWorld Execute(IActionContext context)
runeState.LevelUp(levelUpResult.LevelUpCount);
states = states.SetRuneState(AvatarAddress, allRuneState);
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
// Burn costs
if (levelUpResult.NcgCost > 0)
diff --git a/Lib9c/Action/RuneSummon.cs b/Lib9c/Action/RuneSummon.cs
index 61b40cb22c..c5faa3ce5e 100644
--- a/Lib9c/Action/RuneSummon.cs
+++ b/Lib9c/Action/RuneSummon.cs
@@ -91,15 +91,7 @@ public override IWorld Execute(IActionContext context)
// Transfer Cost NCG first for fast-fail
if (summonRow.CostNcg > 0L)
{
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
states = states.TransferAsset(
context,
diff --git a/Lib9c/Action/UnlockCombinationSlot.cs b/Lib9c/Action/UnlockCombinationSlot.cs
index aa54d055f9..91922824bb 100644
--- a/Lib9c/Action/UnlockCombinationSlot.cs
+++ b/Lib9c/Action/UnlockCombinationSlot.cs
@@ -7,6 +7,7 @@
using Libplanet.Action;
using Libplanet.Action.State;
using Libplanet.Crypto;
+using Nekoyume.Action.Guild.Migration.LegacyModels;
using Nekoyume.Arena;
using Nekoyume.Extensions;
using Nekoyume.Model.Item;
@@ -74,7 +75,7 @@ public override IWorld Execute(IActionContext context)
throw new SlotAlreadyUnlockedException($"[{nameof(UnlockRuneSlot)}] Index : {SlotIndex}");
}
- var feeStoreAddress = GetFeeStoreAddress(states, context.BlockIndex);
+ var feeStoreAddress = states.GetFeeAddress(context.BlockIndex);
var costSheet = sheets.GetSheet();
if (!costSheet.ContainsKey(SlotIndex))
@@ -89,9 +90,9 @@ public override IWorld Execute(IActionContext context)
var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress);
throw new FailedLoadStateException($"{addressesHex}Aborted as the avatar state of the signer was failed to load.");
}
-
+
var agentAddress = avatarState.agentAddress;
-
+
var useMaterial = false;
MaterialItemSheet materialSheet = null;
@@ -174,18 +175,5 @@ public override IWorld Execute(IActionContext context)
allSlotState.UnlockSlot(AvatarAddress, SlotIndex);
return states.SetCombinationSlotState(AvatarAddress, allSlotState);
}
-
- private Address GetFeeStoreAddress(IWorld states, long blockIndex)
- {
- var sheets = states.GetSheets(
- sheetTypes: new[]
- {
- typeof(ArenaSheet),
- });
-
- var arenaSheet = sheets.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(blockIndex);
- return ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
}
}
diff --git a/Lib9c/Action/UnlockRuneSlot.cs b/Lib9c/Action/UnlockRuneSlot.cs
index a3b127cc11..263a8b291a 100644
--- a/Lib9c/Action/UnlockRuneSlot.cs
+++ b/Lib9c/Action/UnlockRuneSlot.cs
@@ -104,15 +104,7 @@ public override IWorld Execute(IActionContext context)
arenaSlotState.Unlock(SlotIndex);
raidSlotState.Unlock(SlotIndex);
- var feeAddress = Addresses.RewardPool;
- // TODO: [GuildMigration] Remove this after migration
- if (states.GetDelegationMigrationHeight() is long migrationHeight
- && context.BlockIndex < migrationHeight)
- {
- var arenaSheet = states.GetSheet();
- var arenaData = arenaSheet.GetRoundByBlockIndex(context.BlockIndex);
- feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
- }
+ var feeAddress = states.GetFeeAddress(context.BlockIndex);
return states
.TransferAsset(context, context.Signer, feeAddress, cost * currency)
diff --git a/Lib9c/Battle/StageSimulatorV1.cs b/Lib9c/Battle/StageSimulatorV1.cs
index bafcaf03e7..8def20247c 100644
--- a/Lib9c/Battle/StageSimulatorV1.cs
+++ b/Lib9c/Battle/StageSimulatorV1.cs
@@ -19,8 +19,8 @@ public class StageSimulatorV1 : Simulator, IStageSimulator
{
private readonly List _waves;
private readonly List _waveRewards;
- private readonly List _skillsOnWaveStart = new List();
- public CollectionMap ItemMap { get; private set; } = new CollectionMap();
+ private readonly List _skillsOnWaveStart = new ();
+ public CollectionMap ItemMap { get; private set; } = new ();
public EnemySkillSheet EnemySkillSheet { get; }
public const int ConstructorVersionDefault = 1;
@@ -43,7 +43,7 @@ public StageSimulatorV1(
StageSimulatorSheetsV1 stageSimulatorSheets,
int constructorVersion,
int playCount
- )
+ )
: base(
random,
avatarState,
@@ -60,11 +60,15 @@ int playCount
var stageSheet = stageSimulatorSheets.StageSheet;
if (!stageSheet.TryGetValue(StageId, out var stageRow))
+ {
throw new SheetRowNotFoundException(nameof(stageSheet), StageId);
+ }
var stageWaveSheet = stageSimulatorSheets.StageWaveSheet;
if (!stageWaveSheet.TryGetValue(StageId, out var stageWaveRow))
+ {
throw new SheetRowNotFoundException(nameof(stageWaveSheet), StageId);
+ }
Exp = StageRewardExpHelper.GetExp(avatarState.level, stageId);
TurnLimit = stageRow.TurnLimit;
@@ -107,6 +111,7 @@ int playCount
_waveRewards.Add(reward);
}
}
+
break;
}
}
@@ -138,11 +143,15 @@ StageSimulatorSheetsV1 stageSimulatorSheets
var stageSheet = stageSimulatorSheets.StageSheet;
if (!stageSheet.TryGetValue(StageId, out var stageRow))
+ {
throw new SheetRowNotFoundException(nameof(stageSheet), StageId);
+ }
var stageWaveSheet = stageSimulatorSheets.StageWaveSheet;
if (!stageWaveSheet.TryGetValue(StageId, out var stageWaveRow))
+ {
throw new SheetRowNotFoundException(nameof(stageWaveSheet), StageId);
+ }
Exp = StageRewardExpHelper.GetExp(avatarState.level, stageId);
TurnLimit = stageRow.TurnLimit;
@@ -181,7 +190,9 @@ int playCount
{
var stageSheet = stageSimulatorSheets.StageSheet;
if (!stageSheet.TryGetValue(StageId, out var stageRow))
+ {
throw new SheetRowNotFoundException(nameof(stageSheet), StageId);
+ }
Exp = StageRewardExpHelper.GetExp(avatarState.level, stageId);
TurnLimit = stageRow.TurnLimit;
@@ -215,7 +226,9 @@ Model.Skill.Skill skill
{
var stageSheet = stageSimulatorSheets.StageSheet;
if (!stageSheet.TryGetValue(StageId, out var stageRow))
+ {
throw new SheetRowNotFoundException(nameof(stageSheet), StageId);
+ }
Exp = StageRewardExpHelper.GetExp(avatarState.level, stageId);
TurnLimit = stageRow.TurnLimit;
@@ -352,12 +365,15 @@ public Player Simulate(int playCount)
{
Result = BattleLog.Result.TimeOver;
}
+
break;
}
// 캐릭터 큐가 비어 있는 경우 break.
if (!Characters.TryDequeue(out var character))
+ {
break;
+ }
character.Tick();
@@ -376,6 +392,7 @@ public Player Simulate(int playCount)
{
Result = BattleLog.Result.Win;
}
+
break;
}
@@ -395,14 +412,14 @@ public Player Simulate(int playCount)
break;
case 2:
- {
- ItemMap = Player.GetRewards(_waveRewards);
- var dropBox = new DropBox(null, _waveRewards);
- Log.Add(dropBox);
- var getReward = new GetReward(null, _waveRewards);
- Log.Add(getReward);
- break;
- }
+ {
+ ItemMap = Player.GetRewards(_waveRewards);
+ var dropBox = new DropBox(null, _waveRewards);
+ Log.Add(dropBox);
+ var getReward = new GetReward(null, _waveRewards);
+ Log.Add(getReward);
+ break;
+ }
default:
if (WaveNumber == _waves.Count)
{
@@ -431,7 +448,9 @@ public Player Simulate(int playCount)
// 제한 턴을 넘거나 플레이어가 죽은 경우 break;
if (TurnNumber > TurnLimit ||
Player.IsDead)
+ {
break;
+ }
}
Log.result = Result;
@@ -477,7 +496,7 @@ public Player SimulateV1()
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp2((int) (Exp * 0.3m), true);
+ Player.GetExp2((int)(Exp * 0.3m), true);
}
}
else
@@ -498,7 +517,9 @@ public Player SimulateV1()
// 캐릭터 큐가 비어 있는 경우 break.
if (!Characters.TryDequeue(out var character))
+ {
break;
+ }
#if TEST_LOG
var turnBefore = TurnNumber;
#endif
@@ -524,7 +545,7 @@ public Player SimulateV1()
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp2((int) (Exp * 0.3m), true);
+ Player.GetExp2((int)(Exp * 0.3m), true);
}
}
else
@@ -560,7 +581,7 @@ public Player SimulateV1()
break;
case 2:
{
- ItemMap = Player.GetRewards2(_waveRewards);
+ ItemMap = Player.GetRewards(_waveRewards);
var dropBox = new DropBox(null, _waveRewards);
Log.Add(dropBox);
var getReward = new GetReward(null, _waveRewards);
@@ -595,7 +616,9 @@ public Player SimulateV1()
// 제한 턴을 넘거나 플레이어가 죽은 경우 break;
if (TurnNumber > TurnLimit ||
Player.IsDead)
+ {
break;
+ }
}
Log.result = Result;
@@ -650,7 +673,7 @@ public Player SimulateV2()
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp3((int) (Exp * 0.3m), true);
+ Player.GetExp3((int)(Exp * 0.3m), true);
}
}
else
@@ -671,7 +694,9 @@ public Player SimulateV2()
// 캐릭터 큐가 비어 있는 경우 break.
if (!Characters.TryDequeue(out var character))
+ {
break;
+ }
#if TEST_LOG
var turnBefore = TurnNumber;
#endif
@@ -697,7 +722,7 @@ public Player SimulateV2()
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp3((int) (Exp * 0.3m), true);
+ Player.GetExp3((int)(Exp * 0.3m), true);
}
}
else
@@ -733,7 +758,7 @@ public Player SimulateV2()
break;
case 2:
{
- ItemMap = Player.GetRewards2(_waveRewards);
+ ItemMap = Player.GetRewards(_waveRewards);
var dropBox = new DropBox(null, _waveRewards);
Log.Add(dropBox);
var getReward = new GetReward(null, _waveRewards);
@@ -768,7 +793,9 @@ public Player SimulateV2()
// 제한 턴을 넘거나 플레이어가 죽은 경우 break;
if (TurnNumber > TurnLimit ||
Player.IsDead)
+ {
break;
+ }
}
Log.result = Result;
@@ -812,19 +839,22 @@ public Player SimulateV3()
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp((int) (Exp * 0.3m), true);
+ Player.GetExp((int)(Exp * 0.3m), true);
}
}
else
{
Result = BattleLog.Result.TimeOver;
}
+
break;
}
// 캐릭터 큐가 비어 있는 경우 break.
if (!Characters.TryDequeue(out var character))
+ {
break;
+ }
character.Tick();
@@ -836,13 +866,14 @@ public Player SimulateV3()
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp((int) (Exp * 0.3m), true);
+ Player.GetExp((int)(Exp * 0.3m), true);
}
}
else
{
Result = BattleLog.Result.Win;
}
+
break;
}
@@ -863,7 +894,7 @@ public Player SimulateV3()
break;
case 2:
{
- ItemMap = Player.GetRewards2(_waveRewards);
+ ItemMap = Player.GetRewards(_waveRewards);
var dropBox = new DropBox(null, _waveRewards);
Log.Add(dropBox);
var getReward = new GetReward(null, _waveRewards);
@@ -898,7 +929,9 @@ public Player SimulateV3()
// 제한 턴을 넘거나 플레이어가 죽은 경우 break;
if (TurnNumber > TurnLimit ||
Player.IsDead)
+ {
break;
+ }
}
Log.result = Result;
@@ -933,19 +966,22 @@ public Player SimulateV4()
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp((int) (Exp * 0.3m), true);
+ Player.GetExp((int)(Exp * 0.3m), true);
}
}
else
{
Result = BattleLog.Result.TimeOver;
}
+
break;
}
// 캐릭터 큐가 비어 있는 경우 break.
if (!Characters.TryDequeue(out var character))
+ {
break;
+ }
character.Tick();
@@ -957,13 +993,14 @@ public Player SimulateV4()
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp((int) (Exp * 0.3m), true);
+ Player.GetExp((int)(Exp * 0.3m), true);
}
}
else
{
Result = BattleLog.Result.Win;
}
+
break;
}
@@ -1019,7 +1056,9 @@ public Player SimulateV4()
// 제한 턴을 넘거나 플레이어가 죽은 경우 break;
if (TurnNumber > TurnLimit ||
Player.IsDead)
+ {
break;
+ }
}
Log.result = Result;
@@ -1054,19 +1093,22 @@ public Player SimulateV5(int playCount)
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp((int) (Exp * 0.3m * playCount), true);
+ Player.GetExp((int)(Exp * 0.3m * playCount), true);
}
}
else
{
Result = BattleLog.Result.TimeOver;
}
+
break;
}
// 캐릭터 큐가 비어 있는 경우 break.
if (!Characters.TryDequeue(out var character))
+ {
break;
+ }
character.Tick();
@@ -1078,13 +1120,14 @@ public Player SimulateV5(int playCount)
Result = BattleLog.Result.Lose;
if (StageId < GameConfig.MimisbrunnrStartStageId)
{
- Player.GetExp((int) (Exp * 0.3m * playCount), true);
+ Player.GetExp((int)(Exp * 0.3m * playCount), true);
}
}
else
{
Result = BattleLog.Result.Win;
}
+
break;
}
@@ -1140,7 +1183,9 @@ public Player SimulateV5(int playCount)
// 제한 턴을 넘거나 플레이어가 죽은 경우 break;
if (TurnNumber > TurnLimit ||
Player.IsDead)
+ {
break;
+ }
}
Log.result = Result;
diff --git a/Lib9c/Extensions/WorldExtensions.cs b/Lib9c/Extensions/WorldExtensions.cs
index 90d2c7b950..882460ce04 100644
--- a/Lib9c/Extensions/WorldExtensions.cs
+++ b/Lib9c/Extensions/WorldExtensions.cs
@@ -1,6 +1,10 @@
using System;
using Libplanet.Action.State;
using Libplanet.Crypto;
+using Nekoyume.Action.Guild.Migration.LegacyModels;
+using Nekoyume.Arena;
+using Nekoyume.Module;
+using Nekoyume.TableData;
namespace Nekoyume.Extensions
{
@@ -13,5 +17,31 @@ public static IWorld MutateAccount(this IWorld world, Address accountAddress,
account = mutateFn(account);
return world.SetAccount(accountAddress, account);
}
+
+ ///
+ /// Retrieves the fee address based on the block index and migration height.
+ ///
+ /// The current world instance.
+ /// The block index for which the fee address is required.
+ /// The fee address, which may vary based on migration height and arena data.
+ public static Address GetFeeAddress(this IWorld world, long blockIndex)
+ {
+ // Default fee address is set to the RewardPool address.
+ var feeAddress = Addresses.RewardPool;
+
+ // Check if the block index is before the migration height to determine if an arena-specific address should be used.
+ if (world.GetDelegationMigrationHeight() is long migrationHeight
+ && blockIndex < migrationHeight)
+ {
+ // Fetch arena data from the ArenaSheet to derive the fee address.
+ var arenaSheet = world.GetSheet();
+ var arenaData = arenaSheet.GetRoundByBlockIndex(blockIndex);
+
+ // Derive the fee address based on the championship ID and round.
+ feeAddress = ArenaHelper.DeriveArenaAddress(arenaData.ChampionshipId, arenaData.Round);
+ }
+
+ return feeAddress;
+ }
}
}
diff --git a/Lib9c/Model/Character/Player.cs b/Lib9c/Model/Character/Player.cs
index df99e824ba..80a888f7c0 100644
--- a/Lib9c/Model/Character/Player.cs
+++ b/Lib9c/Model/Character/Player.cs
@@ -449,18 +449,6 @@ public CollectionMap GetRewards(List items)
return map;
}
- [Obsolete("Use GetRewards")]
- public CollectionMap GetRewards2(List items)
- {
- var map = new CollectionMap();
- foreach (var item in items)
- {
- map.Add(Inventory.AddItem2(item));
- }
-
- return map;
- }
-
public virtual void Spawn()
{
InitAI();
diff --git a/Lib9c/Model/Item/Inventory.cs b/Lib9c/Model/Item/Inventory.cs
index 4eb4e9b9bc..76de11edd5 100644
--- a/Lib9c/Model/Item/Inventory.cs
+++ b/Lib9c/Model/Item/Inventory.cs
@@ -180,26 +180,36 @@ public KeyValuePair AddItem(ItemBase itemBase, int count = 1, ILock iL
throw new InvalidItemCountException();
}
- switch (itemBase.ItemType)
+#if LIB9C_DEV_EXTENSIONS || UNITY_EDITOR
+ foreach (var item in _items)
{
- case ItemType.Consumable:
- case ItemType.Equipment:
- case ItemType.Costume:
- AddNonFungibleItem(itemBase, iLock);
- break;
- case ItemType.Material:
- AddFungibleItem(itemBase, count, iLock);
- break;
- default:
- throw new ArgumentOutOfRangeException();
+ Guid? inventoryItemGuid;
+ Guid? createItemGuid;
+ {
+ inventoryItemGuid = item.item switch
+ {
+ ItemUsable itemUsable => itemUsable.ItemId,
+ Costume costume => costume.ItemId,
+ _ => null,
+ };
+ }
+ {
+ createItemGuid = itemBase switch
+ {
+ ItemUsable itemUsable => itemUsable.ItemId,
+ Costume costume => costume.ItemId,
+ _ => null,
+ };
+ }
+ if (inventoryItemGuid.HasValue && createItemGuid.HasValue && inventoryItemGuid.Value == createItemGuid.Value)
+ {
+ throw new ArgumentException(
+ $"Aborted because {nameof(itemBase)} is already in the inventory."
+ );
+ }
}
- _items.Sort();
- return new KeyValuePair(itemBase.Id, count);
- }
+#endif
- [Obsolete("Use AddItem")]
- public KeyValuePair AddItem2(ItemBase itemBase, int count = 1, ILock iLock = null)
- {
switch (itemBase.ItemType)
{
case ItemType.Consumable:
@@ -208,7 +218,7 @@ public KeyValuePair AddItem2(ItemBase itemBase, int count = 1, ILock i
AddNonFungibleItem(itemBase, iLock);
break;
case ItemType.Material:
- AddFungibleItem2(itemBase, count, iLock);
+ AddFungibleItem(itemBase, count, iLock);
break;
default:
throw new ArgumentOutOfRangeException();
@@ -219,7 +229,7 @@ public KeyValuePair AddItem2(ItemBase itemBase, int count = 1, ILock i
public Item AddFungibleItem(ItemBase itemBase, int count = 1, ILock iLock = null)
{
- if (!(itemBase is IFungibleItem fungibleItem))
+ if (itemBase is not IFungibleItem fungibleItem)
{
throw new ArgumentException(
$"Aborted because {nameof(itemBase)} cannot cast to {nameof(IFungibleItem)}");
@@ -236,35 +246,7 @@ public Item AddFungibleItem(ItemBase itemBase, int count = 1, ILock iLock = null
item.count += count;
}
- if (!(iLock is null))
- {
- item.LockUp(iLock);
- }
-
- return item;
- }
-
- [Obsolete("Use AddFungibleItem")]
- public Item AddFungibleItem2(ItemBase itemBase, int count = 1, ILock iLock = null)
- {
- if (!(itemBase is IFungibleItem fungibleItem))
- {
- throw new ArgumentException(
- $"Aborted because {nameof(itemBase)} cannot cast to {nameof(IFungibleItem)}");
- }
-
- var item = _items.FirstOrDefault(e => e.item.Equals(fungibleItem));
- if (item is null)
- {
- item = new Item(itemBase, count);
- _items.Add(item);
- }
- else
- {
- item.count += count;
- }
-
- if (!(iLock is null))
+ if (iLock is not null)
{
item.LockUp(iLock);
}
@@ -365,19 +347,20 @@ e.item is ITradableFungibleItem tradableFungibleItem &&
{
foreach (var item in _items)
{
- if (item.item is ITradableItem tradableItem)
+ switch (item.item)
{
- if (tradableItem.TradableId.Equals(TradableMaterial.DeriveTradableId(fungibleId)) &&
- tradableItem.RequiredBlockIndex <= blockIndex)
+ case ITradableItem tradableItem:
{
- targetItems.Add(item);
+ if (tradableItem.TradableId.Equals(TradableMaterial.DeriveTradableId(fungibleId)) &&
+ tradableItem.RequiredBlockIndex <= blockIndex)
+ {
+ targetItems.Add(item);
+ }
+ continue;
}
- continue;
- }
-
- if (item.item is IFungibleItem fungibleItem && fungibleItem.FungibleId.Equals(fungibleId))
- {
- targetItems.Add(item);
+ case IFungibleItem fungibleItem when fungibleItem.FungibleId.Equals(fungibleId):
+ targetItems.Add(item);
+ break;
}
}
@@ -432,18 +415,13 @@ public static bool IsMaterialRemovable(Item item, int id, long blockIndex)
return false;
}
- if (item.item is Material material && material.Id == id)
+ if (item.item is not Material material || material.Id != id)
{
- if (material is TradableMaterial tradableMaterial &&
- tradableMaterial.RequiredBlockIndex > blockIndex)
- {
- return false;
- }
-
- return true;
+ return false;
}
- return false;
+ return material is not TradableMaterial tradableMaterial ||
+ tradableMaterial.RequiredBlockIndex <= blockIndex;
}
///
@@ -459,17 +437,12 @@ public static bool IsMaterialRemovable(Item item, int id)
return false;
}
- if (item.item is Material material && material.Id == id)
+ if (item.item is not Material material || material.Id != id)
{
- if (material is TradableMaterial)
- {
- return false;
- }
-
- return true;
+ return false;
}
- return false;
+ return material is not TradableMaterial;
}
///
@@ -486,7 +459,7 @@ public bool RemoveMaterial(int id, long blockIndex, int count = 1)
return false;
}
- List- targetItems = _items.Where(item => IsMaterialRemovable(item, id, blockIndex)).ToList();
+ var targetItems = _items.Where(item => IsMaterialRemovable(item, id, blockIndex)).ToList();
targetItems = targetItems
.OrderBy(e => e.item is ITradableItem)
@@ -1136,13 +1109,13 @@ private ITradableItem ReplaceTradableItem(int count, Item item, long requiredBlo
{
RequiredBlockIndex = requiredBlockIndex
};
- AddItem2(material, count);
+ AddItem(material, count);
return material;
}
// NonFungibleItem case.
tradableItem.RequiredBlockIndex = requiredBlockIndex;
- AddItem2((ItemBase) tradableItem, count);
+ AddItem((ItemBase) tradableItem, count);
return tradableItem;
}
diff --git a/Lib9c/Model/Order/FungibleOrder.cs b/Lib9c/Model/Order/FungibleOrder.cs
index 5a42803dbf..4d324f9ec9 100644
--- a/Lib9c/Model/Order/FungibleOrder.cs
+++ b/Lib9c/Model/Order/FungibleOrder.cs
@@ -75,6 +75,7 @@ public override void Validate(AvatarState avatarState, int count)
}
}
+ [Obsolete("Not Used")]
public override ITradableItem Sell(AvatarState avatarState)
{
if (!avatarState.inventory.TryGetTradableItems(
@@ -141,7 +142,7 @@ public override ITradableItem Sell2(AvatarState avatarState)
}
// Lock item.
copy.RequiredBlockIndex = ExpiredBlockIndex;
- avatarState.inventory.AddItem2((ItemBase) copy, ItemCount);
+ avatarState.inventory.AddItem((ItemBase) copy, ItemCount);
return copy;
}
@@ -170,7 +171,7 @@ public override ITradableItem Sell3(AvatarState avatarState)
}
// Lock item.
copy.RequiredBlockIndex = ExpiredBlockIndex;
- avatarState.inventory.AddItem2((ItemBase) copy, ItemCount, new OrderLock(OrderId));
+ avatarState.inventory.AddItem((ItemBase) copy, ItemCount, new OrderLock(OrderId));
return copy;
}
@@ -259,7 +260,7 @@ public override OrderReceipt Transfer2(AvatarState seller, AvatarState buyer, lo
seller.inventory.RemoveTradableItemV1(tradableItem, ItemCount);
TradableMaterial copy = (TradableMaterial) tradableItem.Clone();
copy.RequiredBlockIndex = blockIndex;
- buyer.UpdateFromAddItem2(copy, ItemCount, false);
+ buyer.UpdateFromAddItem(copy, ItemCount, false);
return new OrderReceipt(OrderId, buyer.agentAddress, buyer.address, blockIndex);
}
throw new ItemDoesNotExistException(
@@ -276,7 +277,7 @@ public override OrderReceipt Transfer3(AvatarState seller, AvatarState buyer, lo
var copy = (TradableMaterial) tradableItem.Clone();
copy.RequiredBlockIndex = blockIndex;
- buyer.UpdateFromAddItem2(copy, ItemCount, false);
+ buyer.UpdateFromAddItem(copy, ItemCount, false);
return new OrderReceipt(OrderId, buyer.agentAddress, buyer.address, blockIndex);
}
@@ -417,7 +418,7 @@ public override ITradableItem Cancel2(AvatarState avatarState, long blockIndex)
ITradableFungibleItem copy = (ITradableFungibleItem) ((ITradableFungibleItem) inventoryItem.item).Clone();
avatarState.inventory.RemoveTradableItemV1(TradableId, ExpiredBlockIndex, ItemCount);
copy.RequiredBlockIndex = blockIndex;
- avatarState.inventory.AddItem2((ItemBase) copy, ItemCount);
+ avatarState.inventory.AddItem((ItemBase) copy, ItemCount);
return copy;
}
throw new ItemDoesNotExistException(
diff --git a/Lib9c/Model/Order/NonFungibleOrder.cs b/Lib9c/Model/Order/NonFungibleOrder.cs
index 2e6cf0be29..34773c219a 100644
--- a/Lib9c/Model/Order/NonFungibleOrder.cs
+++ b/Lib9c/Model/Order/NonFungibleOrder.cs
@@ -180,7 +180,7 @@ public override OrderReceipt Transfer2(AvatarState seller, AvatarState buyer, lo
}
else
{
- buyer.UpdateFromAddItem2((ItemUsable) nonFungibleItem, false);
+ buyer.UpdateFromAddItem((ItemUsable) nonFungibleItem, false);
}
return new OrderReceipt(OrderId, buyer.agentAddress, buyer.address, blockIndex);
@@ -206,7 +206,7 @@ public override OrderReceipt Transfer3(AvatarState seller, AvatarState buyer, lo
}
else
{
- buyer.UpdateFromAddItem2((ItemUsable)nonFungibleItem, false);
+ buyer.UpdateFromAddItem((ItemUsable)nonFungibleItem, false);
}
}
diff --git a/Lib9c/Model/State/AvatarState.cs b/Lib9c/Model/State/AvatarState.cs
index 4afe740992..9a02046fd4 100644
--- a/Lib9c/Model/State/AvatarState.cs
+++ b/Lib9c/Model/State/AvatarState.cs
@@ -433,16 +433,6 @@ public void UpdateFromCombination(ItemUsable itemUsable)
UpdateFromAddItem(itemUsable, false);
}
- public void UpdateFromCombination2(ItemUsable itemUsable)
- {
- questList.UpdateCombinationQuest(itemUsable);
- var type = itemUsable.ItemType == ItemType.Equipment ? QuestEventType.Equipment : QuestEventType.Consumable;
- eventMap.Add(new KeyValuePair((int)type, 1));
- UpdateGeneralQuest(new[] { type });
- UpdateCompletedQuest();
- UpdateFromAddItem2(itemUsable, false);
- }
-
public void UpdateFromItemEnhancement(Equipment equipment)
{
questList.UpdateItemEnhancementQuest(equipment);
@@ -453,16 +443,6 @@ public void UpdateFromItemEnhancement(Equipment equipment)
UpdateFromAddItem(equipment, false);
}
- public void UpdateFromItemEnhancement2(Equipment equipment)
- {
- questList.UpdateItemEnhancementQuest(equipment);
- var type = QuestEventType.Enhancement;
- eventMap.Add(new KeyValuePair((int)type, 1));
- UpdateGeneralQuest(new[] { type });
- UpdateCompletedQuest();
- UpdateFromAddItem2(equipment, false);
- }
-
public void UpdateFromAddItem(ItemUsable itemUsable, bool canceled)
{
var pair = inventory.AddItem(itemUsable);
@@ -472,23 +452,7 @@ public void UpdateFromAddItem(ItemUsable itemUsable, bool canceled)
{
questList.UpdateCollectQuest(itemMap);
questList.UpdateItemGradeQuest(itemUsable);
- questList.UpdateItemTypeCollectQuest(new[] { itemUsable });
- }
-
- UpdateCompletedQuest();
- }
-
- [Obsolete("Use UpdateFromAddItem")]
- public void UpdateFromAddItem2(ItemUsable itemUsable, bool canceled)
- {
- var pair = inventory.AddItem2(itemUsable);
- itemMap.Add(pair);
-
- if (!canceled)
- {
- questList.UpdateCollectQuest(itemMap);
- questList.UpdateItemGradeQuest(itemUsable);
- questList.UpdateItemTypeCollectQuest(new[] { itemUsable });
+ questList.UpdateItemTypeCollectQuest(new[] { itemUsable, });
}
UpdateCompletedQuest();
@@ -508,24 +472,9 @@ public void UpdateFromAddItem(ItemBase itemUsable, int count, bool canceled)
UpdateCompletedQuest();
}
- [Obsolete("Use UpdateFromAddItem")]
- public void UpdateFromAddItem2(ItemBase itemUsable, int count, bool canceled)
- {
- var pair = inventory.AddItem2(itemUsable, count: count);
- itemMap.Add(pair);
-
- if (!canceled)
- {
- questList.UpdateCollectQuest(itemMap);
- questList.UpdateItemTypeCollectQuest(new[] { itemUsable });
- }
-
- UpdateCompletedQuest();
- }
-
public void UpdateFromAddCostume(Costume costume)
{
- var pair = inventory.AddItem2(costume);
+ var pair = inventory.AddItem(costume);
itemMap.Add(pair);
}
@@ -547,25 +496,6 @@ public void UpdateFromQuestReward(Quest.Quest quest, MaterialItemSheet materialI
UpdateCompletedQuest();
}
- [Obsolete("Use UpdateFromQuestReward")]
- public void UpdateFromQuestReward2(Quest.Quest quest, MaterialItemSheet materialItemSheet)
- {
- var items = new List();
- foreach (var pair in quest.Reward.ItemMap.OrderBy(kv => kv.Item1))
- {
- var row = materialItemSheet.OrderedList.First(itemRow => itemRow.Id == pair.Item1);
- var item = ItemFactory.CreateMaterial(row);
- var map = inventory.AddItem2(item, count: pair.Item2);
- itemMap.Add(map);
- items.Add(item);
- }
-
- quest.IsPaidInAction = true;
- questList.UpdateCollectQuest(itemMap);
- questList.UpdateItemTypeCollectQuest(items);
- UpdateCompletedQuest();
- }
-
public void UpdateQuestRewards(MaterialItemSheet materialItemSheet)
{
var completedQuests = questList
@@ -583,24 +513,6 @@ public void UpdateQuestRewards(MaterialItemSheet materialItemSheet)
questList.completedQuestIds = completedQuestIds;
}
- [Obsolete("Use UpdateQuestRewards")]
- public void UpdateQuestRewards2(MaterialItemSheet materialItemSheet)
- {
- var completedQuests = questList
- .Where(quest => quest.Complete && !quest.IsPaidInAction)
- .ToList();
- // 완료되었지만 보상을 받지 않은 퀘스트를 return 문에서 Select 하지 않고 미리 저장하는 이유는
- // 지연된 실행에 의해, return 시점에서 이미 모든 퀘스트의 보상 처리가 완료된 상태에서
- // completed를 호출 시 where문의 predicate가 평가되어 컬렉션이 텅 비기 때문이다.
- var completedQuestIds = completedQuests.Select(quest => quest.Id).ToList();
- foreach (var quest in completedQuests)
- {
- UpdateFromQuestReward2(quest, materialItemSheet);
- }
-
- questList.completedQuestIds = completedQuestIds;
- }
-
#endregion
public int GetArmorId()
diff --git a/Lib9c/TableCSV/Arena/ArenaSheet.csv b/Lib9c/TableCSV/Arena/ArenaSheet.csv
index 7471725eab..45c33ece69 100644
--- a/Lib9c/TableCSV/Arena/ArenaSheet.csv
+++ b/Lib9c/TableCSV/Arena/ArenaSheet.csv
@@ -65,37 +65,37 @@ id,round,arena_type,start_block_index,end_block_index,required_medal_count,entra
10,6,Championship,12038501,12189700,160,2,100,40,40,8,701006
11,1,OffSeason,12189701,12340900,0,0,5,2,40,8,0
11,2,Season,12340901,12492100,0,1,50,20,40,8,701102
-11,3,OffSeason,12492101,12718900,0,0,5,2,40,8,0
-11,4,Season,12718901,12870100,0,1,50,20,40,8,701104
-11,5,OffSeason,12870101,13021300,0,0,5,2,40,8,0
-11,6,Championship,13021301,13172500,160,2,100,40,40,8,701106
-12,1,OffSeason,13172501,13323700,0,0,5,2,40,8,0
-12,2,Season,13323701,13474900,0,1,50,20,40,8,701202
-12,3,OffSeason,13474901,13626100,0,0,5,2,40,8,0
-12,4,Season,13626101,13777300,0,1,50,20,40,8,701204
-12,5,OffSeason,13777301,13928500,0,0,5,2,40,8,0
-12,6,Championship,13928501,14079700,160,2,100,40,40,8,701206
-13,1,OffSeason,14079701,14230900,0,0,5,2,40,8,0
-13,2,Season,14230901,14382100,0,1,50,20,40,8,701302
-13,3,OffSeason,14382101,14533300,0,0,5,2,40,8,0
-13,4,Season,14533301,14684500,0,1,50,20,40,8,701304
-13,5,OffSeason,14684501,14835700,0,0,5,2,40,8,0
-13,6,Championship,14835701,14986900,160,2,100,40,40,8,701306
-14,1,OffSeason,14986901,15138100,0,0,5,2,40,8,0
-14,2,Season,15138101,15289300,0,1,50,20,40,8,701402
-14,3,OffSeason,15289301,15440500,0,0,5,2,40,8,0
-14,4,Season,15440501,15591700,0,1,50,20,40,8,701404
-14,5,OffSeason,15591701,15742900,0,0,5,2,40,8,0
-14,6,Championship,15742901,15894100,160,2,100,40,40,8,701406
-15,1,OffSeason,15894101,16045300,0,0,5,2,40,8,0
-15,2,Season,16045301,16196500,0,1,50,20,40,8,701502
-15,3,OffSeason,16196501,16347700,0,0,5,2,40,8,0
-15,4,Season,16347701,16498900,0,1,50,20,40,8,701504
-15,5,OffSeason,16498901,16650100,0,0,5,2,40,8,0
-15,6,Championship,16650101,16801300,160,2,100,40,40,8,701506
-16,1,OffSeason,16801301,16952500,0,0,5,2,40,8,0
-16,2,Season,16952501,17103700,0,1,50,20,40,8,701602
-16,3,OffSeason,17103701,17254900,0,0,5,2,40,8,0
-16,4,Season,17254901,17406100,0,1,50,20,40,8,701604
-16,5,OffSeason,17406101,17557300,0,0,5,2,40,8,0
-16,6,Championship,17557301,17708500,160,2,100,40,40,8,701606
\ No newline at end of file
+11,3,OffSeason,12492101,12652179,0,0,5,2,40,8,0
+11,4,Season,12652180,12803379,0,1,50,20,40,8,701104
+11,5,OffSeason,12803380,12954579,0,0,5,2,40,8,0
+11,6,Championship,12954580,13105779,160,2,100,40,40,8,701106
+12,1,OffSeason,13105780,13256979,0,0,5,2,40,8,0
+12,2,Season,13256980,13408179,0,1,50,20,40,8,701202
+12,3,OffSeason,13408180,13559379,0,0,5,2,40,8,0
+12,4,Season,13559380,13710579,0,1,50,20,40,8,701204
+12,5,OffSeason,13710580,13861779,0,0,5,2,40,8,0
+12,6,Championship,13861780,14012979,160,2,100,40,40,8,701206
+13,1,OffSeason,14012980,14164179,0,0,5,2,40,8,0
+13,2,Season,14164180,14315379,0,1,50,20,40,8,701302
+13,3,OffSeason,14315380,14466579,0,0,5,2,40,8,0
+13,4,Season,14466580,14617779,0,1,50,20,40,8,701304
+13,5,OffSeason,14617780,14768979,0,0,5,2,40,8,0
+13,6,Championship,14768980,14920179,160,2,100,40,40,8,701306
+14,1,OffSeason,14920180,15071379,0,0,5,2,40,8,0
+14,2,Season,15071380,15222579,0,1,50,20,40,8,701402
+14,3,OffSeason,15222580,15373779,0,0,5,2,40,8,0
+14,4,Season,15373780,15524979,0,1,50,20,40,8,701404
+14,5,OffSeason,15524980,15676179,0,0,5,2,40,8,0
+14,6,Championship,15676180,15827379,160,2,100,40,40,8,701406
+15,1,OffSeason,15827380,15978579,0,0,5,2,40,8,0
+15,2,Season,15978580,16129779,0,1,50,20,40,8,701502
+15,3,OffSeason,16129780,16280979,0,0,5,2,40,8,0
+15,4,Season,16280980,16432179,0,1,50,20,40,8,701504
+15,5,OffSeason,16432180,16583379,0,0,5,2,40,8,0
+15,6,Championship,16583380,16734579,160,2,100,40,40,8,701506
+16,1,OffSeason,16734580,16885779,0,0,5,2,40,8,0
+16,2,Season,16885780,17036979,0,1,50,20,40,8,701602
+16,3,OffSeason,17036980,17188179,0,0,5,2,40,8,0
+16,4,Season,17188180,17339379,0,1,50,20,40,8,701604
+16,5,OffSeason,17339380,17490579,0,0,5,2,40,8,0
+16,6,Championship,17490580,17641779,160,2,100,40,40,8,701606
\ No newline at end of file
diff --git a/Lib9c/TableCSV/CollectionSheet.csv b/Lib9c/TableCSV/CollectionSheet.csv
index d4519d1037..1a0363ad4e 100644
--- a/Lib9c/TableCSV/CollectionSheet.csv
+++ b/Lib9c/TableCSV/CollectionSheet.csv
@@ -406,6 +406,9 @@ id,item_id1,count1,level1,skill1,item_id2,count2,level2,skill2,item_id3,count3,l
405,10760007,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,DEF,Add,5255,SPD,Add,22455,,,
406,10760008,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,SPD,Add,29941,,,,,,
407,10760009,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,ATK,Add,1565,HIT,Add,10927,,,
+408,10660001,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,HP,Add,141858,ATK,Add,7271,DEF,Add,5834
+409,10660002,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,HP,Add,236429,SPD,Add,23299,,,
+410,10660003,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,ATK,Add,13612,ATK,Add,8995,,,
411,10660004,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,HIT,Add,2833,SPD,Add,2833,,,
10001,201000,5,,FALSE,,,,,,,,,,,,,,,,,,,,,CDMG,Percentage,1,,,,,,
10002,201001,5,,FALSE,,,,,,,,,,,,,,,,,,,,,CDMG,Percentage,1,,,,,,
@@ -496,6 +499,9 @@ id,item_id1,count1,level1,skill1,item_id2,count2,level2,skill2,item_id3,count3,l
10155,900112,1,,FALSE,,,,,,,,,,,,,,,,,,,,,HP,Add,5514,DEF,Add,1102,,,
10156,201034,1,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,999,,,,,,
10157,201041,1,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,30000,HIT,Add,50000,,,
+10158,900113,1,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,167,ATK,Add,111,,,
+10159,900114,1,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,413,ATK,Add,275,,,
+10160,900115,1,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,1014,ATK,Add,676,,,
100001,10620001,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,HP,Add,70,ATK,Add,7,DEF,Add,4
100002,10630001,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,HP,Add,140,ATK,Add,42,DEF,Add,21
100003,10640001,1,0,TRUE,,,,,,,,,,,,,,,,,,,,,HP,Add,2660,ATK,Add,490,DEF,Add,140
@@ -568,8 +574,9 @@ id,item_id1,count1,level1,skill1,item_id2,count2,level2,skill2,item_id3,count3,l
200028,40100012,1,,FALSE,,,,,,,,,,,,,,,,,,,,,SPD,Add,9038,HP,Add,16946,,,
200029,40100036,1,,FALSE,,,,,,,,,,,,,,,,,,,,,HP,Add,21453,DEF,Add,946,,,
200030,40100032,1,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,2207,HP,Add,6067,HIT,Add,1569
+200031,40100041,1,,FALSE,,,,,,,,,,,,,,,,,,,,,SPD,Add,30288,ATK,Add,16394,,,
200032,40100042,1,,FALSE,,,,,,,,,,,,,,,,,,,,,HP,Add,24270,SPD,Add,1047,,,
-200033,40100043,1,,FALSE,,,,,,,,,,,,,,,,,,,,,SPD,Add,6224,HP,Add,30702,,,
+200033,40100043,1,,FALSE,,,,,,,,,,,,,,,,,,,,,SPD,Add,1692,ATK,Add,1439,,,
300001,49900011,1,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,381,,,,,,
300002,49900013,1,,FALSE,,,,,,,,,,,,,,,,,,,,,HP,Add,9933,,,,,,
300003,49900014,1,,FALSE,,,,,,,,,,,,,,,,,,,,,ATK,Add,900,,,,,,
@@ -585,6 +592,9 @@ id,item_id1,count1,level1,skill1,item_id2,count2,level2,skill2,item_id3,count3,l
300013,49900024,1,,FALSE,,,,,,,,,,,,,,,,,,,,,ATK,Add,14428,HP,Add,77753,,,
300014,49900025,1,,FALSE,,,,,,,,,,,,,,,,,,,,,HP,Add,52009,HIT,Add,21854,,,
300015,49900026,1,,FALSE,,,,,,,,,,,,,,,,,,,,,SPD,Add,23342,HP,Add,57925,,,
+300016,49900027,1,,FALSE,,,,,,,,,,,,,,,,,,,,,SPD,Add,20582,HP,Add,104277,ATK,Add,12227
+300017,49900029,1,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,6561,HP,Add,36073,,,
+300018,49900030,1,,FALSE,,,,,,,,,,,,,,,,,,,,,ATK,Add,9961,SPD,Add,4491,,,
1000101,500000,10,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,1309,,,,,,
1000102,500000,100,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,3588,,,,,,
1000103,500000,300,,FALSE,,,,,,,,,,,,,,,,,,,,,DEF,Add,6185,,,,,,
diff --git a/Lib9c/TableCSV/Crystal/CrystalEquipmentGrindingSheet.csv b/Lib9c/TableCSV/Crystal/CrystalEquipmentGrindingSheet.csv
index 6871bf045b..715fc9ad3a 100644
--- a/Lib9c/TableCSV/Crystal/CrystalEquipmentGrindingSheet.csv
+++ b/Lib9c/TableCSV/Crystal/CrystalEquipmentGrindingSheet.csv
@@ -211,6 +211,9 @@ id,enchant_base_id,gain_crystal,reward_material1,count1,reward_material2,count2
10640004,10100000,5000000,306070,5,,
10650007,10650007,10000000,306085,5,,
10660000,10660000,100000000,306085,10,,
+10660001,10660001,100000000,306085,10,,
+10660002,10660002,100000000,306085,10,,
+10660003,10660003,100000000,306085,10,,
10660004,10660004,1,,,,
10730000,10100000,500000,306045,5,,
10730001,10100000,500000,306045,5,,
diff --git a/Lib9c/TableCSV/Crystal/CrystalHammerPointSheet.csv b/Lib9c/TableCSV/Crystal/CrystalHammerPointSheet.csv
index f7d1fb5405..f01d0e623f 100644
--- a/Lib9c/TableCSV/Crystal/CrystalHammerPointSheet.csv
+++ b/Lib9c/TableCSV/Crystal/CrystalHammerPointSheet.csv
@@ -121,11 +121,11 @@ recipe_ID,max_hammer_count,crystal_cost
120,8,500
121,14,200000
122,14,400000
-123,20,8000000
-124,20,8000000
-125,20,8000000
-126,20,8000000
-127,20,8000000
+123,20,500000
+124,20,500000
+125,20,500000
+126,20,500000
+127,20,500000
128,40,2000000
129,20,1000000
130,20,1000000
diff --git a/Lib9c/TableCSV/Event/EventConsumableItemRecipeSheet.csv b/Lib9c/TableCSV/Event/EventConsumableItemRecipeSheet.csv
index a207bb9753..8efa20de53 100644
--- a/Lib9c/TableCSV/Event/EventConsumableItemRecipeSheet.csv
+++ b/Lib9c/TableCSV/Event/EventConsumableItemRecipeSheet.csv
@@ -10,4 +10,7 @@ id,required_block_index,required_ap,required_gold,material_item_id_1,material_it
10100003,20,0,0,800110,2,800111,2,,,,,900109
10110001,20,0,0,800112,3,,,,,,,900110
10110002,20,0,0,800113,3,,,,,,,900111
-10110003,20,0,0,800114,3,,,,,,,900112
\ No newline at end of file
+10110003,20,0,0,800114,3,,,,,,,900112
+10130001,20,0,0,800116,1,,,,,,,900113
+10130002,20,0,0,800117,1,,,,,,,900114
+10130003,20,0,0,800116,1,800117,1,,,,,900115
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Event/EventDungeonSheet.csv b/Lib9c/TableCSV/Event/EventDungeonSheet.csv
index 8ab9ca82a9..e4a5b5cc7a 100644
--- a/Lib9c/TableCSV/Event/EventDungeonSheet.csv
+++ b/Lib9c/TableCSV/Event/EventDungeonSheet.csv
@@ -4,4 +4,5 @@ id,name,stage_begin,stage_end
10090001,Treasure Valley,10090001,10090020
10100001,Moca Planet,10100001,10100020
10110001,Citrus Carnival,10110001,10110020
-10120001,1st Anniversary,10120001,10120020
\ No newline at end of file
+10120001,1st Anniversary,10120001,10120020
+10130001,Ragnarok Fields,10130001,10130020
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Event/EventDungeonStageSheet.csv b/Lib9c/TableCSV/Event/EventDungeonStageSheet.csv
index 6a570f359c..2b2c0e1868 100644
--- a/Lib9c/TableCSV/Event/EventDungeonStageSheet.csv
+++ b/Lib9c/TableCSV/Event/EventDungeonStageSheet.csv
@@ -118,4 +118,24 @@ id,cost_ap,turn_limit,hp_option,atk_option,def_option,cri_option,hit_option,spd_
10120017,5,150,15746,20217,13737,0,100440,14256,EventDungeon_05_02,bgm_hel_02,600202,0.1,1,2,600203,0.2,1,1,400000,0.3,200,200,600204,0.25,1,1,500000,0.15,1,1,,,,,,,,,,,,,,,,,,,,,200,200
10120018,5,150,17005,21834,14835,0,108475,15396,EventDungeon_05_02,bgm_hel_01,600202,0.1,1,2,600203,0.2,1,1,400000,0.3,200,200,600205,0.25,1,1,500000,0.15,1,1,,,,,,,,,,,,,,,,,,,,,200,200
10120019,5,150,19523,25068,17031,0,124545,17676,EventDungeon_05_02,bgm_hel_02,600202,0.1,1,3,600203,0.2,1,1,400000,0.3,200,200,600204,0.25,1,1,500000,0.15,1,1,,,,,,,,,,,,,,,,,,,,,200,200
-10120020,5,150,22041,28302,19227,0,140615,19956,EventDungeon_05_03,bgm_hel_03,600202,0.1,1,3,600203,0.2,1,1,400000,0.3,200,200,600205,0.25,1,1,500000,0.15,1,1,,,,,,,,,,,,,,,,,,,,,200,200
\ No newline at end of file
+10120020,5,150,22041,28302,19227,0,140615,19956,EventDungeon_05_03,bgm_hel_03,600202,0.1,1,3,600203,0.2,1,1,400000,0.3,200,200,600205,0.25,1,1,500000,0.15,1,1,,,,,,,,,,,,,,,,,,,,,200,200
+10130001,5,150,10,10,10,0,10,10,EventDungeon_06_01,bgm_christmas,600201,0.1,1,1,600302,0.2,1,1,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130002,5,150,24,24,24,0,24,24,EventDungeon_06_01,bgm_christmas,600201,0.1,1,1,600302,0.2,1,1,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130003,5,150,50,50,50,0,50,50,EventDungeon_06_01,bgm_christmas,600201,0.1,1,1,600302,0.2,1,1,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130004,5,150,57,60,101,0,65,50,EventDungeon_06_01,bgm_christmas,600201,0.1,1,1,600302,0.2,1,2,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130005,5,150,65,70,153,0,80,50,EventDungeon_06_01,bgm_christmas,600201,0.1,1,1,600302,0.2,1,2,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130006,5,150,80,90,153,0,105,110,EventDungeon_06_01,bgm_christmas,600201,0.1,1,1,600303,0.2,1,1,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130007,5,150,95,110,153,0,130,170,EventDungeon_06_01,bgm_christmas,600201,0.1,1,1,600303,0.2,1,1,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130008,5,150,115,135,176,0,150,321,EventDungeon_06_02,bgm_christmas,600201,0.1,1,1,600303,0.2,1,1,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130009,5,150,180,210,200,0,150,379,EventDungeon_06_02,bgm_christmas,600201,0.1,1,1,600303,0.2,1,2,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130010,5,150,273,310,270,0,437,364,EventDungeon_06_02,bgm_christmas,600201,0.1,1,1,600303,0.2,1,2,400000,0.4,60,60,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,60,60
+10130011,5,150,521,429,409,0,793,648,EventDungeon_06_02,bgm_christmas,600201,0.1,1,2,600304,0.2,1,1,400000,0.4,80,80,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,80,80
+10130012,5,150,770,549,549,0,1149,753,EventDungeon_06_02,bgm_christmas,600201,0.1,1,2,600304,0.2,1,1,400000,0.4,80,80,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,80,80
+10130013,5,150,1276,922,760,0,1397,1397,EventDungeon_06_02,bgm_christmas,600201,0.1,1,2,600304,0.2,1,1,400000,0.4,80,80,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,80,80
+10130014,5,150,1782,1296,972,0,1748,1748,EventDungeon_06_02,bgm_christmas,600201,0.1,1,2,600304,0.2,1,1,400000,0.4,80,80,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,80,80
+10130015,5,150,2147,1539,1094,0,2494,1833,EventDungeon_06_03,bgm_christmas,600201,0.1,1,2,600304,0.2,1,1,400000,0.4,100,100,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,100,100
+10130016,5,150,1682,1304,1187,0,3240,1919,EventDungeon_06_03,bgm_christmas,600201,0.1,1,2,600304,0.2,1,2,400000,0.4,100,100,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,100,100
+10130017,5,150,1991,1688,1281,0,5184,2048,EventDungeon_06_03,bgm_christmas,600201,0.1,1,2,600304,0.2,1,2,400000,0.4,100,100,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,100,100
+10130018,5,150,2300,2073,1944,0,7776,2284,EventDungeon_06_03,bgm_christmas,600201,0.1,1,2,600304,0.2,1,2,400000,0.4,100,100,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,100,100
+10130019,5,150,2520,2413,2073,0,6480,3086,EventDungeon_06_03,bgm_christmas,600201,0.1,1,2,600304,0.2,1,2,400000,0.4,100,100,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,100,100
+10130020,5,150,2741,2754,2268,0,10692,3888,EventDungeon_06_03,bgm_christmas,600201,0.1,1,2,600304,0.2,1,2,400000,0.4,100,100,800116,0.15,1,1,800117,0.15,1,1,,,,,,,,,,,,,,,,,,,,,100,100
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Event/EventDungeonStageWaveSheet.csv b/Lib9c/TableCSV/Event/EventDungeonStageWaveSheet.csv
index aed00453e6..0562ca4fbe 100644
--- a/Lib9c/TableCSV/Event/EventDungeonStageWaveSheet.csv
+++ b/Lib9c/TableCSV/Event/EventDungeonStageWaveSheet.csv
@@ -358,4 +358,64 @@ event_dungeon_stage_id,wave,monster1_id,monster1_level,monster1_count,monster2_i
10120019,3,209001,406,2,209005,406,1,,,,,,,0
10120020,1,209001,410,1,,,,,,,,,,0
10120020,2,209001,410,1,209006,410,1,,,,,,,0
-10120020,3,209001,410,2,209007,410,2,,,,,,,1
\ No newline at end of file
+10120020,3,209001,410,2,209007,410,2,,,,,,,1
+10130001,1,201000,20,1,,,,,,,,,,0
+10130001,2,201000,20,2,,,,,,,,,,0
+10130001,3,201000,20,3,,,,,,,,,,0
+10130002,1,201001,20,1,,,,,,,,,,0
+10130002,2,201001,20,2,,,,,,,,,,0
+10130002,3,201008,20,1,,,,,,,,,,0
+10130003,1,201001,50,1,,,,,,,,,,0
+10130003,2,201001,50,2,,,,,,,,,,0
+10130003,3,201001,50,3,,,,,,,,,,0
+10130004,1,201002,50,1,,,,,,,,,,0
+10130004,2,201002,50,2,,,,,,,,,,0
+10130004,3,201008,50,1,,,,,,,,,,0
+10130005,1,201000,100,1,,,,,,,,,,0
+10130005,2,201000,100,2,,,,,,,,,,0
+10130005,3,201000,100,3,,,,,,,,,,0
+10130006,1,201001,100,1,,,,,,,,,,0
+10130006,2,201001,100,2,,,,,,,,,,0
+10130006,3,201007,100,1,,,,,,,,,,1
+10130007,1,201002,100,1,,,,,,,,,,0
+10130007,2,201002,100,2,,,,,,,,,,0
+10130007,3,201002,100,3,,,,,,,,,,0
+10130008,1,201004,100,1,,,,,,,,,,0
+10130008,2,201004,100,2,,,,,,,,,,0
+10130008,3,201008,100,1,,,,,,,,,,0
+10130009,1,201001,120,2,,,,,,,,,,0
+10130009,2,201001,120,3,,,,,,,,,,0
+10130009,3,201001,120,4,,,,,,,,,,0
+10130010,1,201002,120,2,,,,,,,,,,0
+10130010,2,201002,120,3,,,,,,,,,,0
+10130010,3,201002,120,4,,,,,,,,,,0
+10130011,1,201004,120,2,,,,,,,,,,0
+10130011,2,201004,120,3,,,,,,,,,,0
+10130011,3,201003,120,2,,,,,,,,,,0
+10130012,1,201000,150,2,,,,,,,,,,0
+10130012,2,201000,150,3,,,,,,,,,,0
+10130012,3,201000,150,4,,,,,,,,,,0
+10130013,1,201001,150,2,,,,,,,,,,0
+10130013,2,201001,150,3,,,,,,,,,,0
+10130013,3,201006,150,2,,,,,,,,,,1
+10130014,1,201002,150,2,,,,,,,,,,0
+10130014,2,201002,150,3,,,,,,,,,,0
+10130014,3,201002,150,4,,,,,,,,,,0
+10130015,1,201004,150,2,,,,,,,,,,0
+10130015,2,201004,150,3,,,,,,,,,,0
+10130015,3,201003,150,3,,,,,,,,,,0
+10130016,1,201002,170,2,,,,,,,,,,0
+10130016,2,201002,170,3,,,,,,,,,,0
+10130016,3,201002,170,4,,,,,,,,,,0
+10130017,1,201004,170,2,,,,,,,,,,0
+10130017,2,201004,170,3,,,,,,,,,,0
+10130017,3,201003,170,2,,,,,,,,,,0
+10130018,1,201001,200,2,,,,,,,,,,0
+10130018,2,201001,200,3,,,,,,,,,,0
+10130018,3,201001,200,4,,,,,,,,,,0
+10130019,1,201002,200,2,,,,,,,,,,0
+10130019,2,201002,200,3,,,,,,,,,,0
+10130019,3,201002,200,4,,,,,,,,,,0
+10130020,1,201004,200,2,,,,,,,,,,0
+10130020,2,201004,200,3,,,,,,,,,,0
+10130020,3,201005,200,2,,,,,,,,,,1
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Event/EventScheduleSheet.csv b/Lib9c/TableCSV/Event/EventScheduleSheet.csv
index 84d0866b1e..075495f64a 100644
--- a/Lib9c/TableCSV/Event/EventScheduleSheet.csv
+++ b/Lib9c/TableCSV/Event/EventScheduleSheet.csv
@@ -7,4 +7,5 @@ _dungeon_ticket_additional_price: used on lib9c = column value / 10 (e.g.,1 -> 0
1009,Treasure Valley,8723200,8950000,5,10800,10,5,10,0
1010,Moca Planet,9564560,9892997,5,10800,10,5,10,9968597
1011,Citrus Carnival,11329982,11684582,5,10800,10,5,10,11760182
-1012,1st Anniversary,12576745,12793245,5,10800,10,5,20,0
\ No newline at end of file
+1012,1st Anniversary,12576745,12793245,5,10800,10,5,20,0
+1013,Ragnarok Fields,12813373,13040173,5,10800,10,5,10,13115773
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Item/ConsumableItemSheet.csv b/Lib9c/TableCSV/Item/ConsumableItemSheet.csv
index 702df3166a..a1e5186d23 100644
--- a/Lib9c/TableCSV/Item/ConsumableItemSheet.csv
+++ b/Lib9c/TableCSV/Item/ConsumableItemSheet.csv
@@ -56,4 +56,7 @@ id,_name,item_sub_type,grade,elemental_type,stat_type_1,stat_value_1,stat_type_2
900109,모카두카 버블티,Food,5,Normal,HP,7941,ATK,1581
900110,오렌지 젤리,Food,3,Normal,HP,4545,DEF,909
900111,오렌지 주스,Food,4,Normal,HP,11244,DEF,2248
-900112,오렌지 젤라또,Food,5,Normal,HP,27571,DEF,5514
\ No newline at end of file
+900112,오렌지 젤라또,Food,5,Normal,HP,27571,DEF,5514
+900113,라그나 데낄라,Food,3,Normal,DEF,836,ATK,557
+900114,짭쪼름한 엘릭서,Food,4,Normal,DEF,2068,ATK,1379
+900115,라글렌피딕 99년 산,Food,5,Normal,DEF,5073,ATK,3382
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Item/CostumeItemSheet.csv b/Lib9c/TableCSV/Item/CostumeItemSheet.csv
index 6f50407afd..4fcfad4660 100644
--- a/Lib9c/TableCSV/Item/CostumeItemSheet.csv
+++ b/Lib9c/TableCSV/Item/CostumeItemSheet.csv
@@ -38,8 +38,9 @@ _spine_resource_path,`Title`: ``,,,,
40100030,Valhalla's Sigrun,FullCostume,5,Normal,
40100032,그림자의 시그룬,FullCostume,6,Normal,
40100036,Guardian of the Forest Lundis,FullCostume,4,Normal,
+40100041,mileage costume 01,FullCostume,6,Normal,
40100042,1주년 기념 고양이,FullCostume,6,Normal,
-40100043,1주년 기념 파란 고양이,FullCostume,6,Normal,
+40100043,1주년 기념 고양이2,FullCostume,6,Normal,
40200001,갈색 머리카락,HairCostume,1,Normal,
40200002,파란색 머리카락,HairCostume,1,Normal,
40200003,초록색 머리카락,HairCostume,1,Normal,
@@ -118,4 +119,7 @@ _spine_resource_path,`Title`: ``,,,,
49900023,Hallow Winner,Title,5,Normal,
49900024,YGG Bravecat,Title,5,Normal,
49900025,Collection Master,Title,5,Normal,
-49900026,Courage Master,Title,5,Normal,
\ No newline at end of file
+49900026,Courage Master,Title,5,Normal,
+49900027,mileage title 01,Title,6,Normal,
+49900029,Ragnarok,Title,5,Normal,
+49900030,Wish Maker,Title,5,Normal,
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Item/CostumeStatSheet.csv b/Lib9c/TableCSV/Item/CostumeStatSheet.csv
index de22caa780..2f533ecba3 100644
--- a/Lib9c/TableCSV/Item/CostumeStatSheet.csv
+++ b/Lib9c/TableCSV/Item/CostumeStatSheet.csv
@@ -97,5 +97,14 @@ id,costume_id,stat_type,stat
96,40100032,HIT,7845
97,40100042,HP,121354
98,40100042,SPD,5239
-99,40100043,SPD,31123
-100,40100043,HP,153513
\ No newline at end of file
+99,40100043,SPD,8462
+100,40100043,ATK,7196
+101,49900027,SPD,102911
+102,49900027,HP,521385
+103,49900027,ATK,61137
+104,49900029,DEF,32808
+105,49900029,HP,180367
+106,49900030,ATK,49805
+107,49900030,SPD,22455
+108,40100041,SPD,151442
+109,40100041,ATK,81972
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Item/EquipmentItemOptionSheet.csv b/Lib9c/TableCSV/Item/EquipmentItemOptionSheet.csv
index ec4486a008..701b6ec8c1 100644
--- a/Lib9c/TableCSV/Item/EquipmentItemOptionSheet.csv
+++ b/Lib9c/TableCSV/Item/EquipmentItemOptionSheet.csv
@@ -2397,6 +2397,16 @@ id,stat_type,stat_min,stat_max,skill_id,skill_damage_min,skill_damage_max,skill_
2066000123,,,,800193,0,0,28,28,1632,1920,SPD
2066000124,,,,800194,0,0,28,28,1305,1536,SPD
2066000125,,,,800195,0,0,28,28,1044,1228,SPD
+1066000111,HP,472860,709290,,,,,,,,
+1066000112,ATK,24238,36357,,,,,,,,
+1066000113,DEF,19449,29173,,,,,,,,
+1066000114,,,,230007,900,900,30,30,,,
+1066000211,HP,788100,1182149,,,,,,,,
+1066000212,SPD,77666,116498,,,,,,,,
+1066000213,,,,210012,50,50,30,30,,,
+1066000311,ATK,45374,68060,,,,,,,,
+1066000312,DEF,29984,44975,,,,,,,,
+1066000313,,,,110008,0,0,30,30,30000,30000,ATK
1066000411,HIT,9446,14169,,,,,,,,
1066000412,SPD,4078,6116,,,,,,,,
1066000413,,,,240006,20,20,30,30,,,
diff --git a/Lib9c/TableCSV/Item/EquipmentItemRecipeSheet.csv b/Lib9c/TableCSV/Item/EquipmentItemRecipeSheet.csv
index 61fa4c4af5..db9094d049 100644
--- a/Lib9c/TableCSV/Item/EquipmentItemRecipeSheet.csv
+++ b/Lib9c/TableCSV/Item/EquipmentItemRecipeSheet.csv
@@ -173,5 +173,8 @@ id,result_equipment_id,material_id,material_count,required_action_point,required
250,10760006,0,0,0,0,10000000,999,107600061,,,0,Grimoire
251,10760007,0,0,0,0,10000000,999,107600071,,,0,Grimoire
252,10760008,0,0,0,0,10000000,999,107600081,,,0,Grimoire
+253,10660001,0,0,0,0,10000000,999,106600011,,,0,Aura
+254,10660002,0,0,0,0,10000000,999,106600021,,,0,Aura
+255,10660003,0,0,0,0,10000000,999,106600031,,,0,Aura
256,10660004,600204,3,0,0,1,999,106600041,,,0,Aura
257,10760009,600204,3,0,0,1,999,107600091,,,0,Grimoire
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Item/EquipmentItemSheet.csv b/Lib9c/TableCSV/Item/EquipmentItemSheet.csv
index 7af3e913be..f3d2f9a4fe 100644
--- a/Lib9c/TableCSV/Item/EquipmentItemSheet.csv
+++ b/Lib9c/TableCSV/Item/EquipmentItemSheet.csv
@@ -211,6 +211,9 @@ id,_name,item_sub_type,grade,elemental_type,set_id,stat_type,stat_value,attack_r
10640004,Ymir Aura,Aura,4,Normal,0,ATK,10,0,10620001,6000
10650007,Ymir Aura,Aura,5,Normal,0,ATK,10,0,10620001,60000
10660000,Ymir Aura,Aura,6,Normal,0,ATK,10,0,10620001,130000
+10660001,Beast Aura,Aura,6,Normal,0,ATK,10,0,10620001,130000
+10660002,Aegis Aura,Aura,6,Normal,0,HP,10,0,10620001,130000
+10660003,Barrage Aura,Aura,6,Normal,0,ATK,10,0,10620001,130000
10660004,1주년 아우라,Aura,6,Normal,0,HIT,10,0,10620001,1
10730000,공격의 그리모어 (A),Grimoire,3,Normal,0,ATK,10,0,10730000,600
10730001,공격의 그리모어 (H),Grimoire,3,Normal,0,ATK,10,0,10730001,600
diff --git a/Lib9c/TableCSV/Item/EquipmentItemSubRecipeSheetV2.csv b/Lib9c/TableCSV/Item/EquipmentItemSubRecipeSheetV2.csv
index 185d89666e..0c36d7a815 100644
--- a/Lib9c/TableCSV/Item/EquipmentItemSubRecipeSheetV2.csv
+++ b/Lib9c/TableCSV/Item/EquipmentItemSubRecipeSheetV2.csv
@@ -611,5 +611,8 @@ ID,required_action_point,required_gold,required_block_index,material_id,material
107600061,0,0,1,,,,,,,1076000611,10000,0,1076000612,10000,0,1076000613,10000,0,1076000614,10000,0,FALSE,1
107600071,0,0,1,,,,,,,1076000611,10000,0,1076000612,10000,0,1076000613,10000,0,1076000714,10000,0,FALSE,1
107600081,0,0,1,,,,,,,1076000611,10000,0,1076000612,10000,0,1076000613,10000,0,1076000814,10000,0,FALSE,1
+106600011,0,0,1,,,,,,,1066000111,10000,0,1066000112,10000,0,1066000113,10000,0,1066000114,10000,0,FALSE,1
+106600021,0,0,1,,,,,,,1066000211,10000,0,1066000212,10000,0,1066000213,10000,0,,,,FALSE,1
+106600031,0,0,1,,,,,,,1066000311,10000,0,1066000312,10000,0,1066000313,10000,0,,,,FALSE,1
106600041,0,0,0,600205,3,,,,,1066000411,10000,0,1066000412,10000,0,1066000413,10000,0,,,,FALSE,1
107600091,0,0,0,600205,3,,,,,1076000911,10000,0,1076000912,10000,0,1076000913,10000,0,,,,FALSE,1
\ No newline at end of file
diff --git a/Lib9c/TableCSV/Item/ItemRequirementSheet.csv b/Lib9c/TableCSV/Item/ItemRequirementSheet.csv
index 751929edd0..462726d3b8 100644
--- a/Lib9c/TableCSV/Item/ItemRequirementSheet.csv
+++ b/Lib9c/TableCSV/Item/ItemRequirementSheet.csv
@@ -215,6 +215,7 @@ item_id,level,mimislevel
40100030,1,1
40100032,1,1
40100036,1,1
+40100041,1,1
40100042,1,1
40100043,1,1
40200001,1,1
@@ -276,6 +277,9 @@ item_id,level,mimislevel
49900024,1,1
49900025,1,1
49900026,1,1
+49900027,1,1
+49900029,1,1
+49900030,1,1
105000,1,1
105001,1,1
105002,1,1
@@ -333,6 +337,12 @@ item_id,level,mimislevel
900107,1,1
900108,1,1
900109,1,1
+900110,1,1
+900111,1,1
+900112,1,1
+900113,1,1
+900114,1,1
+900115,1,1
10130002,1,1
10620002,1,1
10630002,1,1
@@ -362,6 +372,9 @@ item_id,level,mimislevel
10640004,1,1
10650007,1,1
10660000,1,1
+10660001,1,1
+10660002,1,1
+10660003,1,1
10660004,1,1
10730000,1,1
10730001,1,1
@@ -400,9 +413,6 @@ item_id,level,mimislevel
10760007,1,1
10760008,1,1
10760009,1,1
-900110,1,1
-900111,1,1
-900112,1,1
20160000,300,300
20160001,300,300
20160002,350,350
diff --git a/Lib9c/TableCSV/Item/MaterialItemSheet.csv b/Lib9c/TableCSV/Item/MaterialItemSheet.csv
index 6c3acc5085..f3271f5643 100644
--- a/Lib9c/TableCSV/Item/MaterialItemSheet.csv
+++ b/Lib9c/TableCSV/Item/MaterialItemSheet.csv
@@ -49,6 +49,8 @@ id,_name,item_sub_type,grade,elemental_type
800113,레드 오렌지,FoodMaterial,3,Normal
800114,맛있는 오렌지,FoodMaterial,4,Normal
800115,오렌지 메달,NormalMaterial,5,Normal
+800116,라그나로크 베리,FoodMaterial,3,Normal
+800117,어노잉 오렌지,FoodMaterial,4,Normal
800201,Silver Dust,FoodMaterial,4,Normal
800202,Golden Meat,FoodMaterial,4,Normal
303000,녹슨 칼,EquipmentMaterial,1,Normal
diff --git a/Lib9c/TableCSV/PatrolRewardSheet.csv b/Lib9c/TableCSV/PatrolRewardSheet.csv
index 301587e3a0..d543f48dd0 100644
--- a/Lib9c/TableCSV/PatrolRewardSheet.csv
+++ b/Lib9c/TableCSV/PatrolRewardSheet.csv
@@ -1,4 +1,4 @@
id,start,end,interval,min_level,max_level,reward1_count,reward1_item_id,reward1_ticker,reward2_count,reward2_item_id,reward2_ticker,reward3_count,reward3_item_id,reward3_ticker,reward4_count,reward4_item_id,reward4_ticker
-1,0,100,8400,1,200,1,500000,,1,600201,
-2,100,200,8400,201,350,1,500000,,2,600201,,100000,,CRYSTAL
-3,200,300,8400,351,,2,500000,,3,600201,,200000,,CRYSTAL,1,600202,
+1,0,3000000,10,1,200,1,500000,,1,600201,
+2,0,3000000,10,201,350,1,500000,,2,600201,,100000,,CRYSTAL
+3,0,3000000,10,351,,2,500000,,3,600201,,200000,,CRYSTAL,1,600202,
diff --git a/Lib9c/TableCSV/PatrolRewardSheet.csv.meta b/Lib9c/TableCSV/PatrolRewardSheet.csv.meta
new file mode 100644
index 0000000000..881054e789
--- /dev/null
+++ b/Lib9c/TableCSV/PatrolRewardSheet.csv.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 92ae4e6336725f74a8475d848cd18510
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Lib9c/TableCSV/Summon/EquipmentSummonSheet.csv b/Lib9c/TableCSV/Summon/EquipmentSummonSheet.csv
index a888360ea3..8906b4ebf9 100644
--- a/Lib9c/TableCSV/Summon/EquipmentSummonSheet.csv
+++ b/Lib9c/TableCSV/Summon/EquipmentSummonSheet.csv
@@ -1,5 +1,5 @@
groupID,cost_material,cost_material_count,cost_ncg,recipe1ID,recipe1ratio,recipe2ID,recipe2ratio,recipe3ID,recipe3ratio,recipe4ID,recipe4ratio,recipe5ID,recipe5ratio,recipe6ID,recipe6ratio,recipe7ID,recipe7ratio,recipe8ID,recipe8ratio,recipe9ID,recipe9ratio,recipe10ID,recipe10ratio,recipe11ID,recipe11ratio,recipe12ID,recipe12ratio,recipe13ID,recipe13ratio,recipe14ID,recipe14ratio,recipe15ID,recipe15ratio,recipe16ID,recipe16ratio,recipe17ID,recipe17ratio,recipe18ID,recipe18ratio,recipe19ID,recipe19ratio,recipe20ID,recipe20ratio,recipe21ID,recipe21ratio,recipe22ID,recipe22ratio,recipe23ID,recipe23ratio,recipe24ID,recipe24ratio,recipe25ID,recipe25ratio,recipe26ID,recipe26ratio,recipe27ID,recipe27ratio,recipe28ID,recipe28ratio,recipe29ID,recipe29ratio,recipe30ID,recipe30ratio,recipe31ID,recipe31ratio,recipe32ID,recipe32ratio,recipe33ID,recipe33ratio,recipe34ID,recipe34ratio,recipe35ID,recipe35ratio,recipe36ID,recipe36ratio
10001,800201,10,0,173,100,172,3500,171,6000,176,3,181,3,186,3,175,30,180,30,185,30,174,100,179,100,184,100,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-10002,600201,20,0,216,10,215,1100,214,12750,178,150,183,150,188,150,177,1100,182,1100,187,1100,176,12750,181,12750,186,12750,175,98000,180,98000,185,98000,174,216667,179,216667,184,216667,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-30001,600202,20,0,216,5,215,37,214,370,177,37,182,36,187,36,176,360,181,360,186,360,175,2800,180,2800,185,2800,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+10002,600201,20,0,216,10,215,1100,214,12750,178,150,183,150,188,150,177,1100,182,1100,187,1100,176,12750,181,12750,186,12750,175,98000,180,98000,185,98000,174,216667,179,216667,184,216667,253,10,254,10,255,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+30001,600202,20,0,216,5,215,37,214,370,177,37,182,36,187,36,176,360,181,360,186,360,175,2800,180,2800,185,2800,253,5,254,5,255,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
40001,600203,20,0,217,60,218,60,219,60,220,60,221,60,222,60,223,60,224,60,225,60,226,30,227,30,228,30,229,30,230,30,231,30,232,30,233,30,234,30,235,9,236,9,237,9,238,9,239,9,240,9,241,9,242,9,243,9,244,1,245,1,246,1,247,1,248,1,249,1,250,1,251,1,252,1
\ No newline at end of file
diff --git a/Lib9c/TableCSV/SynthesizeSheet.csv b/Lib9c/TableCSV/SynthesizeSheet.csv
new file mode 100644
index 0000000000..2987ba0603
--- /dev/null
+++ b/Lib9c/TableCSV/SynthesizeSheet.csv
@@ -0,0 +1,12 @@
+grade_id,item_sub_type,required_count,succeed_rate
+_value of successful_rate is between 0 and 10000,,,
+1,Aura,10,8000
+2,Aura,10,7500
+3,Aura,12,5000
+3,Grimoire,8,8000
+4,Aura,10,4000
+4,Grimoire,6,6000
+5,Aura,6,2500
+5,Grimoire,5,2000
+6,Aura,3,0
+6,Grimoire,3,0
\ No newline at end of file
diff --git a/Lib9c/TableCSV/SynthesizeWeightSheet.csv b/Lib9c/TableCSV/SynthesizeWeightSheet.csv
new file mode 100644
index 0000000000..87ad9c8ac1
--- /dev/null
+++ b/Lib9c/TableCSV/SynthesizeWeightSheet.csv
@@ -0,0 +1,64 @@
+item_id,weight
+_default value for weight is 10000.,
+10610000,10000
+10620000,10000
+10630000,10000
+10620001,5000
+10630001,5000
+10640001,10000
+10650001,10000
+10650002,0
+10620002,5000
+10630002,5000
+10640002,10000
+10650003,10000
+10650004,0
+10620003,5000
+10630003,5000
+10640003,10000
+10650005,10000
+10650006,0
+10640004,10000
+10650007,10000
+10660000,10000
+10660004,0
+10760009,0
+10730000,10000
+10730001,10000
+10730002,10000
+10730003,10000
+10730004,10000
+10730005,10000
+10730006,10000
+10730007,10000
+10730008,10000
+10740000,10000
+10740001,10000
+10740002,10000
+10740003,10000
+10740004,10000
+10740005,10000
+10740006,10000
+10740007,10000
+10740008,10000
+10750000,10000
+10750001,10000
+10750002,10000
+10750003,10000
+10750004,10000
+10750005,10000
+10750006,10000
+10750007,10000
+10750008,10000
+10760000,10000
+10760001,10000
+10760002,10000
+10760003,10000
+10760004,10000
+10760005,10000
+10760006,10000
+10760007,10000
+10760008,10000
+10660001,10000
+10660002,10000
+10660003,10000
\ No newline at end of file