Hydrofluoric0 / DofusRE

Dofus reverse-engineering library made in C#
Apache License 2.0
11 stars 0 forks source link

Issue reading d2o file #4

Open GrayR0ot opened 2 years ago

GrayR0ot commented 2 years ago

Dear,

I'm trying to use your Library, when I read a Items.d2o file it's working perfectly, but when I'm reading Monsters.d2o i'm having an issue.

Here is the stacktrace:

   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DofusRE.GameData.GameDataClass.Deserialize(BigEndianReader reader, Dictionary`2 classesDefs) in C:\Users\leomo\Mon Drive\C#\DofusRe\src\DofusRE\GameData\GameDataClass.cs:line 69
   at DofusRE.GameData.GameDataClass.readField(BigEndianReader reader, Type type, Dictionary`2 classesDefs) in C:\Users\leomo\Mon Drive\C#\DofusRe\src\DofusRE\GameData\GameDataClass.cs:line 37
   at DofusRE.GameData.GameDataClass.readField(BigEndianReader reader, Type type, Dictionary`2 classesDefs) in C:\Users\leomo\Mon Drive\C#\DofusRe\src\DofusRE\GameData\GameDataClass.cs:line 24
   at DofusRE.GameData.GameDataClass.Deserialize(BigEndianReader reader, Dictionary`2 classesDefs) in C:\Users\leomo\Mon Drive\C#\DofusRe\src\DofusRE\GameData\GameDataClass.cs:line 71
   at DofusRE.GameData.GameDataReader.readClasses() in C:\Users\leomo\Mon Drive\C#\DofusRe\src\DofusRE\GameData\GameDataReader.cs:line 101
   at DofusRE.GameData.GameDataReader.Read() in C:\Users\leomo\Mon Drive\C#\DofusRe\src\DofusRE\GameData\GameDataReader.cs:line 40
   at SpellEffectGenerator.Program.Main(String[] args) in C:\Users\leomo\Mon Drive\C#\AS4-DEV - 2.54\Tools\D2oEditor\Program.cs:line 20

(edited by hydrofluoric: better stack trace formating)

Hydrofluoric0 commented 2 years ago

Hello, It seems that a field is read and its name doesn't exist in the classes definitions of the game data file.

@GrayR0ot Can you please, give me the following information:

Have a good day

GrayR0ot commented 2 years ago

Version: 2.54 Not modified, just downloaded from Ankama CDN

@Hydrofluoric0 Here is my code: var d2OMonsters = new GameDataReader(@"./d2o/Monsters.d2o"); d2OMonsters.Read(); var writer = new GameDataWriter(@"./d2o/Monstersd2o.new"); writer.Write(d2OMonsters.ClassesDefinitions, d2OMonsters.Classes);

Here is my d2o file: https://www.transfernow.net/dl/20211027XKdLJxnw

GrayR0ot commented 2 years ago

Do you have any news ?