emoose / MBINCompiler

Now maintained by monkeyman192: https://github.com/monkeyman192/MBINCompiler
Other
43 stars 69 forks source link

MBIN serializer broken? #53

Closed emoose closed 7 years ago

emoose commented 7 years ago

Noticed that I commented out part of the recompileFiles test which compares the decompiled exml of the recompiled mbin with the exml of the original, just uncommented it and it fails straight away on the first file, METADATA\SIMULATION\SPACE\AISPACESHIPMANAGER.MBIN

The structure is all there, but the values of the strings are blank. The remade MBIN is also only 0x60 bytes, so there's definitely something wrong here.

Making this to remind myself to look into this tomorrow, if anyone wants to try helping in the meantime be my guest.

Bananasft commented 7 years ago

GcAISpaceshipInstanceData.cs contains the field public string File which is using the NMSAttribute. Currently, the NMSAttribute is ignored while deserializing exml.

I fixed this in #50.

emoose commented 7 years ago

It shouldn't be getting ignored, I already pushed a fix for that a few commits ago: https://github.com/emoose/MBINCompiler/commit/bdb37d98ae3c16a6162275b9ae43f69cc93c493c#diff-53c1d1d10f57a89a0704071f7b08e3e7R72

EDIT: Oh sorry I'm too tired lol, your right, it looks like it's still ignored when deserializing from exml to mbin, I'll take a look at your p/r now.

emoose commented 7 years ago

Looks like that fixed it @Bananasft, nice work.

There's still some issues with templates that use GcAudioWwiseEvents though, some reason the value inside GcAudioWwiseEvents is being set to 0 after being recompiled, might be an issue with the xml deserializer.

emoose commented 7 years ago

Ah the DeserializeEXml method didn't support unsigned fields, easy fix: 0977e1c92dda7aad12aa0315ad9a94a52cce1c73

That about does it, tests seem to run fine for me now :100: :100: