anno-mods / FileDBReader

A command line tool for working with a proprietary bluebyte file compression used in Anno 2205 and 1800.
15 stars 4 forks source link

ArgumentException #8

Open chaosflaws opened 2 years ago

chaosflaws commented 2 years ago

Hi there,

just tried using the Savegame Visualizer, which threw an error relating to FileDBReader. So I tried running FileDBReader on its own, using:

FileDBReader decompress -f "..\test\Christian Jäger_S87.a7s"

which gave me the following error:

[READER]: Autodetected FileVersion = Version1
Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: 0
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at FileDBSerializing.FileDBParser_V1.ParseDictionary(Int32 Offset)
   at FileDBSerializing.FileDBParser_V1.ReadTagSection(Int32 OffsetToOffsets)
   at FileDBSerializing.DocumentParser`1.LoadFileDBDocument(Stream s)
   at FileDBReader.src.XmlRepresentation.Reader.Read_Version1(Stream input)
   at FileDBReader.src.XmlRepresentation.Reader.Read(Stream input)
   at FileDBReader.src.ToolFunctions.Decompress(IEnumerable`1 InputFiles, String InterpreterPath, Boolean overwrite, IEnumerable`1 ReplaceOps)
   at FileDBReader.CommandLineHandler.<>c__DisplayClass19_0.<Main>b__0(DecompressOptions o)
   at CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,T4,T5,T6,T7,T8,T9,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 parsedFunc3, Func`2 parsedFunc4, Func`2 parsedFunc5, Func`2 parsedFunc6, Func`2 parsedFunc7, Func`2 parsedFunc8, Func`2 parsedFunc9, Func`2 notParsedFunc)
   at FileDBReader.CommandLineHandler.Main(String[] args)

For what it's worth, the program auto-detects FileVersion 1, which seems odd, as I am using the latest version of Anno 1800.

Using the command

FileDBReader decompress -c 2 -f "..\test\Christian Jäger_S87.a7s"

does not do anything (at least not to my eyes), the error is still the same, I think.

I just tried several other save games, every one gives me the same error.

Am I doing something wrong? What's going on?

taubenangriff commented 2 years ago

The savegame is no filedb file.

It's an RDA archive containing 4 files. each of these is zlib compressed (and at least from my knowledge, has custom file headers).

The uncompressed results are filedb files.

I Should improve exception handling here tho.