diff --git a/Maple2.File.Parser/Maple2.File.Parser.csproj b/Maple2.File.Parser/Maple2.File.Parser.csproj
index 50686d0..78ab12d 100644
--- a/Maple2.File.Parser/Maple2.File.Parser.csproj
+++ b/Maple2.File.Parser/Maple2.File.Parser.csproj
@@ -13,7 +13,7 @@
MapleStory2, File, Parser, m2d, xml
true
- 2.3.2
+ 2.3.3
net8.0
README.md
enable
diff --git a/Maple2.File.Parser/ServerTableParser.cs b/Maple2.File.Parser/ServerTableParser.cs
index ee0a914..17de300 100644
--- a/Maple2.File.Parser/ServerTableParser.cs
+++ b/Maple2.File.Parser/ServerTableParser.cs
@@ -4,7 +4,17 @@
using Maple2.File.IO;
using Maple2.File.Parser.Enum;
using Maple2.File.Parser.Tools;
+using Maple2.File.Parser.Xml.Table;
using Maple2.File.Parser.Xml.Table.Server;
+using Fish = Maple2.File.Parser.Xml.Table.Server.Fish;
+using FishingSpot = Maple2.File.Parser.Xml.Table.Server.FishingSpot;
+using FishingSpotRoot = Maple2.File.Parser.Xml.Table.Server.FishingSpotRoot;
+using FishRoot = Maple2.File.Parser.Xml.Table.Server.FishRoot;
+using IndividualItemDrop = Maple2.File.Parser.Xml.Table.Server.IndividualItemDrop;
+using IndividualItemDropRoot = Maple2.File.Parser.Xml.Table.Server.IndividualItemDropRoot;
+using ItemMergeOptionRoot = Maple2.File.Parser.Xml.Table.Server.ItemMergeOptionRoot;
+using ItemOptionVariation = Maple2.File.Parser.Xml.Table.Server.ItemOptionVariation;
+using MergeOption = Maple2.File.Parser.Xml.Table.Server.MergeOption;
namespace Maple2.File.Parser;
@@ -48,6 +58,7 @@ public class ServerTableParser {
private readonly XmlSerializer itemOptionProbabilitySerializer;
private readonly XmlSerializer itemOptionVariationSerializer;
private readonly XmlSerializer itemOptionRandomSerializer;
+ private readonly XmlSerializer constantsSerializer;
public ServerTableParser(M2dReader xmlReader) {
this.xmlReader = xmlReader;
@@ -89,6 +100,7 @@ public ServerTableParser(M2dReader xmlReader) {
itemOptionProbabilitySerializer = new XmlSerializer(typeof(ItemOptionProbabilityRoot));
itemOptionVariationSerializer = new XmlSerializer(typeof(ItemOptionVariationRoot));
itemOptionRandomSerializer = new XmlSerializer(typeof(ItemOptionRandomRoot));
+ constantsSerializer = new XmlSerializer(typeof(Constants));
// var seen = new HashSet();
// this.bankTypeSerializer.UnknownAttribute += (sender, args) => {
@@ -679,4 +691,15 @@ public ServerTableParser(M2dReader xmlReader) {
yield return (option.code, option);
}
}
+
+ public IEnumerable<(string Key, Constants.Key key)> ParseConstants() {
+ string xml = Sanitizer.RemoveEmpty(xmlReader.GetString(xmlReader.GetEntry("table/Server/constants.xml")));
+ var reader = XmlReader.Create(new StringReader(xml));
+ var data = constantsSerializer.Deserialize(reader) as Constants;
+ Debug.Assert(data != null);
+
+ foreach (Constants.Key key in data.v) {
+ yield return (key.key, key);
+ }
+ }
}
diff --git a/Maple2.File.Tests/ServerTableParserTest.cs b/Maple2.File.Tests/ServerTableParserTest.cs
index 543dc13..3165bdc 100644
--- a/Maple2.File.Tests/ServerTableParserTest.cs
+++ b/Maple2.File.Tests/ServerTableParserTest.cs
@@ -1,4 +1,5 @@
using Maple2.File.Parser;
+using Maple2.File.Parser.Xml.Table;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Maple2.File.Tests;
@@ -435,5 +436,14 @@ public void TestItemOptionRandom() {
continue;
}
}
+
+ [TestMethod]
+ public void TestConstants() {
+ var parser = new ServerTableParser(TestUtils.ServerReader);
+
+ foreach ((_, _) in parser.ParseConstants()) {
+ continue;
+ }
+ }
}